procmail
[Top] [All Lists]

Re: .forward caveat

1998-06-01 04:40:46
On Mon, Jun 01, 1998 at 09:33:41AM +0200, 
belhagin(_at_)bya1c87(_dot_)pl(_dot_)lucent(_dot_)com wrote:
Hi!

      This has probably been done to death on the list, but I'll risk 
bringing it 
up again, because it's not in any of the man pages. 
      I have a simple recipe that bounces mail back to a particularly 
annoying guy 
which looks like this:
      
      :0
      * ^From:(_dot_)*bum(_at_)some(_dot_)place
      {
              EXITCODE=67 HOST
      }
      
      The idea is that he gets information which states that I don't exist 
(I'm 
getting existential...sorry :). The problem is that he also gets my .forward 
file in 
the bounced e-mail so he knows that I do indeed exist. Is there anything I 
can do 
about this? I could probably just /dev/null his posts, but I want him to stop 
mailing me altogether and that's not the way.

Try the following for the action portion of your recipe. You will probably
need to do a bit of editing, or at least setting of variables in your
.procmailrc to get this to work right. I snipped this from a much larger
procmail spam-filter recipe. Obviously this recipe is dependant on temporarily
saving the contents of the offending message, then appending them to the end
of the bounce message, so you'll have to figure out how to do that as well.
I'm farily certain the author of the filter I snipped this from reads this
list to, so she may speak up if she sees anything else that needs to be
adjusted for your case.


 | (${FORMAIL} -rt \
    -I"From: MAILER-DAEMON(_at_)$HOST (Mail Delivery Subsystem)" \
    -I"Subject: Returned mail: User unknown" \
    -I"Auto-Submitted: auto-generated (failure)" \
    -A"Bcc: ${SPAMERROR}" \
    -A"X-Loop: MAILER-DAEMON(_at_)$HOST";\
     echo "The original message was received at $SPAMDATE";\
     echo "from $SPAMFROM";\
     echo " ";\
     echo "----- The following addresses had permanent fatal errors -----";\
     echo "$LOGNAME(_at_)$HOST";\
     echo " ";\
     echo "----- Transcript of session follows -----";\
     echo "... while talking to $HOST.:";\
     echo ">>> RCPT To:<$LOGNAME(_at_)$HOST>";\
     echo "<<< 550 Bad recipient";\
     echo "550 $LOGNAME(_at_)$HOST(_dot_)(_dot_)(_dot_) User unknown";\
     echo "Reporting-MTA: dns; $HOST";\
     echo " ";\
     echo "Arrival-Date: $SPAMDATE";\
     echo "Final-Recipient: RFC822; $LOGNAME(_at_)$HOST";\
     echo "Action: failed";\
     echo "Status: 5.1.1";\
     echo "Diagnostic-Code: SMTP; 550 Bad recipient";\
     echo "Last-Attempt-Date: $SPAMDATE";\
     cat spamtemp;\
     ${RM} -f spamtemp) \
     | ${SENDMAIL} -oi -t
}


-- 
Andrew Edelstein

Sarah - Doctor, you're being a child.
The Doctor - Why shouldn't I? There's no point in being an adult if you can't
act childish now and then.              Dr. Who

<Prev in Thread] Current Thread [Next in Thread>