I struggled a LOT — way too much — fixing an issue with my SSMTP install so I decided to share the solution here.
I got multiple instances of php inside docker containers. Every instance should be able to send emails, but instead of installing a mail server in each docker, I've set them to use SSMTP to relay emails. SSMTP will relay emails to an exim docker (namshi/smtp) which will send emails.
(n * [PHP -> SSMTP]) -> EXIM
I had to set
/etc/ssmtp/ssmtp.conf according to their docs, but it worked only when I was sending emails through root, but not with PHP which is working through
I renamed the linked dockers so php instances and ssmtp call them by "mailhub".