gtpc1m53 | Transmission Control Protocol/Internet Protocol |
Figure 29 shows the interrelationships of the actions and protocols that are involved when sending and receiving Internet mail on the TPF system.
Figure 29. TPF Internet Mail Server Overview
When sending mail to another user, the mail client (Mail Client 1 in this figure) must use SMTP to put mail in the Internet mail system. Typically, the mail client uses a mail server client program such as Microsoft Outlook, Netscape, or other client program. This mail server client program connects to the SMTP server on well-known port 25 and sends the mail. On the TPF system, the SMTP server is based on the Secure Mailer, also known as Postfix. For more information about Postfix, go to: http://www.postfix.org.
Once the SMTP server stores the mail, the server indicates to Mail Client 1 that it has received the mail so that the client can disconnect or send more mail. The SMTP server must determine if this mail is destined for a user on a local domain (where the SMTP server is running) or for a user on a remote domain. If the mail is for a user on the local domain, the SMTP server calls the local delivery function. If the mail is for a user on a remote domain, the SMTP server becomes an SMTP client and attempts to contact the server for that domain to transfer the mail item and delete it from local storage.
At some point, the receiving mail client (Mail Client 2) attempts to check the mail. Similarly to Mail Client 1 with SMTP, Mail Client 2 uses a mail server client program that connects to the IMAP server on well-known port 143, or to the POP server on well-known port 110, and retrieves the mail. On the TPF system, the IMAP and POP servers are based on the Cyrus project. For more information about the Cyrus project, go to: http://www.cmu.edu/computing/cyrus.
POP retrieves the mail item, sends the mail to the user and, optionally, deletes the copy from the mail server to free the resources of the server. IMAP allows the client to keep the mail in mailboxes on the server, and provides operations for creating, deleting, and renaming mailboxes, as well as other mail and mailbox management functions.
Figure 30 shows how the IMAP and POP servers access mail in mailboxes.
Figure 30. TPF Internet Mail Server Database -- Accessing Mail
Each user has a user profile record (UPR), which is accessed through a #MAILxx fixed file record on a subsystem of your choice, where xx is a 2-character alphanumeric string. The #MAILxx record provides a first-level index to the UPR and contains pointers to either a UPR or to a second-level index record. If there are few users, the first-level index points directly to the UPRs. At some point, a second-level index is automatically created to provide better scalability for a very large number of mail clients.
There is a different #MAILxx record type associated for each domain in your mail system. For example, you can associate #MAIL01 with the mail.site1.ibm.com domain and #MAIL02 with the mail.site2.com domain. This is defined in the TPF configuration file named /etc/tpf_mail.conf. See TPF Configuration File Parameters for more information about the TPF configuration file. Allocate 1000 #MAILxx records for each domain that you define. See TPF System Generation for more information about allocating fixed file records.
The UPR contains the access control information for the user and pointers to the mailbox records. Users can have more than their inbox, which is the mandatory mailbox, and can have submailboxes defined in a naming hierarchy, such as user1.inbox.projects.work.mail or user1.inbox.projects.fun.swingset. Each mailbox contains pointers to mail items; that is, messages that have been received and moved to the mailbox. All incoming mail from other users is pointed to from the inbox.
The access control information for each user is kept with the mailbox pointer in the UPR. For accountability, the access rights that the owner has given to each user is kept in a separate record called the access control list (ACL). For example, user1 can authorize user2 to read mail items in the user1.inbox.projects.fun.swingset mailbox.
Figure 31 shows how the SMTP server accepts and delivers mail to the mailboxes.
Figure 31. TPF Internet Mail Server Database -- Accepting and Delivering Mail
As mail items are sent to the SMTP server, the server puts a pointer to the mail item on file in the active mail queue for delivery. There is also a deferred mail queue, similar in structure to the active mail queue, which is used to hold mail that currently cannot be delivered. Both the active and deferred mail queues are accessed through #IBMMP4 fixed file records, referred to as the active queue index record and the deferred queue index record, respectively. There is one active queue index record and one deferred queue index record for each queue. The mail queues are processor unique; therefore, if you run TPF Internet mail server support on more than one processor, mail items from a failing processor can be moved to another TPF processor in your complex and continue to be delivered.
When a new mail message is sent to the SMTP server for delivery, a pointer to the new mail item is added to an active queue record. An active queue record contains multiple pointers to mail items. When one active queue record is full, another one is created. The pointer to a new active queue record is added to an active queue control record. An active queue control record contains pointers to multiple active queue records. As the active queue control records fill up, they are added to the end of a chain of active queue control records. Each active queue control record has a forward and backward pointer.
The active queue index record points to the head of the queue, which is the first active queue control record in the chain, and to the end of the queue, which is the last active queue control record in the chain. Mail deliveries are processed from the head of the chain, but there are additional pointers in the active queue index record that further indicate where local and remote delivery agents are currently processing. The number of these different delivery agents can be independently configured in the TPF configuration file (/etc/tpf_mail.conf). See TPF Configuration File Parameters for more information about the configuration parameters available for the TPF configuration file.
The deferred queue index record performs similarly to the active queue index record, but uses only one delivery agent because it only delivers remote mail.