title: Deferred: Temporary AUTH failure with SMTP Relay over port 587
body: <p>I would like to use <code>sendmail</code> in a docker container to send email. I was able to do this before for my own site when I used <a href="https://gitlab.com/aninternetpresence/docker-demos/blob/master/laravel/setup-mail.sh" rel="nofollow noreferrer">a certain script</a> to set everything up.</p>
  
  <p>When I try this now <code>sendmail</code> tells me <code>Deferred: Temporary AUTH failure</code> but the next line says <code>Message accepted for delivery</code>. However, the message is not sent as I use Mailgun for SMTP credentials and their logs never report the email that <code>sendmail</code> tries to send. I have confirmed my Mailgun credentials are still valid because I can use their REST API to send mail. </p>
  
  <p>I noticed when I change the port from <code>587</code> to <code>465</code> or <code>25</code> in the <code>sendmail.mc</code>, it is not able to connect to <code>smtp.mailgun.org</code> at all. It is only when I use port <code>587</code> that I get as far as the <code>Temporary AUTH failure</code>. How can I resolve this authorization failure? I'm 100% sure that the correct credentials are in my <code>/etc/mail/authinfo/auth</code> file. I tried ending that file with <code>"M:LOGIN"</code>, <code>"M:PLAIN"</code>, and <code>"M:PLAIN LOGIN"</code>, and <code>"M:EXTERNAL"</code> but to no avail. </p>
  
  <p>How on earth do I configure <code>sendmail</code> to send mail with my Mailgun SMTP credentials over port 587 without this "Deferred: Temporary AUTH failure" error?</p>