Which image/solution for sending emails?

I have Traefik as a reverse proxy. Behind Traefik are sitting containers with nginx+php+mysql (domain1-com, domian2-com, domain3-com).

I want to send emails (from PHP scripts) from addresses such as peter@domain1-com, betty@domain2-com. If somebody responds to any of my emails I want to just redirect incoming email to something@gmail-com.

Which image should I use or how to solve it? (easiest way) I’ll be using SSL, DKIM, SPF … .

Do you want to run a local E-mail server? Because this is something that an e-mail server should do. I tan my email server locally years ago and I also configured SPF and DKIM. Later I realized I didn’t need the local server. I could use Secure Business Email Hosting for your Organization | Zoho Mail for free and create rules to forward emails to anywhere. I could change my domain’s MX record on the DNS server (you can also ask your domain provider) so it pointed to zoho. This way you could even have multiple aliases to one email account if you don’t want to forward emails to gmail.

You do the same with GMail but when I last checked that, it was not free.

Your scripts should use SMTP to send emails so you don’t really need to install anything inside the container, at least I don’t remember anything. You can find SMTP mailer frameworks for any programming language.

I think I will go with namshi/smtp so I can send emails. And zixia/simple-mail-forwarder to forward emails. Will see if it’s the right thing.

For more inspiration: we used iRedMail and currently mailu (less moving parts) to set up mail servers, running in container on dedicated small VMs with fixed IP.

1 Like