$ telnet remotehost 25
HELO localhost
MAIL FROM: johndoe@localhost
RCPT TO: jilldoe@remotehost
DATA
Subject:Test Message
This is a test message.
.
QUIT
- sandip's blog
- Login or register to post comments
$ telnet remotehost 25
HELO localhost
MAIL FROM: johndoe@localhost
RCPT TO: jilldoe@remotehost
DATA
Subject:Test Message
This is a test message.
.
QUIT
Comments
Generate base64 encoded authentication string:
echo -ne '\000username\000password ' | openssl enc -base64
or with perl:
perl -MMIME::Base64 -e 'print encode_base64("\000userna me\000password");'
Replace the username and password respectively. "\000" is a null byte character used as the separator between username and password:
It prints something like:
AHVzZXJuYW1lAHBhc3N3b3Jk
Copy that string and simulate a login session:
telnet remotehost 25
Example session transcript is below (bold is to be typed):
"OK Authenticated" would mean the authentication was successful.
Since the server offer "STARTTLS" session, to test TLS encrypted session, use openssl instead of telnet:
openssl s_client -connect {remotehost}:25 -starttls smtp