SMTP - How to verify your connection and parameters (TSL/SSL) with TELNET ?
Prerequisites
You must be in the possession of your smtp parameters. The best way is to use the smtp of your ISP because you will then have access to a SSL connection, and with it, the possibility to send an email everywhere you are.
We are going to try to connect to the Smtp server with this credential :
- smtp server : smtp.xs4all.nl
- port : unsecure 25 or secure TLS : 587
- Login : login
- Password : password
- Sender : nicolas.gerard@newfrontiers.com
- smtp server : mail.gmx.com
- port : 25
Before we continue with the process, if we use a secure SMTP, we need to encode our credential in a base64 encoding. You can perform a search on Google to find an encoder or you can go on this one :
Enter the login and click on the encode button, copy the result and do the same for the password. We retrieve then this values :
- Login : bG9naW4=
- Password : cGFzc3dvcmQ=
Article related
Port Used by Smtp Service
The following ports can be used in a smtp service :
| Service | Port | Service |
|---|---|---|
| smtps | 465/tcp | #smtp protocol over TLS (was ssmtp) |
| submission | 587/tcp | Submission for Simple Mail Transfer |
Telnet
Below, you can find all the command that you must tape in the telnet windows.
AUTH LOGIN bG9naW4= <-- login cGFzc3dvcmQ= <-- password
ehlo nico AUTH LOGIN bG9naW4= <-- login cGFzc3dvcmQ= <-- password MAIL FROM: nicolas.gerard@newfrontiers.com RCPT TO: gerardnico@gmail.com DATA This a big big test . QUIT
The Smtp Server will always respond with a message.
QUIT 500 5.5.1 Command unrecognized: "QUIT"
This message is not true, the command QUIT exist but if you have done a mistake as for instance if you have written QUIY, you correct it and you valid, you will have this error.
Open a command dos and launch telnet for the smtp server smtp.xs4all.nl on the port 587
Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\Documents and Settings\Nicolas>telnet smtp.xs4all.nl 587
The server smtp must answer :
220 smtp-vbr15.xs4all.nl ESMTP Sendmail 8.13.8/8.13.8; Sun, 26 Apr 2009 14:17:28 +0200 (CEST)
And you can begin to talk :
ehlo nico 250-smtp-vbr15.xs4all.nl Hello 5353DF77.cable.casema.nl [83.83.223.119], pleased to meet you 250-ENHANCEDSTATUSCODES 250-PIPELINING 250-8BITMIME 250-SIZE 31457280 250-DSN 250-AUTH LOGIN PLAIN 250-STARTTLS 250-DELIVERBY 250 HELP AUTH LOGIN 334 VXNlcm5hbWU6 bG9naW4= 334 UGFzc3dvcmQ6 cGFzc3dvcmQ= 235 2.0.0 OK Authenticated MAIL FROM: nicolas.gerard@newfrontiers.com 250 2.1.0 nicolas.gerard@newfrontiers.com... Sender ok RCPT TO: gerardnico@gmail.com 250 2.1.5 gerardnico@gmail.com... Recipient ok DATA 354 Enter mail, end with "." on a line by itself This a big big test . 250 2.0.0 smtp-vbr15.xs4all.nl accepted message n3QCHS17026035 QUIT 221 2.0.0 smtp-vbr15.xs4all.nl closing connection Connection to host lost.
The result
Support
Smtp Error
You have an error code, see this article to find the meaning :
With Google / STARTTLS
Basic telnet does not support SSL or TLS. You have to use openssl or stunnel to verify your smtp parameters.
C:\Documents and Settings\Nicolas>telnet smtp.gmail.com 587
220 mx.google.com ESMTP 10sm8014744eyd.42 ehlo nico 250-mx.google.com at your service, [83.83.223.119] 250-SIZE 35651584 250-8BITMIME 250-STARTTLS 250-ENHANCEDSTATUSCODES 250 PIPELINING AUTH LOGIN 530 5.7.0 Must issue a STARTTLS command first. 10sm8014744eyd.42 STARTTLS 220 2.0.0 Ready to start TLS EHLO NICO Connection to host lost. C:\Documents and Settings\Nicolas>
With Yahoo
C:\Documents and Settings\Administrateur>telnet plus.smtp.mail.yahoo.com 587
220 smtp107.prem.mail.ac4.yahoo.com ESMTP ehlo nico 250-smtp107.prem.mail.ac4.yahoo.com 250-AUTH LOGIN PLAIN XYMCOOKIE 250-PIPELINING 250 8BITMIME AUTH LOGIN 334 VXNlcm5hbWU6 Z2VyYXJkbmljb0Byb2NrZXRtYWlsLmNvbQ== 334 UGFzc3dvcmQ6 ZmFrZXBhc3N3b3Jk 530 Access denied : Free users are not supported on this server.
Reference : POP Yahoo! Mail Plus with Microsoft Outlook Express
