Landy Roman <landie(_at_)concentric(_dot_)net> writes:
...
here is the log
Subject: CUT YOUR CELL BILL IN 1/2
Folder: /usr/bin/formail -rf -I X-Mailer: Virtuoso spam processing -I
2415
Usage: formail [-vbczfrktqY] [-D nnn idcache] [-p prefix] [-l folder]
[-xXaAiIuU field] [-R ofield nfield]
...
:0
* !((^TO_.*landie))
| /usr/bin/formail -rf -I "X-Mailer: Virtuoso spam processing" -I
"From: IVirtuo" -i "Subject: Your message has been deleted"
| cat - $HOME/spam_error | sendmail -t
$PMDIR/spammer_will_be_deleted
In no particular order:
1) You need to put backslashes at the end of any lines that are wrapped.
2) If you want to both generate an autoreply and save the message then you
need two recipes: a recipe can only have one action.
3) Let PATH do its job and find formail for you
4) On the otherhand, sendmail is often hidden away, so use $SENDMAIL for it
(procmail sets the SENDMAIL variable for you, so don't set it yourself!)
5) I hope you handle all your mailing lists before this recipe, because
it'll reject/catch messages from most mailing lists.
6) You should try to prevent mail loops from occurring. Not sending
replies to mailer daemons would be a good start, and adding and checking
for an X-Loop: header would be good as well.
7) Don't put ".*" after ^TO_ or ^TO as they include the necessary regexp
bits already.
8) You can save 'cat' some work by not feeding formail's output through it
9) Is "IVirtuo" really a valid email address? The From: header should be
valid for replies (which will be important when one of these messages
accidentally goes to your boss or to a client)
Putting all of those together, we get:
:0
* ! ^TO_landie
{
XLOOP = landie(_at_)concentric(_dot_)net
:0 hcw
* ! ^FROM_DAEMON
* ! $ ^X-Loop: *$\XLOOP
| ( formail -rf \
-I "X-Mailer: Virtuoso spam processing" \
-I "From: IVirtuo" \
-i "Subject: Your message has been deleted" \
-A "X-Loop: $XLOOP" ; \
cat $HOME/spam_error \
) | $SENDMAIL $SENDMAILFLAGS -t
:0
$PMDIR/spammer_will_be_deleted
}
Philip Guenther
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail