Appendix G. A typical SMTP transaction

For the basics of the SMTP protocol please consult RFC 2821 and RFC 1123. (Details of error codes and the handling of enhanced errors may be found in RFC 1893 and RFC 2034.)

The following example assumes no errors, and is a deliberately simple:

Example G-1. Sending mail from foo@example.org to user@hosted.org.


220 incoming.mail-scanning.com ESMTP qpsmtpd 1.40[1] ready; send us your mail, but not your spam.
HELO my.host.name
250 incoming.mail-scanning Hi my.host.name [192.168.1.10]; I am so happy to meet you.
MAIL FROM: <foo@example.org>
250 <foo@example.org>, sender OK - how exciting to get mail from you!
RCPT TO:<user@hosted.org>
250 <user@hosted.org>, recipient ok
DATA
354 go ahead
To: steve@steve.org.uk
From: foo@example.org
Date: Today
Subject: test

This is a test

Steve
--
.
200 queued!
QUIT
221 incoming.mail-scanning.com closing connection. Have a wonderful day.

Notes

[1]

The qpsmtpd version is a local one, rather than the one distributed from qpsmtpd homepage, or the Debian distribution of GNU/Linux.