Can sendmail be configured to discard routed email that has been rejected by the next hop?

Posted by Guy Bolton King on Server Fault See other posts from Server Fault or by Guy Bolton King
Published on 2010-04-21T10:30:33Z Indexed on 2010/04/21 10:33 UTC
Read the original article Hit count: 210

Filed under:
|

Background:

  1. We have a handful of hosts (running sendmail) acting as the MXs for a few domains each.
  2. Each domain is handled via the sendmail/cf /etc/mail/virtusertable, with a set of known recipients and a catch-all reject rule.
  3. Mail to postmaster on each host is aliased to root, and root is aliased to root+<host>@ourdomain.com.
  4. The MX for ourdomain.com is Google Apps, and [email protected] is a simple group that forwards to the admins.
  5. Google Apps will reject some emails at the SMTP stage, usually because of illegal attachments (instead of accepting them and filing them as spam).

Problem:

Given a particular spam email sent to a domain in a virtusertable entry:

  1. If the recipient address rejects the mail, then sendmail will try and send a DSN to the sender.
  2. If that sender also rejects the mail (because it's a falsified sender, and the MX for the sender rejects the mail as spam), then sendmail sends a DSN to the postmaster.
  3. The routing detailed above takes place, and...Google Apps rejects the mail as well.
  4. sendmail now gives up with a "savemail panic", and leaves the mail in the queue forever.
  5. Our mail queue fills up with garbage

Is there any way I can get sendmail to discard messages that have been rejected by the next virtusertable hop (i.e. after step 1 in the Problem description)? Or does anyone have any other solutions to this?

© Server Fault or respective owner

Related posts about sendmail

Related posts about virtusertable