Regex Help For Procmail

Frank Shute frank at shute.org.uk
Tue Sep 7 01:51:28 UTC 2010


On Sun, Sep 05, 2010 at 09:33:31AM -0700, Drew Tomlinson wrote:
>
[snip]
> 
> No, still not matching.  Basically, why doesn't this header:
> 
> From: "Famous Smoke Shop" <Announce at email.famous-smoke.com>
> 
> Match this procmail recipe:
> 
> :0
> * ^From:.*famous-smoke.com>$
> "${HOME}/Maildir/.Shopping/Famous Smoke/Email/"
> 
> From my procmail log:
> 
> procmail: No match on "^From:.*famous-smoke.com>$"
> 
> Thanks,
> 
> Drew
> 

I additionally don't like the look of your Maildir. It's quoted, you
should set MAILDIR in procmailrc, you should get rid of the space and
it should end in "new". Result:

:0
* ^From:.*famous-smoke\.com
.Shopping/Famous_Smoke/new

I don't know what you're using for maildirmake but here's a script you
can adapt:

----

#!/bin/sh
#
# Usage: maildirmake <somemaildir>

mkdir $1
mkdir $1/new
mkdir $1/cur
mkdir $1/tmp
chown frank:frank $1/new
chown frank:frank $1/cur
chown frank:frank $1/tmp
chmod 700 $1
chmod 700 $1/new
chmod 700 $1/cur
chmod 700 $1/tmp

----

You have to run it from where you keep your maildirs i.e MAILDIR

So if you have your maildirs in Mail:

$ cd ~/Mail
$ mkdir .Shopping
$ cd .Shopping
$ maildirmake Famous_Smoke

For your ref, here's my procmailrc


PATH=/usr/local/bin
SHELL=/bin/sh
ORGMAIL=$HOME/Maildir/new
PMDIR=$HOME/.procmail
LOGFILE=$PMDIR/log
VERBOSE=on
MAILDIR=$HOME/Mail
DEFAULT=$HOME/Maildir/new
LOGNAME=frank
INCLUDERC=$PMDIR/rules


Regards,

-- 

 Frank

 Contact info: http://www.shute.org.uk/misc/contact.html




More information about the freebsd-questions mailing list