Hello procmail users,
Thanks for the help yesterday I appreciate it. I have one more
question the formail/procmail/procmailex page does not seem to
be to clear on. I want to do the following if a note is received
from an offending user:
1) log it
2) send root a note saying that an abuse note has been received and
include the sending message, all headers, and have a subject of
ABUSE INCIDENT
3) Send an auto response back to the abuser warning him that his sending
mail here is unauthorized.
I have been reading the man pages now for 10 hours and feel like I
know a lot more about procmail, but I am not sure on how to
accomplish #2 completely. I have attached what I came up with but
it is not working correctly.
If anyone can help I would appreciate it.
Thanks a bundle,
Ryan
BTW: Wanted to thank these guys especially:
Scott Fabbri
era eriksson
# Abuse Recipe
NL=""
:0
* ^From\<+\/test(_at_)test\(_dot_)com(_dot_)*
{
# Log an abuse incident to the procmail log
LOG="procmail: message from $MATCH$NL"
# save a copy of the trouble email
:0c:
abuse.emails
# Send a note to root
:0
# -X Extract header
# -k Keep body as well
| ( formail -X -k -I "To: root(_at_)accn\(_dot_)org" "From: procmail" \
"Subject: Abuse Incident" ; \
date; \
echo "Abuse note from: $FROM"; \ # HOw do I get the FROM??
echo "Abuse note to : $TO" ); \ # How do I get the TO??
echo "" \
| $SENDMAIL $SENDMAILFLAGS -t
# Senda a response back to the culprit cc:'ing root
:0
| ( formail -rt -i "Subject: Unauthorized access" -I"Cc: root"; \
cat /home/ryanm/.procmail/abuse.note ) \
| $SENDMAIL $SENDMAILFLAGS -t
}