Queuing mail with sendmail if next hop is unreachable

emailemail-serversendmail

I have one sendmail host exposed to the outside world accepting mail for a variety of domains, which relays mail it receives for those domains to the domain's corresponding internal server (by way of mailertable). Most internal servers have excellent uptimes but occasionally there is a hiccup and a server may be unreachable. In such a scenario, sendmail attempts to forward the mail to a downed server but is unable to do so, and logs a 5.0.0 Service Unavailable error (and issues a 5.0.0 DSN back to the sender).

Obviously, this is not good for a production environment as inbound emails will be forever lost in the above scenario. How can I instruct sendmail to queue the messages and keep retrying, and if it cannot deliver them after a week, remove them from the queue and issue the failure DSN?

Best Answer

Tweaking sendmail configuration options

Sendmail cf/README

Check out options such as confTO_QUEUERETURN and confTO_QUEUEWARN

You should think carefully before you change this parameter to queue mail for many days on your SMTP gateway. The reason the mails are returned after several hours of non-delivery is to let the sender know that the mail could not be sent. Technically the emails are not lost, as the sender is notified of the failure.