Making mail bounce with specific reply


#1

The subject isn’t very clear…

What I want to do is make mail sent to one of my aliases bounce back to the sender, with the bounced version containing a fixed message (like “I’m sorry this e-mail address is currently unavailable”, though with more specific information than that)

Can this be done? If so… how?

Thanks in advance for any/all help, suggestions, divine inspirations :wink:

-Eric


#2

There’s no easy way to do this.

When an address is set to bounce, in most cases, our MTA simply sends a 550 error to the sender’s MTA during the SMTP transaction; thus, it’s the sender’s MTA which actually generates the bounce message, and the content (other than the error message) isn’t determined by us.

aura% telnet mx1.swarthy.mail.dreamhost.com smtp
Trying 66.33.196.49…
Connected to mx1.swarthy.mail.dreamhost.com.
Escape character is ‘^]’.
220 ludo.dreamhost.com ESMTP
EHLO aura
250-ludo.dreamhost.com
250-PIPELINING
250-SIZE 40960000
250-VRFY
250-ETRN
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
250-XVERP
250 8BITMIME
MAIL FROM:luser@example.com
250 Ok
RCPT TO:asdfasdfasdfadsf@soulrebels.com
550 asdfasdfasdfadsf@soulrebels.com: User unknown

It would theoretically be possible to put some text after the 550 error (instead of the usual ‘User Unknown’, but we don’t have any way to do this, nor are there plans to add this as a feature.

In some cases, a fake “bounce” message is generated (by a simple perl script), but it’s not configurable.

You could possibly do what you are trying to do with an autoresponder, and almost definitely using procmail and / or Perl. Just be careful in either case, as you don’t want to accidentally create an infinite loop of any sort.

Anyway, there’s no officially supported way of doing this, and there isn’t likely to be in the future.


#3

(Hmmm… I thought I replied to this last night… must have done something wrong)

I found a relatively simple solution that seems to work.

First, I set an autoresponder for the address I want to effectively “bounce”, and that contains the message I want to send out.

Then I forward the address to a different address (which I called “nobody”), and set mail to “nobody” to be deleted (without reply) on receipt.

So the autoresponder responds to the incoming e-mail, the e-mail is forwarded to “nobody” where it gets send to the bit-bucket.

Voila! :slight_smile:

Thanks for your reply!

-Eric