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
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.
I thought perhaps it's just because it thinks I'm abusing it and blocked me for a short period.
But I can see that since I started using mandrill SMTP for my website, its failure rate to authenticate is regular.
Tried SPF and dmik text attributed on the domain. This didn't help
Looking around I can't see other people having this issue, but at this rate I certainly can't use mandrill for SMTP.
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.
Having the same problem on another server using another mandrill account.
Note: I'm using phpmailer
Example debug error:
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 -> CLIENT: 220 smtp.mandrillapp.com ESMTP
2014-12-06 08:52:59 CLIENT -> SERVER: EHLO fakemail.com
2014-12-06 08:52:59 SERVER -> 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 -> SERVER: AUTH LOGIN
2014-12-06 08:52:59 SERVER -> CLIENT: 334 VXNlcm5hbWU6
2014-12-06 08:52:59 CLIENT -> SERVER: bWVAZG91Z25vcmZvbGsuY29tLmF1
2014-12-06 08:52:59 SERVER -> CLIENT: 334 UGFzc3dvcmQ6
2014-12-06 08:52:59 CLIENT -> SERVER: REDACTED
2014-12-06 08:53:01 SERVER -> 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 -> SERVER: QUIT
2014-12-06 08:53:01 SERVER -> 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.
Example correct send:
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 -> CLIENT: 220 smtp.mandrillapp.com ESMTP
2014-12-06 08:52:33 CLIENT -> SERVER: EHLO fakemail.com
2014-12-06 08:52:33 SERVER -> 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 -> SERVER: AUTH LOGIN
2014-12-06 08:52:33 SERVER -> CLIENT: 334 VXNlcm5hbWU6
2014-12-06 08:52:33 CLIENT -> SERVER: bWVAZG91Z25vcmZvbGsuY29tLmF1
2014-12-06 08:52:33 SERVER -> CLIENT: 334 UGFzc3dvcmQ6
2014-12-06 08:52:33 CLIENT -> SERVER: REDACTED
2014-12-06 08:52:33 SERVER -> CLIENT: 235 2.7.0 Authentication successful
2014-12-06 08:52:33 CLIENT -> SERVER: MAIL FROM:<me#fakemail.com>
2014-12-06 08:52:33 SERVER -> CLIENT: 250 2.1.0 Ok
2014-12-06 08:52:33 CLIENT -> SERVER: RCPT TO:<me#fakemail.com>
2014-12-06 08:52:33 SERVER -> CLIENT: 250 2.1.5 Ok
2014-12-06 08:52:33 CLIENT -> SERVER: DATA
2014-12-06 08:52:33 SERVER -> CLIENT: 354 End data with <CR><LF>.<CR><LF>
2014-12-06 08:52:33 CLIENT -> SERVER: Date: Sat, 6 Dec 2014 19:52:33 +1100
2014-12-06 08:52:33 CLIENT -> SERVER: To: Test <me#fakemail.com>
2014-12-06 08:52:33 CLIENT -> SERVER: From: Test <me#fakemail.com>
2014-12-06 08:52:33 CLIENT -> SERVER: Subject: Here is the subject
2014-12-06 08:52:33 CLIENT -> SERVER: Message-ID: <0a8f3c40575be98668d8ea6fb03f4bfc#fakemail.com>
2014-12-06 08:52:33 CLIENT -> SERVER: X-Priority: 3
2014-12-06 08:52:33 CLIENT -> SERVER: X-Mailer: PHPMailer 5.2.9 (https://github.com/PHPMailer/PHPMailer/)
2014-12-06 08:52:33 CLIENT -> SERVER: MIME-Version: 1.0
2014-12-06 08:52:33 CLIENT -> SERVER: Content-Type: multipart/alternative;
2014-12-06 08:52:33 CLIENT -> SERVER: boundary="b1_0a8f3c40575be98668d8ea6fb03f4bfc"
2014-12-06 08:52:33 CLIENT -> SERVER: Content-Transfer-Encoding: 8bit
2014-12-06 08:52:33 CLIENT -> SERVER:
2014-12-06 08:52:33 CLIENT -> SERVER: --b1_0a8f3c40575be98668d8ea6fb03f4bfc
2014-12-06 08:52:33 CLIENT -> SERVER: Content-Type: text/plain; charset=us-ascii
2014-12-06 08:52:33 CLIENT -> SERVER:
2014-12-06 08:52:33 CLIENT -> SERVER: This is the body in plain text for non-HTML mail clients
2014-12-06 08:52:33 CLIENT -> SERVER:
2014-12-06 08:52:33 CLIENT -> SERVER:
2014-12-06 08:52:33 CLIENT -> SERVER: --b1_0a8f3c40575be98668d8ea6fb03f4bfc
2014-12-06 08:52:33 CLIENT -> SERVER: Content-Type: text/html; charset=us-ascii
2014-12-06 08:52:33 CLIENT -> SERVER:
2014-12-06 08:52:33 CLIENT -> SERVER: This is the HTML message body <strong>in bold!</strong>
2014-12-06 08:52:33 CLIENT -> SERVER:
2014-12-06 08:52:33 CLIENT -> SERVER:
2014-12-06 08:52:33 CLIENT -> SERVER:
2014-12-06 08:52:33 CLIENT -> SERVER: --b1_0a8f3c40575be98668d8ea6fb03f4bfc--
2014-12-06 08:52:33 CLIENT -> SERVER:
2014-12-06 08:52:33 CLIENT -> SERVER: .
2014-12-06 08:52:33 SERVER -> CLIENT: 250 2.0.0 Ok: queued as 109BC180070
2014-12-06 08:52:33 CLIENT -> SERVER: QUIT
2014-12-06 08:52:33 SERVER -> CLIENT: 221 2.0.0 Bye
2014-12-06 08:52:33 Connection: closed
Message sent!
I tried firing the email every 5 seconds. 3 out of 10 times it didn't send.
1 minute later, i tried every 10 seconds. 8 out of 10 didn't send.
Since it's intermittent, it certainly looks like a problem at their end. Set SMTPDebug = 3 to see the whole SMTP conversation.
From the one-sided view you've given, it doesn't look like you're using TLS, and it's common not to allow authentication prior to starting TLS, though I can see that the server is saying it will do it. I'd regard allowing auth without TLS as a security flaw, certainly not something you need to allow.
Also make sure you're using latest PHPMailer (5.2.9+).
Related
I am using zabbix to monitor my workplace infra, everything works fine. Now, I want to start generating reports. Although I followed everything as it is on the doc I still get this error:
Report generating test failed.
Cannot connect to web service: couldn't connect to server
Zabbix server (6.0 LTS), the database (mysql) and the web gui are all installed on the same VM on centos 8 stream without gui. I access, manage and administrate from my computer through ssh to the server and access the web gui through https://server_ip/zabbix. All traffic needed is allowed on firewall. I installed google-chrome-stable and the zabbix-web-service and configured it as it says (http://server_ip:10053/report). In the zabbix gui I added the Frontend URL https://server_ip/zabbix. I went through all the combinations of #ip, localhost, 127.0.0.1 between the server and the web-service and still get the same error, I also tried chromium and nothing.
From the server I tried curl -v http://server-ip:10053/report and I got
* Trying ip#...
* TCP_NODELAY set
* Connected to ip# (ip#) port 10053 (#0)
GET /report HTTP/1.1
Host: ip#:10053
User-Agent: curl/7.61.1
Accept: */*
HTTP/1.1 405 Method Not Allowed
Content-Type: application/problem+json
X-Content-Type-Options: nosniff
Date: Tue, 07 Feb 2023 14:35:16 GMT
Content-Length: 38
{"detail":"Method is not supported."}
* Connection #0 to host ip# left intact
Normally it should work because everything is on the same VM!
I'm learning basics of the networking and want to send a email via command line. I opened a telnet session with gmail-smtp-in.l.google.com:25 and issue the very first command EHLO gmail.com
220 mx.google.com ESMTP u16-20020ac25190000000b00449fff280afsi9331201lfi.49 - gmtp
EHLO gmail.com
502 5.5.1 Unrecognized command. u16-20020ac25190000000b00449fff280afsi9331201lf.49 - gsmtp
EHLO gmail.com
250-mx.google.com at your service, [xxx.xxx.xxx.xxx]
250-SIZE 157286400
250-8BITMIME
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-CHUNKING
250 SMTPUTF8
When i first issuing EHLO gmail.com it says Unrecognized command but then it accepts my command. What am i doing wrong?
I cannot replicate your problem. telnet gmail-smtp-in.l.google.com 25 followed by EHLO localhost after having received the greeting works fine for me. (You're not supposed to use gmail.com in EHLO, but this shouldn't matter. The correct way would be to use the fully qualified domain name for your machine (not localhost) or your IP address in square brackets if your machine has no DNS address.)
RFC 5321 specifies that SMTP clients should wait for the greeting from the server before sending the EHLO command. Delaying the greeting can be used as an anti-spam measure, but I don't think that this is the problem here.
I can't get Gmail SMTP to connect and I'm getting this debug info on tls:
2017-12-05 16:40:25 SERVER -> CLIENT: 220 smtp.gmail.com ESMTP q9sm1085224pfl.116 - gsmtp
2017-12-05 16:40:25 CLIENT -> SERVER: EHLO localhost
2017-12-05 16:40:25 SERVER -> CLIENT: 250-smtp.gmail.com at your service, [2405:204:d304:d69d:3c36:3d9:213e:186a]250-SIZE 35882577250-8BITMIME250-STARTTLS250-ENHANCEDSTATUSCODES250-PIPELINING250-CHUNKING250 SMTPUTF8
2017-12-05 16:40:25 CLIENT -> SERVER: STARTTLS
2017-12-05 16:40:25 SERVER -> CLIENT: 220 2.0.0 Ready to start TLS
SMTP Error: Could not connect to SMTP host.
2017-12-05 16:40:26 CLIENT -> SERVER: QUIT
2017-12-05 16:40:26
2017-12-05 16:40:26
SMTP Error: Could not connect to SMTP host.
Message could not be sent.Mailer Error: SMTP Error: Could not connect to SMTP host.
I have tried SSL too, which says "can't connect". I have never had an experience like this.
Note: I am using PHPMailer
Does anyone have the same issues or is it just me ?
I have just moved my server to OVH Dedicated server and now having a problem with SMTP, which I need a bit of help with.
SMTP is set on port 25, but when I am setting up my email client (MS Outlook 2010 or Android Email Client) I have notification "server does not support authentication"
I can receive emails on all of the email clients and can send email but only via webmail.
here is an update:
220 myserver.net ESMTP Postfix
EHLO iamuser
250-myserver.net
250-PIPELINING
250-SIZE 10240000
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DNS
Also if I enable TLS on Outlook the it works, but it does not work on android even with TLS.
Please help!!!
Server doesn't provide auth, it may be because of "smtpd_tls_auth_only = yes" in /etc/postfix/main.cf.
"smtpd_tls_auth_only = yes" forbid authentication on non-secure connection like port 25.
You can just change it to "no", or try using secure port 465 in Android Mail Client.
It's quite easy to check your SMTP server auth methods.
On Windows you need telnet client:
CMD> telnet yourserver.name 25
SERVER> 220 deb7x64-plesk12-1.local ESMTP Postfix (Debian/GNU)
CLIENT> EHLO iamuser
SERVER> 250-deb7x64-plesk12-1.local
SERVER> 250-PIPELINING
SERVER> 250-SIZE 10240000
SERVER> 250-ETRN
SERVER> 250-STARTTLS
SERVER> 250-AUTH DIGEST-MD5 CRAM-MD5 PLAIN LOGIN
SERVER> 250-ENHANCEDSTATUSCODES
SERVER> 250-8BITMIME
SERVER> 250 DSN
CLIENT> quit
SERVER> 221 2.0.0 Bye
Where "DIGEST-MD5", "CRAM-MD5", "PLAIN", "LOGIN" it's an authentication methods.
I've checked that "Android Email Client" is replaced with google's Gmail application and it working fine with provided auth methods.
I have an older PHP system that uses SMTP commands for mail. We are switching over to gmail and I need to authenticate. I can connect to the server. Unfortunately, I get a 530-5.5.1 Authentication Required. Learn more at" message when I send the MAIL FROM command in my PHP code.
if (fputs($this->Socket, "MAIL FROM: \"admin\" <admin#yourdomain.com>\r\n")<0){
I cannot find a clear example of adding authentication. I read at http://www.faqs.org/rfcs/rfc2554.html that I must add AUTH= to my MAIL FROM command. I am having troubles interpretting what to put in the AUTH=
Examples:
C: MAIL FROM:<e=mc2#example.com> AUTH=e+3Dmc2#example.com
S: 250 OK
Do you know the format of authentication?
There are several ways to do SMTP authentication, but one of them is to use the SMTP AUTH LOGIN command. The transcript of the session would look like this:
host: 220 banner_here
client: EHLO StephaniePC
host: 250-name.of.host hello [clientip], pleased to meet you
host: 250-AUTH LOGIN PLAIN
host: 250 OK
client: AUTH LOGIN
host: 334 VXNlcm5hbWU6
client: am9lc21pdGg=
host: 334 UGFzc3dvcmQ6
client: bGV0bWVpbg0K
host: 235 2.7.0 Authentication successful
client: MAIL FROM: <sender#senderdomain.tld>
host: 250 2.1.0 Ok
client: RCPT TO: <recipient#recipientdomain.tld>
host: 250 2.1.0 Ok
client: DATA
host: 354 End data with <CR><LF>.<CR><LF>
....
The encoded strings that you see above are base64 encoded. If you have a mail client that is capable of logging, you can try sending a message through gmail, and the transcript of the session should look like the transcript above.
FYI, instead of writing code yourself to do SMTP authentication, you might want to use phpmailer. phpmailer can do SMTP authentication, and it's very lightweight and easy to use.