[Techtalk] procmail recipe wont work

Conor Daly conor.daly-linuxchix at cod.homelinux.org
Wed Jan 10 20:20:17 UTC 2007


On Wed, Jan 10, 2007 at 08:37:43PM +0100 or so it is rumoured hereabouts, 
Wim De Smet thought:
> On 1/10/07, Conor Daly <conor.daly-linuxchix at cod.homelinux.org> wrote:
> >So, I'm trying to put together a procmail recipe to forward a particular
> >source to a list.  The source address is:
> >
> >first.last+marker at example.com
> >
> >where first.last at example.com is the address our mailserver forwards to my
> >account.  The '+marker' bit is to distinguish a particular sender for
> >procmail.  The current recipe is:
> >
> >:0
> >* ^TOfirst.last+marker at example.com
> 
> Looks weird to me. I thought this just got passed to egrep in which
> case it should be something like:
> * ^To: *first.last+marker at example.com
> or
> * ^To: first.last+marker at example.com (since there's usually only one
> space there anyway)
> 
> I seem to be missing something here but I don't know why you wrote TO
> and then the address straight behind it. It's probably case
> independent but skipping the ':' and the space shouldn't work. Sorry
> if I'm completely wrong here.

This is supported by procmail.  It expands to any of the possiblities in
the error message below.  

procmail: No match on "(^((Original-)?(Resent-)?(To|Cc|Bcc)|
(X-Envelope|Apparently(-Resent)?)-To):(.*[^a-zA-Z])?)
first.last+marker at example.com"

On the other hand, using '^To:.*first.last...' would match only a line
beginning 'To:...' and wouldn't match any of the others.  In any case it
turns out the '+' has a special meaning and needs to be escaped.

* ^TOfirst.last\+marker at example.com

works nicely...

Conor
-- 
Conor Daly <conor.daly at cod.homelinux.org>
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/G/S/O d+(-) s:+ a+ C++(+) UL++++ US++ P>++ L+++>++++ E--- W++ !N
PS+ PE Y+ PGP? tv(-) b+++(+) G e+++(*) h-- r+++ z++++ 
------END GEEK CODE BLOCK------
http://www.geekcode.com/ http://www.ebb.org/ungeek/


More information about the Techtalk mailing list