shell - automate email validation using telnet -
i'm trying use following script validate if email address exists:
telnet gmail-smtp-in.l.google.com 25 helo example.com mail from: <me@example.com> rcpt to: <somenonexistinguser@gmail.com>
how automate process since have list of emails addresses need validated? need determine it's valid or not based on return value (550 or 220) , quit move next email address.
smtp-quirks greet-delays , multi-line smtp replies difficult automate using telnet. suggest use rfc-compliant smtp library in programming language of choice, example python's smtplib. remember there more return codes 550 , 220 need handle well. example 4xx codes happen quite (greylisting, overquota, ...)
note however, not reliable way validate email address. many servers accept address in hosted domains during smtp stage , bounce them afterwards. also, these kinds of smtp-probes considered abusive postmasters , can lead blacklistings.
Comments
Post a Comment