Debug SMTP with curl

Sometimes there is need to debug SMTP connection and there is no telnet which is usually used for that. There is solution for this problem.

You can use curl!

curl -v --connect-timeout 10 smtp://74.125.131.109:587/

will return

*   Trying 74.125.131.109...
* TCP_NODELAY set
* Connected to 74.125.131.109 (74.125.131.109) port 587 (#0)
< 220 smtp.gmail.com ESMTP b64sm140514ljf.82 - gsmtp
> EHLO MacBook-Pro-Boaa
< 250-smtp.gmail.com at your service, [151.80.137.178]
< 250-SIZE 35882577
< 250-8BITMIME
< 250-STARTTLS
< 250-ENHANCEDSTATUSCODES
< 250-PIPELINING
< 250-CHUNKING
< 250 SMTPUTF8
> HELP
< 214 2.0.0  https://www.google.com/search?btnI&q=RFC+5321 b64sm140514ljf.82 - gsmtp
214 2.0.0  https://www.google.com/search?btnI&q=RFC+5321 b64sm140514ljf.82 - gsmtp
* Connection #0 to host 74.125.131.109 left intact

 

Leave a Comment.