0

I would like to use sendmail in a docker container to send email. I was able to do this before for my own site when I used a certain script to set everything up.

When I try this now sendmail tells me Deferred: Temporary AUTH failure but the next line says Message accepted for delivery. However, the message is not sent as I use Mailgun for SMTP credentials and their logs never report the email that sendmail tries to send. I have confirmed my Mailgun credentials are still valid because I can use their REST API to send mail.

I noticed when I change the port from 587 to 465 or 25 in the sendmail.mc, it is not able to connect to smtp.mailgun.org at all. It is only when I use port 587 that I get as far as the Temporary AUTH failure. How can I resolve this authorization failure? I'm 100% sure that the correct credentials are in my /etc/mail/authinfo/auth file. I tried ending that file with "M:LOGIN", "M:PLAIN", and "M:PLAIN LOGIN", and "M:EXTERNAL" but to no avail.

How on earth do I configure sendmail to send mail with my Mailgun SMTP credentials over port 587 without this "Deferred: Temporary AUTH failure" error?

Spencer Williams
  • 821
  • 10
  • 20
  • I'm even more certain my SMTP credentials are fine because I can use the [Swift Mailer](https://github.com/swiftmailer/swiftmailer) API to send mail without issue. Is anyone else able to get sendmail to send mail from the [php:apache](https://store.docker.com/images/php) docker container? – Spencer Williams Mar 05 '18 at 16:54
  • Oh come on... No one has ever setup sendmail in the [php:apache](https://store.docker.com/images/php) docker container? I'm going to be the first person to figure it out? – Spencer Williams Mar 05 '18 at 19:13
  • No, you're just posting on the wrong site. Yours is not a programming question; voting to close as off-topic for Stack Overflow. Maybe try [su] or [unix.se] but read their posting guidelines (too) before asking there. – tripleee Mar 06 '18 at 04:26

1 Answers1

0

Well... I don't think I will ever use pure sendmail ever again. I ended up using ssmtp as suggested here.

Spencer Williams
  • 821
  • 10
  • 20