procmail
[Top] [All Lists]

Bouncing bounces.

1997-06-25 11:31:00
I'm TRYING to get a handle on returning mail to right place in the face
of forged mails.

I can create an autoresponse and if the original mail has valid headers,
the recipient gets the automatic mail with instructions and such. If
it's from an invalid host, though, the local sendmail returns it to me
and sends a copy of the reject to the local postmaster as well.

Which annoys the postmaster.

Invalid accounts on real machines don't have this problem, and I deal
nicely with bounces all on my own.

The best I've been able to do is below, but I'd like to make my bounces
look like bounces to the remote sendmail so it doesn't bounce them back
to me.

Good lord, first spam fighting and now bounce fighting.

[immediately prior to this I create a return header complete with
password instructions and such so the mail is ready to go out]


# See who we are trying to return this mail to. Get the hostname
# and see if it's resolvable.
 
TOHOST=`formail -x to: | sed -e's/^.*@//'`
 
LOGFILE=$LogFileReal
 
:0 W
* ? test '`host $TOHOST`' = 'Host not found.'
{
  # if host is not found bounce with exitcode 77
  # (access denied)
 
  EXITCODE=77
 
  LOG="rc.return: mail bounced, $TOHOST not found
"
  LOGFILE=$LogFileNull
  
  :0
  /dev/null
}
 
LOG="rc.return: mail returned to $TOHOST
"
 
# Otherwise feel free to mail out the auto reply.
 
LOGFILE=$LogFileNull
  
:0
| $SENDMAIL -oi -t

-- 
Dennis Schmitz                   email: den(_at_)lucent(_dot_)com
Lucent Technologies              Phone: (708) 979-7841
IH 6H-338                          Fax: (708) 979-3439
2000 North Naperville Road
Naperville, IL 60566-7033

<Prev in Thread] Current Thread [Next in Thread>
  • Bouncing bounces., Dennis A. Schmitz <=