Getmail, Spamassassin and Procmail

By | 16th September 2004

I got a new server machine recently and spent quite a while getting it back to the same state as my old one. The thing that I found most difficult was getting my mail properly and dealing with it nicely.

I used to use spamassassin run via procmail from getmail version 3 on my P75, but it made it crawl so badly I gave up. When I came to install it this time on a 1GHz Duron, I found getmail had changed a lot and my old config no longer worked. I’d also heard about spamd/spamc and thought it sounded better. I had a lot of problems getting a working system, mainly due to annoying little things so I’ll briefly document them here for the great good (ha!).

Getmail is a much nicer replacement for the evil fetchmail and although it took a bit of getting my head around, version 4 seems even better.

There are examples for all sorts of different uses. I use it to get my email from a pop3 box and then pass it to spamassassin before passing it on to procmail to filter into various folders.

My getmailrc is below

[options]
verbose = 2
read_all = true
delete = true
message_log = ~/.getmail/log


[retriever]
type = SimplePOP3Retriever
server = mail.wrigley.me.uk
username = joe
password = password


[filter]
type = Filter_external
path = /usr/bin/spamc


[destination]
type = MultiDestination
destinations = ("[procmail-as-joe]",)


[procmail-as-joe]
type = MDA_external
path = /usr/bin/procmail
arguments = ('~joe/.procmailrc', )
user = joe

The main problem I had was with getting spamd to work. It was largely down to overlooking the fact that I hadn’t enabled it. D’oh!

In /etc/default/spamassassin (or somewhere similar if not Debian Sarge) make sure that you set ENABLED=1

Then /etc/init.d/spamassassin restart

I can’t be bothered to fully write this up right now. If you think I might know the answer to a question about it all, drop me a line (or leave a comment or something)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.