On Fri, 17 Jan 1997 14:26:52 -0800 (PST),
mailbox <dnhunt(_at_)rain(_dot_)org> wrote:
^^^^^^^ (!?)
I'm trying to get procmail to something like this:
* ^From:.*(`cat $PMDIR/file`)
The backticks will actually substitute all newlines in the output of
the cat with a space. Probably not what you want. Try this (swiped
from an old post by wotan(_at_)netcom(_dot_)com, I think):
SENDER=`formail -rtzx To:`
:0 h
* ? test -f ~/.procmail.reject
* ? echo "$SENDER" | fgrep -s -f ~/.procmail.reject
{
:0
/dev/null
}
You can change the parts you don't like, of course. The use of formail
to get the sender is a useful generalization, since you can't simply
assume that "From:" is going to be present or correct. (See RFC-822
for all the gory details.) The line with the test seems a bit
redundant to me -- I'd expect my home directory to be mounted if my
.procmailrc is being read -- but it doesn't cost much and is a
reasonable safeguard against having stuff sent to /dev/null by
accident. If you're sending it somewhere else, you might consider
skipping the test.
From reading the grep manpage it seems that egrep uses either pipe or
newline as the 'or' seperator. Is that true for procmail?
No. An escaped newline is omitted entirely, an unescaped newline
terminates the current recipe line. (Correct?)
/* era */
Soory fro any tyops,-) I'm on a flaky PPP line.
--
See <http://www.ling.helsinki.fi/~reriksso/> for mantra, disclaimer, etc.
* If you enjoy getting spam, I'd appreciate it if you'd register yourself
at the following URL: <http://www.ling.helsinki.fi/~reriksso/spam.html>