pash/email_veracity_checker — pull request #2 by Mattyx (2013-05-22 20:21:36+00:00)
Title: False negatives?

I've noticed that an email address is marked invalid in case the authoritative SMTP server doesn't accept HELO after the first EHLO.

Example of a conversation for checking an existing email address instead marked invalid:

Connection opened: smtp.aliceposta.it:25
-> "220 smtp106.alice.it ESMTP Service ready\r\n"
<- "EHLO example.com\r\n"
-> "250-smtp106.alice.it\r\n"
-> "250-DSN\r\n"
-> "250-8BITMIME\r\n"
-> "250-PIPELINING\r\n"
-> "250-HELP\r\n"
-> "250-AUTH=LOGIN\r\n"
-> "250-AUTH LOGIN CRAM-MD5 DIGEST-MD5 PLAIN\r\n"
-> "250-DELIVERBY 300\r\n"
-> "250 SIZE 31457280\r\n"
<- "HELO example.com\r\n"
-> "503 wrong state for HELO command\r\n"

Doing the same thing, manually by telnet, using only HELO, permits to continue the conversation and brings me to a valid email address result.

Any idea to solve this problem?

Is possible to fallback into an "HELO only" conversation and retry if a 503 error is received?