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?