How the SMTP Service works
When the SMTP service is installed, it creates a directory called
MailRoot with a number of subdirectories which are used for the processing of SMTP Mail. The names and purposes of these subdirectories are described below.
Pickup directory is used as the primary location for outgoing mail messages. Whenever a mail message is placed in this directory, the SMTP service will pick up the message and process it. This means that you can copy a text file into this directory and, if it is in the correct format, it will be sent as a mail message.
After a message has been retrieved from the
Pickup directory, SMTP attempts to send it immediately. If the message cannot be sent immediately, it is placed in the
Queue directory and the SMTP service attempts to re-send the message at regular intervals. The number and frequency of retries can be configured via the Delivery tab of the property sheet for the SMTP site in the Microsoft Management Console.
The Queue directory also contains transcript files. These are text files and have either an
LTR (local transcript) or
RTR (remote transcript) extension and can be used to determine the reason for the non-delivery of a particular mail message.
If a message cannot be delivered (and the maximum number of retries has been exceeded) and the message cannot be returned to the sender as undeliverable, it is placed in the
BadMail directory. After installation, the location of the
BadMail directory can be altered via the Messages tab of the tab of the property sheet for the SMTP site in the Microsoft Management Console.
This is the location for incoming messages for all of the local domains that make up a particular site. Note that there is only a single
Drop directory for all users on all local domains. The SMTP service within IIS 4.0 has no concept of local mailboxes and so delivery of incoming mail messages to individual mailboxes is not supported. However, inbound messages in the
Drop directory can be read from an Active Server Page, and this is illustrated with a code sample towards the end of this chapter.
As you can see, the SMTP service in IIS 4.0 is all directory-based and it is really fairly simple to follow. Hopefully, this has given you a good high-level understanding of how it works. If you feel that you need more information on the installation and configuration of the SMTP server component, you should consult the Microsoft SMTP Service documentation that is installed when you install IIS 4.0. Otherwise, we probably have enough information under our hats to get into what is the main thrust of this chapter.