How to test a mail server?

Which steps have to be done to manually send an email using the SMTP protocol? This can be useful to check after setup if a mailserver is configured properly.

Taggings:

1 answer

example of a smtp dialog

Connect to an arbitrary mail server on port 25 using telnet
telnet mail.eightloops.com 25

The mail server responds
Trying 176.9.117.182...
Connected to mail.eightloops.com.
Escape character is '^]'.
220 mail.eightloops.com ESMTP Postfix (Ubuntu)

Type into the smtp session:
ehlo eightloops.com

The mail server responds:
250-mail.eightloops.com
250-PIPELINING
250-SIZE 40960000
250-VRFY
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN

Tell the mail server who is the sender:
MAIL FROM: e1129560@student.tuwien.ac.at
250 2.1.0 Ok

Tell the mail server who is the recipient:
RCPT TO: thomas.preissler@eightloops.com
250 2.1.5 Ok

Tell the mail server that you want to deliver the actual data:
DATA
354 End data with .
Subject: test
Hello World!

Quit your message by using a single dot
.

250 2.0.0 Ok: queued as 13C248D49E5D

Quit the SMTP session
quit
221 2.0.0 Bye
Connection closed by foreign host.

Taggings: