Retrieving Emails From Remote Servers With getmail (Debian Etch) - Page 2
4 Integrating SpamAssassin Into getmail
If you'd like getmail to invoke SpamAssassin, you can do it as follows:
First we must install SpamAssassin. As root, we run
apt-get install spamassassin spamc
Then we must configure SpamAssassin. This can be done in the file /etc/mail/spamassassin/local.cf. A valid file could look like this:
(The comments in /etc/mail/spamassassin/local.cf will tell you more about the above settings.)
If you enable Bayes (use_bayes 1), it is important that you put the line
into /etc/mail/spamassassin/local.cf so that Bayes ignores headers added by getmail.
Finally we must enable the SpamAssassin daemon by setting ENABLED to 1 in /etc/default/spamassassin:
Then we start the SpamAssassin daemon:
Now log in as falko again on the command line and open ~/.getmail/getmailrc and add the following [filter] section:
(If this is not your first [filter] section, you must rename the first [filter] section to [filter-1], the second one to [filter-2], and so on.)
That's it. SpamAssassin is now integrated into getmail.
5 Integrating ClamAV
ClamAV is a project that publishes new releases very often, and once a new release is published, old versions will print out warnings. Therefore we must make sure that we install the latest ClamAV release by adding the following line to /etc/apt/sources.list (as root):
Afterwards we update our packages database:
(- if you get GPG warnings, you can ignore them -)
and install ClamAV:
apt-get install clamav clamav-base clamav-daemon clamav-freshclam
Then log in as the user falko again and edit ~/.getmail/getmailrc. If you want getmail to delete virus emails, add the following filter:
If you want getmail to deliver infected messages, add the following filter instead:
Again, keep in mind what I said about multiple [filter] sections in the previous chapter:
If this is not your first [filter] section, you must rename the first [filter] section to [filter-1], the second one to [filter-2], and so on.
That's it for the ClamAV integration.