I'm having a similar problem.
I have two gmail accounts that I am connecting to via Outlook 2013. The first will connect via IMAP SSL with no problems. The second account, using the same IMAP settings, but with a different login, will not connect with Avast running. I have a third IMAP connection to a different email system and that works fine. So,
I see the following error in the mail.log file: Cannot connect to IMAP server 2607:f8b0:400d:c08::6c (2607:f8b0:400d:c08::6c:993), connect error 10051
The IMAP server is imap.gmail.com.
The error message indicates a problem with Avast and IPv6 when opening multiple SSL connections to the same IMAP server.
Scenarios Tested
IPv6: Enabled, Avast Mail Scanning: Enabled - First IMAP connection using my primary gmail account works, second connection with different account to the same IMAP server fails
IPv6: Enabled, Avast Mail Scanning: Disabled - Both IMAP accounts connect and login
IPv6: Disabled, Avast Mail Scanning: Enabled - Both IMAP accounts connect and login