Dale <dale(_at_)elad(_dot_)com> writes:
I have an autoresponder that detects forwarded messages from _known_
offenders who continue to forward joke lists and other annoying things
to me (these people also send me legitimate mail, so I don't want to
filter them altogether).
Today, for some reason, there's a problem. Messages are properly detected
and an autoreply is sent, but the body is empty (neither the reply.txt file
nor the original message body shows up in the reply). Another similar
autoresponder, using the same formail flags, etc., works fine. Does anyone
see a problem with the recipe that may cause this? Here it is (the names
have been changed to protect the innocent :-):
:0
* !^FROM_MAILER
* !^X-Mailer: dale(_at_)elad(_dot_)com
* ^From.*(offender1|offender2|offender3|offender4|offender5)
* ^TO_me(_at_)mydomain(_dot_)com
* ^Subject:[ ]*(FW|FWD):
{
:0 fhw
| cat - /home/myaccount/.procmail/reply.txt
:0
| (formail -krfqp "" -A "Precedence: junk" -I "X-Mailer:
dale(_at_)elad(_dot_)com" \
-I "From: Dale W. Neumann <dale(_at_)elad(_dot_)com>" \
-i "Subject: A message about unwanted mail...") \
| sendmail -t
}
Server is running Procmail v3.13.1 on Red Hat Linux release 4.0, Kernel 2.1.8.
You should be refering to sendmail as $SENDMAIL and your formail flags are
slightly odd (-q is the default, -f has no effect when auto-replying, and
-p "" is the same as -b). The Subject: regexp could also be simplified.
You are also using X-Mailer: to do what most everyone else does with
X-Loop:. X-Mailer: usually contains the version of mail program used,
not a loop control address. There can be only one Precedence: header,
so you should insert it with the -I (-i) flag, while the X-Loop: header
can occur multiple times and so should be added with the -A flag.
I would write the above as:
:0
* !^FROM_MAILER
* !^X-Loop: dale(_at_)elad(_dot_)com
* ^From.*(offender1|offender2|offender3|offender4|offender5)
* ^TO_me(_at_)mydomain(_dot_)com
* ^Subject:[ ]*FWD?:
{
# Use $HOME instead of writing out the path
:0 fhw
| cat - $HOME/.procmail/reply.txt
# Don't need the paren, they just waste a process
:0 w
| formail -rkb \
-I "Precedence: junk" \
-A "X-Loop: dale(_at_)elad(_dot_)com" \
-I "From: Dale W. Neumann <dale(_at_)elad(_dot_)com>" \
-i "Subject: A message about unwanted mail..." \
| $SENDMAIL $SENDMAILFLAGS -t
}
That said, the best way to find the problem with your recipe would be
to put VERBOSE=on above the recipe and see what shows up in the logfile.
Philip Guenther