Exim4 – disable autoreplies about “SMTP error from remote mail server after RCPT”

auto-replyemaileximsmtp

I have a setup of exim4 on domain1 in front of other server, domain2 (with sendmail). Second server have no direct access to internet, so domain1 is MX for domain2. And domain2 is set as hubbed_host in the exim4 on domain1.

When spammer sends message for no_such_user@domain2, its sendmail do a reject:

550 5.1.1 <no_such_user@domain2>... User unknown

Then, exim4 at domain1 do an auto-reply like this:

This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

  no_such_user@domain2
    SMTP error from remote mail server after RCPT TO:<no_such_user@domain2>:
    host 10.0.0.1 [10.0.0.1]: 550 5.1.1 <no_such_user@domain2>... User
unknown

The spammers uses fake "from" field, and such generated messages are frozen by exim for a long time.

How can I disable some or all autoreplies from exim4? Ideally, I want a filter,
if message was not delivered with error "User unknown" than don't generate any autoreply from mailer-daemon.

Thanks!

Best Answer

I think this blog post is what you're looking for.

Problem: When a mail server accepts a message and later decides that it can’t deliver the message, it is required to send back a bounce email to the sender of the original message. These bounce emails are often misdirected.

For many MTAs there are solutions, so here is my solution for exim:

Solution: This solution uses filtering to discard bounced back emails. So your exim should have a central filter. Such filter can be configured in exim.conf configuration file […]