Posted on Thu 26 July 2018

replace procmail with maildrop

By all means, replace procmail with maildrop.

If you haven’t read a procmailrc in a few months, it’s so much line noise and you need to consult the man pages again.

If you haven’t read a maildrop recipe file, well – here’s a nearly maximum-complexity snippet:

   xfilter "/usr/bin/spamc -U /var/lib/spamassassin/socket"
      if (/^X-Spam-Status: Yes/)
      {   
        to Maildir/spam/
      }

   `reformail -D 16000 duplicate.cache`
   if ( $RETURNCODE == 0 )
       exit

   if (/^X-Facebook.*/:h)
       to Maildir/facebook/

   if (/^Subject: \[Slack\] Notifications.*/:h)
       to Maildir/slack/

You now know how to do 90% of everything you’ll ever want your mailfilter to do, and debugging it next year will be simple.


© -dsr-. Send feedback or comments via email — by continuing to use this site you agree to certain terms and conditions.

Built using Pelican. Derived from the svbhack theme by Giulio Fidente on github.