I want to sink mails satisfying certain criteria and right now, I have the
following in my rc file.
PM="postmaster"
SINK1="telecom.*${PM}.*telstra\.com\.au"
SINK2="wmdata.*${PM}.*wmdata\.com"
SINK3="${PM}.*valuerx\.com"
SINK4="fredricton.*${PM}.*shl\.com"
SINK5="nex400.*${PM}.*comnexo\.pt"
SINK="($SINK1|$SINK2|$SINK3|$SINK4|$SINK5)"
:0
# Match based on the true sender i.e. envelope From_ line
* $ ^From .*$SINK
/dev/null
Questions:
1. Well, this is fine, but I want to add to the list and I can see the list
getting pretty long.
How can I put all this in a file and use
* ? egrep -f killfile
2. Is using 'egrep' less efficient than giving a long (RE1|RE2|...) to
procmail?
3. Right now, I am only killing based on the envelope From_ header. What if
I want to kill
o based on certain other headers or
o even patterns in the message-body or
o worse even, patterns in one of the text/plain attachments of the
message? (some mailer daemons return the original message or diagnostic
message as a MIME text/plain attachment)
4. What if I want to combine the 2 approaches i.e.
o From_ header contains RE1 and body contains RE2
As always, I am looking for the most efficient way to achieve all this.
My apologies if this is a FAQ. I did look up the best_of_procmail.gz file,
but could not quite get this answered.
Thanks for any help,
Regards,
Vikas