procmail
[Top] [All Lists]

Re: How to get the senders email address in the perl script where procmail forwarded the mail ?

2007-10-07 17:02:42

On 7-Oct-2007, at 16:58, Dallman Ross wrote:
   :0
   * $ ^From:$WS+\/[^$WS]+
   { FROM=$MATCH }

That will not work, presuming that WS is set to a space and a
tab, for two different reasons.  You wanted to write:

     * $ ^From:[$WS]+\/[^$WS].*

Yep, you're right, should have checked my procmailrc instead of  
typing from memory.

However, that, too, is not ideal, for two reasons.
1) It is perfectly legitimate to have no whitespace after the
   colon;

Er.. I don't have the rfc in front of me, so you MAY be right, but  
I've NEVER seen it in 20 years of email.

     * $ ^From:.*\/[^$WS].*

I prefer to match on know characters when possible than just  
wildcarding for any old thing.  That said, I prefer the 'bare from'  
of the formail version anyway.


-- 
<[TN]FBMachine> i got kicked out of barnes and noble once for moving  
all the bibles into the fiction section

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail