procmail
[Top] [All Lists]

Re: greenlist RegEx

2003-10-19 19:28:29
Ruud wrote (wroote?),

To check for greenlisted adresses, I have a.o. a file called
green(_at_)list(_dot_)cfg, that contains something like this:

  jantje(_at_)pietje(_dot_)nl
  pietje(_at_)jantje(_dot_)nl
  mina(_at_)anna(_dot_)nl
  anna(_at_)mina(_dot_)nl
  rvtol(\+[^@()]*)?@(hacktic|isolution).nl

I have to use sed, so I came up with this:

  RegEx = `sed -e :a -e '$!N;s/\n/|/; ta' -e 's/\./\\\\./g'
$RC_dir/green(_at_)list(_dot_)cfg`

  :0
  *$ From_Addr ?? $RegEx
  { INCLUDERC = "$RC_dir/deliver.rc" }

I would reverse the logic.  In green(_at_)list(_dot_)cfg, I'd put this first 
line:

GREENLIST="

and this last line:

"

with one address per line between the two quotation marks.

Then in .procmailrc,

 INCLUDERC=$RC_dir/green(_at_)list(_dot_)cfg

 :0
 * $ GREENLIST ?? ^$From_Addr^
 { INCLUDERC = $RC_dir/deliver.rc }

And then you don't need to run sed.


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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