> I'm trying to use your headers.rc include file, but I can't get the $FROM
> macro to work. The mail is coming from a friend, whose From: line is:
> John Doe <jdoe(_at_)nowhere(_dot_)com>
> but I never get a match. The logfile has the full expansion of $FROM in
> and I am confused. I also tried it without the POST_ADDR_SPAN, but that
> didn't work either.
> My .procmailrc:
Huh? This is a procmail script, not a shell script. Get rid of this line.
> MAILDIR=$HOME/Mail # You'd better make sure it exists
> # Pull in the standard header patterns
So, the "headers.rc" file is at $HOME/Mail/rc.files/headers.rc"?
If the file is not at the right place, procmail will not post an
error, and keep right on going.
> # Zip friend's email to the other account
> * $ $FROM(jdoe(_at_)nowhere(_dot_)com)POST_ADDR_SPAN
> | formail -A "X-Loop: $HERE"
> | sendmail -oi $THERE
Two big problems here:
1. POST_ADDR_SPAN has no '$' to mark it as a variable, so it
is matched as literal text. Which fails. Always. Unless
you get mail from "POST_ADDR_SPAN" :^)
Also, you don't really need POST_ADDR_SPAN unless you wish to match
something else after the address. If the match is okay up to the
beginning of $POST_ADDR_SPAN, then you are pretty certain of a good
match--extra matching is superfluous.
2. You cannot continue an action without an escaped newline. The recipe
| formail -A "X-Loop: $HERE" \
| sendmail -oi $THERE
Another way, though is:
| formail -A "X-Loop: $HERE"
! -oi $THERE
I prefer the second method because:
* it is more efficient, since formail doesn't have to read the entire
* it is more portable, since it uses the pre-configured delivery agent,
$SENDMAIL $SENDMAILFLAGS, which may not always be sendmail.
Alan Stebbens <stebbens(_at_)sgi(_dot_)com> (415) 933-6437
Digital TV, Silicon Interactive Group, Silicon Graphics, Inc. (SGI)
M/S:9L991, 2011 N. Shoreline Blvd., Mountain View, CA 94043
PGP Key Fingerprint: 94 A7 4B AB 1C F0 4D 92 DD BC B5 D7 11 A0 DC B3