As I described earlier, I’ve been using sSMTP for email support in Docker containers. Unfortunately, sSMTP is not maintained anymore. Instead msmtp should be used. I put the migration off for as long as possible, but eventually implemented the change!

For legacy reasons I will leave my orginal articles about sSMTP untouched (I’ll just add a link to this page), and instead post this migration how-to.

## Given

Let’s assume we’ve been using the following sSMTP config in /etc/ssmtp/ssmtp.conf:

In addition, we somewhere needed to tell the system/software/module how to send mails. For example, for PHP it would be somthing like that in /usr/local/etc/php/conf.d/mail.ini:

## Then

In that case you would need a msmtp configuration in /etc/msmtprc:

In addition, you need to tell the system/software/module send mails via /usr/bin/msmtp -t. For example, for PHP it would be somthing like that in /usr/local/etc/php/conf.d/mail.ini:

Please note that msmtp is in /usr/bin not /usr/sbin !! ;-)

## Supplemental Material

• The paths mentioned above are target paths. Thus, if you’re using Docker it actually doesn’t matter where you store the files, but you need to mount them to those paths inside the container..
• There are much more options for msmtp! You can also configure an actual mail account at Posteo or Google or wherever. I recommend checking its documentation and Arch’s Wiki.