Migrating from sSMTP to msmtp
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.
- migration (1) ,
- ssmtp (5) ,
- msmtp (1) ,
- smtp (1) ,
- mail (11) ,
- php (8) ,
- config (21) ,
- docker (17) ,
- network (81)
Leave a comment
There are multiple options to leave a comment:
- send me an email
- submit a comment through the feedback page (anonymously via TOR)
- Fork this repo at GitHub, add your comment to the _data/comments directory and send me a pull request
- Fill the following form and Staticman will automagically create a pull request for you:
1 comment
For a completely minimal MTA, I’d recommend the dragonfly mail agent - dma. It has modern features such as being able to authenticate with client certificates. It comes from dragonflybsd, is included in base on freebsd but is also ported to Linux.