Earlier today, by way of research, I decided to take a look at how SpamBayes works with Thunderbird.
SpamBayes turns out to be a simple local proxy application, it does not use the same kind of transparent proxy intercept used by avast. Without avast involved this would be the picture:
Thunderbird <-------> SpamBayes local server <--------> POP3 Mail Server
And
Thunderbird <-------> SpamBayes local server <---------> SMTP Mail Server
This setup works as it should. (Though it not entirely clear to me the value of spam scanning outbound mail – the SpamBayes product provides this feature).
With avast scanning inbound and outbound mail the picture (which requires no intervention by the user) looks like:
Tbird <—> SpamBayes ↔ avast intercept <----> POP3 Mail Server
and
Tbird <—> SpamBayes ↔ avast intercept <----> SMTP Mail Server
With avast inbound and outbound scanning turned on then for the incoming (POP3) side avast intercepts the POP3 (port 110) calls by SpamBayes. The email messages are successfully scanned by both avast and SpamBayes and properly relayed back to the Thunderbird client.
Unfortunately, as reported by the originator, on the outbound side the sending of email via SMTP hangs on any message, no matter how small, and never completes. Avast does connect to the SMTP server, transmission starts but never completes. If the avast team care to see it I have the ashMaiSv log of the transmission.
For the above configuration, on the send side if SpamBayes scanning is off then avast scanning works fine. If avast scanning is off then SpamBayes scanning works fine – just not both together.
So the user would be left, at present, with the choice to turn off either avast outbound scanning or SpamBayes outbound scanning.
However, I looked at an alternative configuration. In this configuration the picture looks like:
Tbird <—> avast intercept ↔ SpamBayes <----> POP3 Mail Server
and
Tbird <—> avast intercept ↔ SpamBayes <----> SMTP Mail Server
This configuration works, with both inbound and outbound mail successfully scanned by avast and SpamBayes and delivered as intended. It does need to use the configurability of avast and the above configuration must be used for sending and receiving in order for both to work.
This configuration needs to be set up by the following changes in Thunderbird, avast and SpamBayes:
- Thunderbird
Choose new ports (not 110 or 25) for the connection between Thunderbird and SpamBayes.
In the Thunderbird mail account the server will be localhost and the POP3 port 7110 (just my example – change the port number if you wish). For the SMTP setting for the account the server will be localhost and the SMTP port 7025 (again change the port number if you wish). Save the settings.
- Avast
Tell avast to scan the ports we just entered into Thunderbird. In the Internet Mail scanner select Customize > Redirect tab
In the POP box change it to 110,7110
In the SMTP box change it to 25,7025
Uncheck the Ignore local communication box – don’t miss this step
Select OK.
Now edit the avast4.ini file (in Program Files\Alwil Software\Avast4\DATA folder). In the section headed [MaiScanner] add a line
IgnoreProcess=sb_tray.exe
Save the file.
- SpamBayes
In the SpamBayes configuration leave the POP3 server name as it is but change the port number to 7110. Leave the SMTP server name as it is but change the port number to 7025.
Save the settings.
You should now be ready to go.
Explanation:
By selecting new port numbers and telling Thunderbird, avast & SpamBayes about them we are enabling avast to scan mail on the links from Thunderbird to SpamBayes. By using the ‘ExcludeProcess’ option we are telling avast not to intercept the links from SpamBayes to the POP3/SMTP mail servers since we know the SMTP part of that does not work at present with avast and SpamBayes together and if we did not then avast would scan the mail twice (and if directed would add double clean messages). The net result is that both POP3 and SMTP mail is scanned by avast and SpamBayes.
The small print … this was tested and shown to work with one email account, one POP3 server and one SMTP server. It cannot be assumed that it will work in a multiple account setting.