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:
root=serwer@mydomain.com
mailhub=mail.mydomain.com:587
AuthUser=serwer@mydomain.com
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
command:
sendmail my_email@example.com
Subject: aaa
aaa
CTRL+d
and getting error:
sendmail: Authorization failed (535 Incorrect authentication data)
Even 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 my_email@example.com
[] EHLO ****.com
[] AUTH LOGIN
[] 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!
Asked by Athlan
(141 rep)
Apr 19, 2022, 05:27 AM
Last activity: Apr 20, 2022, 05:46 PM
Last activity: Apr 20, 2022, 05:46 PM