Sending and Receiving EMail

Most of the time this is a painless task. You just set up your email client and hit the Send/Receive button and away you go. But what happens when things go wrong? How do you troubleshoot the problem? Our Knight in shining armour is telnet. You can use this program to manually perform the sequence of commands as shown below.

telnet mail.xxx.com 25

A typical conversation goes something like this (your entry in bold)

Sending Email

telnet mail.mydomain.com 25
220 mydomain.com ESMTP Sendmail 8.11.6/8.11.6; Thu, 26 Oct 2006 11:18:07 -0600
HELO fromme.com
250 mydomain.com Hello [xxx.xxx.xxx.xxx], pleased to meet you
MAIL FROM: test@
250 2.1.0 test@ Sender ok
RCPT TO: validuser@mydomain.com
250 2.1.5 validuser@mydomain.com… Recipient ok
DATA
354 Enter mail, end with “.” on a line by itself
Date: Sun,17 Aug 1997 18:48:15 +0200
From: Me <forged@dummy.com>
To: “You@Yours.com” <You@Yours.com>
Subject: This is a test message

This is the message body
.

250 2.0.0 k9QHLHX00862 Message accepted for delivery
QUIT
221 2.0.0 mydomain.com closing connection

Connection to host lost.

If your server supports ESMTP, it is also possible to start the conversation with EHLO instead of HELO. ESMTP allows for delivery status notifications and multiple attachment encodings

220 mydomain.com ESMTP Sendmail 8.11.6/8.11.6; Thu, 26 Oct 2006 16:11:25 -0600
EHLO fromme.com
250-mydomain.com Hello [xxx.xxx.xxx.xxx], pleased to meet you
250-ENHANCEDSTATUSCODES
250-8BITMIME
250-SIZE
250-DSN
250-ONEX
250-ETRN
250-XUSR
250-AUTH PLAIN LOGIN
250 HELP

Receiving EMail

A typical POP3 (receiving) conversation is

telnet mail.mydomain.com 110
+OK AVG POP3 Proxy Server <9397.1161883939@mydomain.com> 7.1.400/7.1.408 [268.13.11/494]
USER validuser
+OK Password required for validuser
PASS xxxxxxxx
+OK validuser has 10 visible messages (0 hidden) in 1275592 octets.
STAT
+OK 10 1275592
LIST
+OK 10 visible messages (1275592 octets)
1 20018
2 19726
……..
9 18883
10 519
.
RETR 10
+OK 519 octets
Return-Path: <test>test@
Received: from fromme.com ([xxx.xxx.xxx.xxx])
by mydomain.com (8.11.6/8.11.6) with SMTP id k9QHLHX00862
for validuser@mydomain.com; Thu, 26 Oct 2006 11:21:48 -0600
Message-Id: <200610261721.k9QHLHX00862@mydomain.com>
X-Envelope-From: test@
X-Envelope-To: validuser@mydomain.com
X-Protocol: SMTP
Date: Sun,17 Aug 1997 18:48:15 +0200
From: Me <forged@dummy.com>
To: “You@yours.com” <You@Yours.com>
Subject: This is a test message
X-UIDL: O*5!!PS:”!7Jk”!~+=”!
X-Antivirus: AVG for E-mail 7.1.408 [268.13.11/494]
Mime-Version: 1.0
Content-Type: text/plain

This is the message body


No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.408 / Virus Database: 268.13.11/494 – Release Date: 24/10/2006

.
QUIT
+OK Pop server at mydomain.com signing off.

Connection to host lost.

You can see how easy it is for spammers to send fake or phishing emails – the only genuine piece of information in this header is my IP Address, which I have blanked out [xxx.xxx.xxx.xxx]

Other Tests

The other thing to do is to go to http://www.dnsstuff.com and fill out the DNS Lookup for the MX records of your domain in the top right box