title: Mandrill smtp failures
body: <p>I'm having enormous difficulty getting mandrill SMTP to send reliably. Or more accurately, authenticate every time. When it does authenticate the email works fine</p>
  
  <p>I can run the send script fine, then 2 or 3 times in succession one after the other. Then it doesn't authenticate.  But on occasions it doesn't authenticate straight away.</p>
  
  <p>I thought perhaps it's just because it thinks I'm abusing it and blocked me for a short period. </p>
  
  <p>But I can see that since I started using mandrill SMTP for my website, its failure rate to authenticate is regular. </p>
  
  <p>Tried SPF and dmik text attributed on the domain. This didn't help</p>
  
  <p>Looking around I can't see other people having this issue, but at this rate I certainly can't use mandrill for SMTP.</p>
  
  <p>Can anyone suggest reasons why this could be happening? My credentials are 100% accurate, and I don't think I'm sending many emails at all.</p>
  
  <p>Having the same problem on another server using another mandrill account.</p>
  
  <p>Note: I'm using phpmailer</p>
  
  <p>Example debug error:</p>
  
  <pre><code>2014-12-06 08:52:59 Connection: opening to smtp.mandrillapp.com:587, t=300, opt=array (
  )
  2014-12-06 08:52:59 Connection: opened
  2014-12-06 08:52:59 SERVER -&gt; CLIENT: 220 smtp.mandrillapp.com ESMTP
  2014-12-06 08:52:59 CLIENT -&gt; SERVER: EHLO fakemail.com
  2014-12-06 08:52:59 SERVER -&gt; CLIENT: 250-ip-10-243-6-11
  250-PIPELINING
  250-SIZE 26214400
  250-STARTTLS
  250-AUTH PLAIN LOGIN
  250-ENHANCEDSTATUSCODES
  250 8BITMIME
  2014-12-06 08:52:59 CLIENT -&gt; SERVER: AUTH LOGIN
  2014-12-06 08:52:59 SERVER -&gt; CLIENT: 334 VXNlcm5hbWU6
  2014-12-06 08:52:59 CLIENT -&gt; SERVER: bWVAZG91Z25vcmZvbGsuY29tLmF1
  2014-12-06 08:52:59 SERVER -&gt; CLIENT: 334 UGFzc3dvcmQ6
  2014-12-06 08:52:59 CLIENT -&gt; SERVER: REDACTED
  2014-12-06 08:53:01 SERVER -&gt; CLIENT: 435 4.7.8 Error: authentication failed: UGFzc3dvcmQ6
  2014-12-06 08:53:01 SMTP ERROR: Password command failed: 435 4.7.8 Error: authentication failed: UGFzc3dvcmQ6
  2014-12-06 08:53:01 CLIENT -&gt; SERVER: QUIT
  2014-12-06 08:53:01 SERVER -&gt; CLIENT: 221 2.0.0 Bye
  2014-12-06 08:53:01 Connection: closed
  2014-12-06 08:53:01 SMTP connect() failed.
  Mailer Error: SMTP connect() failed.
  </code></pre>
  
  <p>Example correct send:</p>
  
  <pre><code>2014-12-06 08:52:33 Connection: opening to smtp.mandrillapp.com:587, t=300, opt=array (
  )
  2014-12-06 08:52:33 Connection: opened
  2014-12-06 08:52:33 SERVER -&gt; CLIENT: 220 smtp.mandrillapp.com ESMTP
  2014-12-06 08:52:33 CLIENT -&gt; SERVER: EHLO fakemail.com
  2014-12-06 08:52:33 SERVER -&gt; CLIENT: 250-ip-10-250-28-124
  250-PIPELINING
  250-SIZE 26214400
  250-STARTTLS
  250-AUTH PLAIN LOGIN
  250-ENHANCEDSTATUSCODES
  250 8BITMIME
  2014-12-06 08:52:33 CLIENT -&gt; SERVER: AUTH LOGIN
  2014-12-06 08:52:33 SERVER -&gt; CLIENT: 334 VXNlcm5hbWU6
  2014-12-06 08:52:33 CLIENT -&gt; SERVER: bWVAZG91Z25vcmZvbGsuY29tLmF1
  2014-12-06 08:52:33 SERVER -&gt; CLIENT: 334 UGFzc3dvcmQ6
  2014-12-06 08:52:33 CLIENT -&gt; SERVER: REDACTED
  2014-12-06 08:52:33 SERVER -&gt; CLIENT: 235 2.7.0 Authentication successful
  2014-12-06 08:52:33 CLIENT -&gt; SERVER: MAIL FROM:&lt;me@fakemail.com&gt;
  2014-12-06 08:52:33 SERVER -&gt; CLIENT: 250 2.1.0 Ok
  2014-12-06 08:52:33 CLIENT -&gt; SERVER: RCPT TO:&lt;me@fakemail.com&gt;
  2014-12-06 08:52:33 SERVER -&gt; CLIENT: 250 2.1.5 Ok
  2014-12-06 08:52:33 CLIENT -&gt; SERVER: DATA
  2014-12-06 08:52:33 SERVER -&gt; CLIENT: 354 End data with &lt;CR&gt;&lt;LF&gt;.&lt;CR&gt;&lt;LF&gt;
  2014-12-06 08:52:33 CLIENT -&gt; SERVER: Date: Sat, 6 Dec 2014 19:52:33 +1100
  2014-12-06 08:52:33 CLIENT -&gt; SERVER: To: Test &lt;me@fakemail.com&gt;
  2014-12-06 08:52:33 CLIENT -&gt; SERVER: From: Test &lt;me@fakemail.com&gt;
  2014-12-06 08:52:33 CLIENT -&gt; SERVER: Subject: Here is the subject
  2014-12-06 08:52:33 CLIENT -&gt; SERVER: Message-ID: &lt;0a8f3c40575be98668d8ea6fb03f4bfc@fakemail.com&gt;
  2014-12-06 08:52:33 CLIENT -&gt; SERVER: X-Priority: 3
  2014-12-06 08:52:33 CLIENT -&gt; SERVER: X-Mailer: PHPMailer 5.2.9 (https://github.com/PHPMailer/PHPMailer/)
  2014-12-06 08:52:33 CLIENT -&gt; SERVER: MIME-Version: 1.0
  2014-12-06 08:52:33 CLIENT -&gt; SERVER: Content-Type: multipart/alternative;
  2014-12-06 08:52:33 CLIENT -&gt; SERVER:   boundary="b1_0a8f3c40575be98668d8ea6fb03f4bfc"
  2014-12-06 08:52:33 CLIENT -&gt; SERVER: Content-Transfer-Encoding: 8bit
  2014-12-06 08:52:33 CLIENT -&gt; SERVER:
  2014-12-06 08:52:33 CLIENT -&gt; SERVER: --b1_0a8f3c40575be98668d8ea6fb03f4bfc
  2014-12-06 08:52:33 CLIENT -&gt; SERVER: Content-Type: text/plain; charset=us-ascii
  2014-12-06 08:52:33 CLIENT -&gt; SERVER:
  2014-12-06 08:52:33 CLIENT -&gt; SERVER: This is the body in plain text for non-HTML mail clients
  2014-12-06 08:52:33 CLIENT -&gt; SERVER:
  2014-12-06 08:52:33 CLIENT -&gt; SERVER:
  2014-12-06 08:52:33 CLIENT -&gt; SERVER: --b1_0a8f3c40575be98668d8ea6fb03f4bfc
  2014-12-06 08:52:33 CLIENT -&gt; SERVER: Content-Type: text/html; charset=us-ascii
  2014-12-06 08:52:33 CLIENT -&gt; SERVER:
  2014-12-06 08:52:33 CLIENT -&gt; SERVER: This is the HTML message body &lt;strong&gt;in bold!&lt;/strong&gt;
  2014-12-06 08:52:33 CLIENT -&gt; SERVER:
  2014-12-06 08:52:33 CLIENT -&gt; SERVER:
  2014-12-06 08:52:33 CLIENT -&gt; SERVER:
  2014-12-06 08:52:33 CLIENT -&gt; SERVER: --b1_0a8f3c40575be98668d8ea6fb03f4bfc--
  2014-12-06 08:52:33 CLIENT -&gt; SERVER:
  2014-12-06 08:52:33 CLIENT -&gt; SERVER: .
  2014-12-06 08:52:33 SERVER -&gt; CLIENT: 250 2.0.0 Ok: queued as 109BC180070
  2014-12-06 08:52:33 CLIENT -&gt; SERVER: QUIT
  2014-12-06 08:52:33 SERVER -&gt; CLIENT: 221 2.0.0 Bye
  2014-12-06 08:52:33 Connection: closed
  Message sent!
  </code></pre>
  
  <p>I tried firing the email every 5 seconds. 3 out of 10 times it didn't send.</p>
  
  <p>1 minute later, i tried every 10 seconds. 8 out of 10 didn't send.</p>