How to send emails through an External SMTP Service?

Posted June 11, 2020 2.8k views

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 (my domain)

~host has address <IP> mail is handled by 10

I made a file with my login and password - /etc/mail/authinfo/yandex-auth : "U:<My login>" "I:<email>" "P:<password>" "M:<login>" "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,, 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,, temporary failure, connection abort
Jun 11 19:00:45 kids-app-api-droplet sm-mta[7381]: 05BInLgB007204: to=<>, ctladdr=<> (0/0), delay=00:11:24, xdelay=00:00:00, mailer=relay, pri=300379, [<IP>], dsn=4.0.0, stat=Deferred: Temporary AUTH failure

I checked this and this 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?

1 comment

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.

Submit an Answer
1 answer

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!


  • Hi,

    It helped, thank you!

  • It still does not work, but at least I have got a new error :-D

    • Hello, @lecharton

      Can you please share the error message you’re currently receiving when you’re trying to deliver the message so we can check it?


      • Hi,

        I had a problem with authorisation. It failed even if I was sure the login and password combination is right.

        In the end I find out a tricky thing. There is an application password which you can user to let some application to login to your mail from the yandex mail provider. But if you create a mail for your domain on yandex it cannot login through smtp with a password nor with an application password. It does not know which combination is ok and just return an error.
        So I removed an application password and everything works fine now. I hope this small trick also would useful for somebody.

        Thank you fro your help!

        • Hello, @lecharton

          I’m glad you’ve sorted this. Also thanks for sharing what the issue was and how you’ve managed to sort it! I believe other users can find this useful if they run in the same problem.