procmail
[Top] [All Lists]

help with "forward everything except..."

1998-08-01 11:31:35
Requirement:  Forward most email except for:
        1) a set of known email addresses, preferably listed in a file
external to procmail
        2) * !^FROM_MAILER
        3) * !^FROM_DAEMON
        4) spam (to /dev/null)

everything that meets the conditions of the above recipe gets forwarded.

I think the MAILER, DAEMON, X-Loop and spam filters are readily
available/glommable from various sources, but I'm stumped on how to
easily maintain an external file that lists a number of non-forwardable
email addresses (these could potentially be unique).  Ideal file format
would be one address per line.

I've gotten as far as:

echo `cat email.lst` | sed -e 's/ /\|/g'


where email.lst contains something like:

foo(_at_)bar(_dot_)com
bar(_at_)foo(_dot_)com
dev(_at_)null(_dot_)com


thinking that I would come up with a recipe condition (ultimately)
resolving to:

* !^FROM_ .* 
(foo(_at_)bar(_dot_)com|bar(_at_)foo(_dot_)com|dev(_at_)null(_dot_)com)


any pointers, tips, hints are greatly appreciated.


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