Automation IMAP Trigger

I get the following error:

Lost imap.gmail.com (will attempt to reconnect)

And more, after connecting my binary.sensor_mailcount_increase is always off… if i set it to on the automation works greatly