Operating System - HP-UX
1833787 Members
2459 Online
110063 Solutions
New Discussion

Re: Sendmail and Bounced mail:

 
ENG TAN
New Member

Sendmail and Bounced mail:

Is there a way to generate a customized form reply for all bounced mail?

For instance when a user sends email to a non valid user (typo or otherwise), I (root) gets a copy of the bounced mail.

I would like to created a customized message (containing proper contact information)for all such mail that are undeliverable.

How can I accomplish this?
The O'reilly sendmail book did not provide any help on this.

Thanks
4 REPLIES 4
Paul R. Dittrich
Esteemed Contributor

Re: Sendmail and Bounced mail:

Several tools (I would use PERL) can extract information from the mail header.

But if I understand your question, you want to supply the CORRECTED mail address in the custom reply and that is not so easy. Depending on the "size" of the typo, finding a match may be impossible or worse, ambiguous.
ENG TAN
New Member

Re: Sendmail and Bounced mail:

Paul,

All I wanted to do is to send an auto reply (containing some generic message which I will create)to senders for ALL bounced mail (copies get sent to mailer-daemon which gets forwarded to root.
I do not want to parse any of the headers or second guess the intended recepients.

Is there any way to send back a generic message for all bounced messages coming from mailer-daemon?

Thanks
Bill Thorsteinson
Honored Contributor

Re: Sendmail and Bounced mail:

procmail should be the tool to do this.

It can select the messages based on a regular
expression on the heads and/or body of the message.
You then can forward, redirect, or process the
file in any way you wish including generating a reply.

procmail man pages include procmail, procmailrc, and
procmailex (examples).
Vincent Fleming
Honored Contributor

Re: Sendmail and Bounced mail:

Hi;

My sendmail.cf file has this entry:


# error message header/file
#O ErrorHeader=/etc/mail/error-header

This looks like what you're looking for... fill the error-header file with your text.

I'm using sendmail 8.11.1, which may be newer than your version. This is an "option" to sendmail. You can go to www.sendmail.org to get an updated version, if need be.

An easy way to check your sendmail revision is to "telnet myserver 25", and it will spit out a like like this:

220 gateway.penmax.com ESMTP Sendmail 8.11.1/8.11.1; Fri, 6 Jul 2001 10:57:12 -0
400 (EDT)

(type quit to get out)

Good luck.

No matter where you go, there you are.