Grep from file
wpmccormick at sbcglobal.net
Wed Nov 28 18:43:32 CET 2007
I have a recipe:
FROM=|$FORMAIL -rzxTo:|$TR / _
* ? $GREP -i ^$FROM $TRAVEL
This sends any e-mail with a from address that is found in the .travel
file to the Travel folder.
What I need now is a $DOMAIN variable so I can sort any mail from a
domain (listed in the file) to its folder of happiness.
I'm thinking there's some esoteric way to do this with formail and
sed, but I don't know sed well enough.
Something like ...
DOMAIN=|$FORMAIL and sed to find the domain.com part of the $FROM
Then I can do something like this? ...
* ? $GREP -i ^($FROM|$DOMAIN) $TRAVEL
I think the ^($FROM|$DOMAIN) part is actually not correct either.
Is there a real easy way to do this that I'm missing?
More information about the procmail