I'm trying to setup ssmtp (for sendmail) in Docker image.
To do so I've created the folowing Dockerfile:
FROM php:7.4-apache # Install paquet requirements RUN set -ex; \ # Install required system packages apt-get update; \ apt-get install -qy --no-install-recommends \ ssmtp \ mailutils \ ; \ # Clean aptitude cache and tmp directory apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*;
As you can see I have installed ssmtp and mailutils.
My /etc/ssmtp.conf file contains all credentials that I can log into my account using standard mail client:
[email protected] mailhub=mail.mydomain.com:587 [email protected] AuthPass=PASS_HERE FromLineOverride=YES UseTLS=YES #UseSTARTTLS=YES Debug=YES hostname=OVERRIDEN_HOSTNAME
From some reason mail is not sent. I'm tying with
sendmail [email protected] Subject: aaa aaa CTRL+d
and getting error:
sendmail: Authorization failed (535 Incorrect authentication data)
Debug=YES is set, I do not see any log under
/var/log regarding sendmail.
However, when I am trying to use ssmtp command in verbose mode, the folowing logs are produced:
root@c7e406d765c1:/app# ssmtp -d9 [email protected] [<-] 220 ****.com ESMTP Exim Fri, 15 Apr 2022 12:25:49 +0200 [->] EHLO ****.com [<-] 250 HELP [->] AUTH LOGIN [<-] 334 VXNl[*** tuncated here ***] [->] c2Vyd2VyDQ== [<-] 334 UGFz[*** tuncated here ***] [<-] 535 Incorrect authentication data ssmtp: Authorization failed (535 Incorrect authentication data)
This is quite strange because same credentials (from config) works for instance in PHPMailer configuration.
Do you have any thought what might be wrong?
Thank you all!