marlam / msmtp

SMTP client with sendmail compatible interface
https://marlam.de/msmtp
GNU General Public License v3.0
176 stars 36 forks source link

Account fallback #139

Closed azmeuk closed 1 year ago

azmeuk commented 1 year ago

If one rely on email alerts for system administration, for example to get cron outputs, one single default account might not be enough. If the email server is down when the alert must be sent, the mail is not received in time.

I suggest making msmtp support several default accounts (e.g. account default : account1 account2 account3) so if the first account email server is unavailable, then msmtp can try to send mail with the second one etc.

What do you think?

marlam commented 1 year ago

To get the robustness of typical mail transport agents, it is best to directly use such an MTA, e.g. postfix.

If you really want to use msmtp with fallback accounts instead, you can use a wrapper script that calls msmtp in a loop over all the accounts you want to use, until the delivery succeeds.