Mark J. Bynum asked:
For example, say I want to match on the word "bulk" however
one of received headers as bulkmail.com in it. I want to totally
ignore it. I don't want to say something like:
* bulk
* !^ Received:.*bulk
What will happen is if bulk is in the message but also in the Received
header it won't match. What I want is if it is in either the body
or header (not looking at the Received header) to match on it.
David's answer, using scoring, is perhaps "better," and I certainly
am not disagreeing, but I'd go with something like the following
in "real life" because:
1. I can never remember how scoring works :-)
This is actually reasonably important because if my
.procmailrc starts causing trouble, I don't want to
be digging through logic that I have to figure out again.
2. I dislike checking the message body unless absolutely
necessary, so I'd prefer to do the header checks first.
3. Note, I'm willing to say that all headers starting
with "Re" must be "Received:" but you can extend the logic
as much as needed:
:0 other_flags
* ! ^([^R]|R[^e]).*bulk
* ! B ?? bulk
* { } # not bulk
:0E other_flags
{ action_for_bulk }
(untested, as usual :-)
Other potential issues, depending on your needs:
1. Do you really want to match other words, like "bulkhead"?
If not, then replace bulk with \<bulk\> in whatever you use.
(That might also cure your "bulkmail.com" issue enough
that you can forget about the Received header issue.)
2. What do you want to do if the body is or contains, say,
a base64-encoded MIME message? If "bulk" appears,
then it is only a coincidence. On the other hand,
if it's base64-encoded text/plain (something Pine does
with attached text files, which I disapprove of since
it's not even optional for the user, but that's getting
off-track), then you need to decode the base64 part if
you want to find "bulk" in the encoded message part.
Cheers,
Stan
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail