Prozac,
I do not use STunnel myself (I haven’t set it up to test with my Gmail) but I am familiar with similar programs and I am pretty sure I know how it works. Others, far my knowledgeable than me, will step in and give you the finer details.
avast works for POP3 and SMTP by being able to intercept the well known ports that almost all mail clients use to receive POP3 and send SMTP.
As we discussed before avast cannot read the message streams if they are encrypted and the encrypted services usually different ports from the ones avast is looking at.
So what is happening with STunnel?
Let’s consider the regular POP3/SMTP case for regular non-encrypted accounts.
When your mail client tries to contact your POP3 mail server the connection is intercepted by avast which fools your mail client into thinking avast is the mail server. avast then really contacts your mail server so avast is now sitting between your mail client and the mail server. avast gets to see all the mail flow between your mail client and your mail server.
So, Your mail client > avast > Your mail server > avast > Your mail client
This way avast gets to read all the messages going from your mail server before they reach your mail client to make sure they are free from infection.
The picture is very similar for sending mail via SMTP:
Your mail client > avast > Your SMTP server > avast > Your mail client
and in this case avast gets to scan your mail going out before it is delivered to your SMTP server.
As we have said, avast cannot handle the encrypted connections so for that we introduce STunnel which can. So in this picture your mail client needs to work unencrypted with avast still but instead of avast connecting to your mail server it must be told to connect to STunnel which handles the encrypted connection from your system to the mail server.
So now the POP3 picture is:
Your mail client > avast > Stunnel > Your mail server > STunnel > avast > Your mail client
and on the SMTP mail sending side:
Your mail client > avast > Stunnel > Your SMTP server > STunnel > avast > Your mail client
This way avast is still able to scan the POP3 and SMTP mail streams and to add the “scanned” message text if that is selected.
To the best of my knowledge, in this setup you would not use The Bat plugin since scanning is achieved via a different route.
It is probably clear from the above descriptions that you must have STunnel running on your system whenever you want to connect to Gmail.
I’m sure that it is included in the instructions you have been given but you will need to ensure that in the Internet Mail provider > Customize > Redirect Tab > make sure the “Ignore local communication” is unchecked.
I hope that this has been a little help.