How do I get sendmail running in an Alpine Docker container?

I just want to send a simple email for testing, but when I execute sendmail inside the container, I get sendmail: can't connect to remote host (127.0.0.1): Connection refused

. What do I need to consider when using sendmail inside an Alpine container?

+3


source to share


1 answer


The container will not have a running MTA (mail transport agent), there is simply no mail server. For example, you can use ssmtp ( https://pkgs.alpinelinux.org/package/edge/main/x86/ssmtp ) and configure it to use external smtp server like your vendors (like mail.yourprovider.com ).



Than you can use ssmtp to send emails. Here is a similar case where sending mail from a Php Docker image is not possible. You can read further here -> https://github.com/docker-library/php/issues/135

+1


source







All Articles