This procedure is commonly used to troubleshoot SMTP hosts. In combination with a nslookup query for MX records for a domain (listed after this) you can successfully figure out if a given domain can receive internet email successfully.
1) Open a telnet session to a SMTP – let’s say foo.mydomain.com – or an IP address
telnet foo.mydomain.com 25
What you get back:
220 foo.mydomain.com Microsoft ESMTP MAIL Service, Version: 6.0.3790.1289 ready at Wed, 19 Oct 2005 10:27:34 -0700
2) Now you can say where you’re sending mail from using HELO
250 foo.mydomain.com Hello [126.96.36.199]
5) To start message content, issue the DATA command
354 Please start mail input.
6) Enter the Subject
Subject: This is a test
7) Type in the body
This is a test from [email protected]
8) To end the message, enter a dot in a new line followed by Enter
250 Mail queued for delivery.
10) Close the connection
221 Closing connection. Good bye.
How to determine the mail exchanger (MX) for a domain
You can use the following procedure to determine the mail servers designated as “mail exchangers” for a domain. This is done by inserting a MX record for those servers in the DNS. Best practice for MX records is to point them to A records. A records are simple hostname to IP address mappings.
Pointing MX records to CNAME records may result in performance issues.
From a command prompt, type:
nslookup -querytype=MX somedomain.com
This should produce output similar to the following:
somedomain.com MX preference = 10, mail exchanger = mx1.somedomain.com
somedomain.com MX preference = 20, mail exchanger = mx2.somedomain.com
mx1.somedomain.com internet address = x.x.x.x
mx2.somedomain.com internet address = x.x.x.x