[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Getmail version 4 + spamassassin + procmail



Replying to my own message in case anyone cares, I've sorted out my
problems and got getmail and spamassassing working together properly.

For anyone who wants to do the same thing, here's what I did...

Installed getmail version 4 from
http://www.qcc.ca/~charlesc/software/getmail-4/

It's much nicer than fetchmail and I haven't lost mail with it like I
did with fetchmail. Just follow the instructions for the installation.

Install spamassassin and spamc packages. Something which had me stumped
for a while was that you have to actually enable spamd from the
spamassassin package. To do this edit /etc/default/spamassassin and set
ENABLED=1

Then you can start spamd with /etc/init.d/spamassassin restart.

I use procmail to filter the mail that's been spam filtered into
different folders based upon their spam rating. To use this you need to
create the folders in your Maildir (use your mail client to do this,
it's a lot easier). In my case I've created probably-spam and
almost-certainly-spam

My getmailrc and .procmailrc are attached.

Maybe this will be useful to somebody.

To run getmail automatically periodically, run:

crontab < getmail.cron


--
Joe Wrigley
Clockwork Software Systems


intY has scanned this email for all known viruses (www.inty.com)
MAILDIR = /home/joe/Maildir
DEFAULT=$MAILDIR
LOGFILE = /home/joe/.procmaillog.txt
VERBOSE = yes


:0
* ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
.almost-certainly-spam/

:0
* ^X-Spam-Status: Yes
.probably-spam/

:0
*^TOnottingham@mailman.lug.org.uk
.NottLug/

:0
*^List-Id: South Birmingham Linux User Group  <sb.mailman.lug.org.uk>
.SBLug/

:0
*^List-Id: Birmingham Perl Mongers mailing list <birmingham-pm.mail.pm.org>
.Birmingham-PM/

:0
./
*/30 * * * * /usr/bin/getmail >/dev/null 2>&1
[options]
verbose = 2
read_all = true
delete = true
message_log = ~/.getmail/log

[retriever]
type = SimplePOP3Retriever
server = mail.example.com
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

Reply to: