procmail
[Top] [All Lists]

greenlist RegEx

2003-10-19 18:51:48
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" }


The From_Addr comes from the From_header.

Of course, that green(_at_)list(_dot_)cfg might grow a lot bigger. Is there a 
cleaner
way (with sed) to cope with that? If not, I might start to use the first
letter of the domain-name as a letter in the green(_at_)list-X(_dot_)cfg
so that mina+test(_at_)server(_dot_)anna(_dot_)nl will be in 
green(_at_)list-a(_dot_)cfg
because anna starts with an a.

-- 
Affijn, Ruud


_______________________________________________
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>