Question

How to send emails through an External SMTP Service?

I would like to send emails through an External SMTP Service (Yandex) with Sendmail on Ubuntu 18.04.3.

I set everything up: External SMTP Service, Sendmail, hostname. I added the MX record to my DNS.

~hostname
childrengo.org (my domain)

~host childrengo.org
childrengo.org has address <IP>
childrengo.org mail is handled by 10 mx.yandex.net.

I made a file with my login and password - /etc/mail/authinfo/yandex-auth :

AuthInfo:smtp.yandex.ru "U:<My login>" "I:<email>" "P:<password>" "M:<login>"
AuthInfo:smtp.yandex.ru:587 "U:<My login>" "I:<email>" "P:<password>" "M:<login>"

And than:

makemap hash /etc/mail/authinfo/yandex-auth < /etc/mail/authinfo/yandex-auth

I set up Sendmail to send emails through an External SMTP Service (Yandex).

But I have got an error in my syslog:

Jun 11 19:00:45 kids-app-api-droplet sm-mta[7381]: STARTTLS=client, relay=smtp.yandex.ru., version=TLSv1.3, verify=FAIL, cipher=TLS_AES_256_GCM_SHA384, bits=256/256
Jun 11 19:00:45 kids-app-api-droplet sm-mta[7381]: 05BInLgB007204: AUTH=client, available mechanisms do not fulfill requirements
Jun 11 19:00:45 kids-app-api-droplet sm-mta[7381]: AUTH=client, relay=smtp.yandex.ru., temporary failure, connection abort
Jun 11 19:00:45 kids-app-api-droplet sm-mta[7381]: 05BInLgB007204: to=<lecharton@yandex.ru>, ctladdr=<root@childrengo.org> (0/0), delay=00:11:24, xdelay=00:00:00, mailer=relay, pri=300379, relay=smtp.yandex.ru. [<IP>], dsn=4.0.0, stat=Deferred: Temporary AUTH failure

I checked this https://www.digitalocean.com/community/tutorials/how-to-send-email-through-an-external-smtp-service-with-sendmail-on-freebsd-10-1 and this https://www.digitalocean.com/community/questions/ubuntu-14-04-lamp-installed-sendmail-fatal-error-when-i-sent-first-message It did not help.

  • I installed cyrus-sasl*
  • I have the TXT records for DMARC1, spf1 and DKIM for my domain.
  • I have tried different users to send email. And I checked the password. I also checked the user exists.

I also don’t see these errors in my mail.log and in mail.err

Do you have any idea how to fix it? Or may be how to debug it?

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hello, @lecharton

Could you please confirm if you have installed he SASL package as mentioned in the first tutorial? Usually this error message can occur when the cyrus-sasl is missing. You can try to install it manually and then restart sendmail:

sudo apt-get install sasl2-bin

service saslauthd restart

service sendmail restart

and then try again to send the email using sendmail.

Hope this helps!

Regards, Alex