procmail
[Top] [All Lists]

Re: Regular Expression Misunderstanding

1998-11-27 20:02:38
On Fri, 27 Nov 1998, David W. Tamkin wrote:

Era Eriksson commented on Adam Bailey's reply to whoever had originally
asked the question ... 

|     :0:
|     * (^From:|^TO_)(.*\<)?someaddress\>
|     somefolder

Rather than muck with the matching in ^TO_, I'd suggest this:

      * (^From:(.*\<)?|^TO_)someaddress\>

| or even just
| 
|     :0:
|     * ^(From|To)(.*\<)?someaddress\>
|     somefolder

The problem there is that you lose matching on Cc:, Resent-To:, and such
other lines that ^TO and ^TO_ would catch. 

Here's the version I use that I downloaded from Martin Ramsch's page
(http://www.forwiss.uni-passau.de/~ramsch/Software/ef2p/index.phtml.en):


# Get the sender's address (search order like in Filter).
# (1st recipe is non-delivering, so Procmail will continue.)
EF2P_FROM
:0
* ! ^Reply-to:[         ]+\/[^  ].*
* ! ^From:[     ]+\/[^  ].*
* ! ^From[      ]+\/[^  ]+
{ }
  :0E
  { EF2P_FROM = $MATCH }


Then, as an example, here's the syntax of how it's used:

:0:
* EF2P_FROM ?? (_dot_)*batchman(_at_)slip\(_dot_)net
$MAILDIR/TEST


------

My question is...does that cover everything, or should I add / modify it?

Greg

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