1

I'm a newbie trying to work out the following mail solution on a laptop where I'm the only user:

getmail - spamassassin - procmail - mu4e (an emacs mail program)

Right now I'm succeeding at

getmail                -            mu4e

With my former mail program (emacs gnus) I was successfully implementing spamassassin as spamd daemon.

I think I understand how to tell getmail to filter mail through spamassassin and send it on to procmail. How should I write my .procmailrc file to send spamassassin-processed mail on to its final "spam" or "not-spam" destination in my email program?

AnFi
  • 1,098

1 Answers1

2

I would suggest using fetchmail (with mda option) instead of getmail.

getmail configuration: ~/.getmail/getmailrc - deliver via procmail

To deliver with an external MDA:

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

[procmail-as-bob]
type = MDA_external
path = /path/to/procmail
arguments = ('~bob/.procmailrc', '-f', '%(sender)')
user = bob

procmail configuration with spamassassin/spamc: ~/.procmailrc

# default/fallback delivery destination
DEFAULT=Maildir/

# rewrite message using spamassassin or spamc
# :spamassassin.lock lock is not necessary for spamc 
# (it makes some sense for spamassassin)
:0fw: spamassassin.lock
* < 256000
| spamc

# Mails with a score of 15 or higher are almost certainly spam (with 0.05%
# false positives according to rules/STATISTICS.txt). Let's put them in a
# different mailbox. (This one is optional.)
# locking (trailing : ) is not necessary for deliveries to maildir 
:0:
* ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
Maildir/almost-certainly-spam/

# All mail tagged as spam (eg. with a score higher than the set threshold)
# is moved to "probably-spam".
# locking (trailing : ) is not necessary for deliveries to maildir
:0:
* ^X-Spam-Status: Yes
Maildir/probably-spam/
AnFi
  • 1,098