Receiving email from the network via the SMTP protocol is perhaps the most common use of qmail. As described before, qmail-smtpd
is run by another program that handles all the networking details. The behavior of qmail-smtpd
is affected by environment variables. For the purpose of this book, discussion is limited to using tcpserver
with qmail-smtpd
, but the basic techniques discussed here apply to whatever software is used in its stead.
When a remote machine connects and talks to qmail-smtpd, qmail-smtpd
has two primary responsibilities: determining whether the message should be accepted, and if it should, then handing the message to qmail-queue
for injection into the on-disk queue. qmail-smtpd
uses four key pieces of information to decide whether to accept each message and hand it to qmail-queue:
1. The recipients of the message
2. The existence of the
RELAYCLIENT
environment variable3. The size of the message
4. The message...