How to replace procmail with fdm

 

 

 

Procmail is still widely used although it is no longer maintained. Its former maintainer on OpenBSD, Philip Gunther, has said that it should be removed from the ports list because of security vulnerability, although it is still there. A suggested alternative is fdm, which both fetches the mail from a POP3 server and filters it, thus replacing both fetchmail and procmail.

I’d been using procmail with fetchmail for a long time but I thought perhaps I should switch to fdm. The main difficulty was that the documentation I found was less complete than what is available for procmail and it took me a fair amount of time to configure it to use my spam filter, which is qsf.

Here is my fdm.conf for anyone who is thinking of making the same switch.  Qsf writes “SPAM” in the subject line of suspect emails so that’s what I filter on.

My fdm.conf


# fdm.conf – see the fdm manual for explanations of the code.

# Set the maximum size of mail:
set maximum-size 128M

# connection settings for my ISP’s mail server:
account “<my POP3 account>”
pop3 server “<my POP3 server>”
user “<my email address>”
pass “<my password>”

# filtering rules (adapted from my .procmailrc):
match “^(To|Cc):.*lyx-users@lists.lyx.org” action mbox “%h/Mail/lyx-users”
match “^(To|cc|Cc|Sender): .*misc@openbsd.org” action mbox “%h/Mail/openbsd”

# forward some mail to a different account (see “My forward file” below):
match “^From:.*Facebook” action pipe “%h/.forward”

# Spam filter rules:
action “spamfilter” rewrite “/home/ac/bin/qsf -s”
match all action “spamfilter” continue
match “^Subject:.*SPAM” action mbox “%h/Mail/spam”

# Set spoolfile for incoming mail:
action “inbox” mbox “/var/mail/ac”
match all action “inbox”


My .forward file

smtp <user@example.com>