[svlug] procmail (was: Some pretty serious parsing)

Akkana Peck akkana at shallowsky.com
Mon Nov 16 19:51:27 PST 2015


> On 11/17/2015 01:15 AM, Steve Litt wrote:
> > To keep my .procmailrc from becoming too unwieldy, I split it into
> > badguys.rc, by_account.rc, diag_first.rc, diag_second.rc, envvars.rc,
> > fallthrough.rc, maillists.rc, and vitals.rc. I modify the correct one
> > (almost always a new entry to badguys.rc), run a script to
> > update .procmailrc. After reading this thread, I added a backup step to
> > my script so I have a backup of the original .procmailrc.

Ivan Sergio Borgonovo writes:
> That's another place where dovecot sieve shines (possibly other 
> implementations as well).
> 
> You can have multiple recipes that are "auto merged", you can use 
> includes and you can force rules before and after each user personal 
> rules are applied.

Procmail has includes. My .procmailrc is very short and mostly
contains lines like
PMDIR=$HOME/Procmail
INCLUDERC=$PMDIR/lists.rc
INCLUDERC=$PMDIR/spast.rc

The individual .rc files have the actual rules. (Spast is a handy
system for making whitelist and blacklist files and passing subject,
to and from through grep, so you don't have to have separate rules
for every item in your blacklist or whitelist. It's also a good
incentive to get more fluent at regular expressions, so I can
use patterns like v[1i]+a*g+a*r*a and \bRe[-=]*f[il]\b and
p.{0,2}e.{0,2}n.{0,2}i.{0,2}s.*e.{0,2}n.{0,2}l.{0,2}a.{0,2}r.{0,2}g
to match common spam subjects.)

> When you compile your sieve rules you get error messages before anything 
> get screwed. If there are errors nothing get compiled and you keep 
> running the old rules. Dovecot implementation generally gives you enough 
> informative errors to correct your mistakes easily.
> There is a dry-run mode and you can feed emails form text files.

That all sounds like a great improvement over procmail.

> I think there is also a "post processing" mode where you can point a 
> dovecot script to one of your mail folder and it will run a sieve script 
> on it.
> 
> I never felt the need to stop fetchmail once I moved to sieve.

You run both fetchmail and dovecot? Do you set dovecot as fetchmail's
mda? I'm not finding much with google about doing that -- mostly
people asking on mailing lists. I had assumed that using dovecot
would mean running it on the mail server, then accessing the folders
using something like mailsync (is that still maintained?)

        ...Akkana



More information about the svlug mailing list