Using various posts from this forum I got Avast to scan inbound email over stunnel. This was working great but I noticed that one of my accounts wasn’t being scanned for inbound but all of them were being scanned for outbound. The fix was to add another accept/connect for the same email service.
In my case I have two gmail accounts, so I now have two entries for gmail:
[gmail-imaps]
accept = localhost:1993
connect = imap.gmail.com:993
[gmail-imaps2]
accept = localhost:1994
connect = imap.gmail.com:993
I have one account configured for gmail-imaps and the other for gmail-imaps2 and Avast! now scans inbound for both. I don’t know why this has to be configured this way, but it was the only way that I could get it to work.
Have fun!