procmail
[Top] [All Lists]

Re: .procmailrc processing of To: field

1997-03-12 13:04:27
Mike de Laine <Mike(_dot_)de(_dot_)Laine(_at_)innosoft(_dot_)com> writes:
I've setup my .procmailrc file with the following:

PATH=$HOME/bin:/usr/bin:/usr/ucb:/bin:/usr/local/bin:.
MAILDIR=$HOME/mail      # You'd better make sure it exists
DEFAULT=$MAILDIR/Inbox

:0:                             # Anything to test 
* ^To:(_dot_)mike+test(_at_)*
test                            # will go to $MAILDIR/test
...
Mail sent with a subject containing questions is processed correctly,
but I don't seem to be able to achieve the correct processing based upon
the To: address.

The line extracted from the received message is:
To: mike+test(_at_)minerva(_dot_)innosoft(_dot_)com

What am I missing?


Both David Tamkin William Evans have sent excellent explanations of the
regexp problem, but there's one other comment I'd like to make.

If your mailsystem is correctly handling the "+detail" format, then it
_should_ be passing that info to procmail as $1.  Thus, you should be
able to say:


ARG = $1

:0:
* ARG ?? ^^test^^
test


The neat thing about that is that $1 comes from the envelope recipient,
and not the header recipient, and therefore the above will even work if
you, for instance, subscribed to a mailing list using the address
        mike+test(_at_)minerva(_dot_)innosoft(_dot_)com
where the above address would not appear in the header at all.

Philip Guenther

<Prev in Thread] Current Thread [Next in Thread>