Sendmail in DOCKERized PHP-Application doesn't work
1084 Репутация автора
When trying to send an email with PHP
function sendmailoversmtp($name, $mail, $message, $topic)
It does not work. The following error is logged:
sh: 1: -t: not found
-t -i is configured as
sendmail_path in my php.ini. Why is it not found?
My Dockerfile is based on
35495 Репутация автора
sendmail won't work in a container without some extended setup. The
sendmail binary normally drops a file into a mailqueue directory for a mail server process to pick up and then send. This would require mounting some mail servers queue directories into a container or trying to run a sendmail process along with your container services. Both are not very "Dockery".
sSMTP is a simple MTA to deliver mail from a computer to a mail hub (SMTP server)
ssmtp in the container and configure
/etc/ssmtp/ssmtp.conf to send email via a real smtp server.
You could run a mail server in another container, use an existing service, or use an external mail host. There would generally be a mail server running on the Docker host itself, but it may not always be addressable from the container or accessible in the same way across different hosts.
Then configure PHP to use
Автор: Matt Размещён: 22.08.2016 10:37
sendmail_path = /usr/sbin/ssmtp -t