Home > Articles > Networking

This chapter is from the book

Mail Service Programs

Mail services are provided by a combination of programs that interact, as shown by the simplified diagram in Figure 3.

Figure 3 How Mail Programs Interact

Users send messages with programs—known as mail user agents (MUAs)—such as mailx, mailtool, or dtmail. See the manual pages for information about these programs.

The message is collected by the program that was used to generate it and is passed to the sendmail daemon or mail transport agent (MTA). The sendmail daemon parses (divides into identifiable segments) the addresses in the message, using information from the configuration file /etc/mail/sendmail.cf to determine network name syntax, aliasing, forwarding information, and network topology. Using this information, sendmail determines the route a message must take to get to a recipient.

The sendmail daemon passes the message to the appropriate mail hub, where it is handed off to a mail delivery agent. The /usr/lib/mail.local program—an example of a mail delivery agent—on the mail hub delivers the mail to the mailbox in the /var/mail/username file of the recipient of the message.

The user is notified that mail has arrived and retrieves it using an MUA such as /bin/mail, /bin/mailx, mailtool, dtmail, or a similar program.

Mail User Agents (MUAs)

The mail user agent is the program that acts as the interface between the user and the sendmail program. The MUAs for the Solaris Operating Environment are /usr/bin/mail, /usr/bin/mailx, $OPENWINHOME/bin/mailtool, and /usr/dt/bin/dtmail.

Mail Transport Agent (MTA)

The transport agent actually receives and deliveres messages. The transport agent for the Solaris Operating Environment is sendmail.

Open source sendmail is available at the http://www.sendmail.org Web site, which is maintained by the Sendmail Consortium. At the time of writing, the current version of sendmail is 8.11.3. Sun compiles sendmail version 8.9.3 and provides it as part of Solaris.

The transport agent performs the following functions.

  • Accepts messages from the mail user agent.

  • Understands destination addresses.

  • Hands off mail originating on the local system to the proper delivery agent.

  • Receives incoming mail from other MTAs and hands it off to delivery agents for delivery to local users.

If you want to use a more current version of sendmail than Sun provides, you can download it from http://www.sendmail.org. Two additional Web sites provide additional information about sendmail. A forum at http://www.sendmail.net disseminates information about and discuss sendmail. It has many useful articles and publishes news related to sendmail. http://www.sendmail.com sells a commercial version of sendmail. This version has nice graphical tools to help you customize sendmail.

The sendmail Configuration File (sendmail.cf)

A configuration file controls the way that sendmail performs its functions. The configuration file determines the choice of delivery agents, address-rewriting rules, and the format of the mail header. It also enables you to specify options that modify the functionality of different features or to turn the features on or off.

The sendmail program uses the information from the /etc/mail/sendmail.cf file to perform its functions. Each system has a default sendmail.cf file installed in the /etc/mail directory. You may not need to build a customized configuration file for your mail clients, but you do need to build them for your gateways and mail hubs.

The Solaris Operating Environment provides two default configuration files, which are also in the /etc/mail directory.

  • A configuration file named main.cf for the system (or systems) you designate as the mail hub or a gateway.

  • A configuration file named subsidiary.cf (a duplicate copy of the default sendmail.cf file).

Which configuration file you use on any individual system depends on the role the system plays in your mail service.

  • For mail clients, you do not need to do anything to set up or edit the default configuration file.

  • To set up a mailhost, a relay host, or a gateway, copy the /usr/lib/mail/cf/main-v7sun.mc file and rename it with a .mc (mail configuration) suffix. Next, edit the .mc file to set parameters needed for your mail configuration: gateway and mail hub. You must then "compile" the file, using the m4 macro processor. See "Generating the sendmail Configuration File" on page 53 for more information. Refer to Chapter 2, "Customizing sendmail Configuration Files" for information on editing configuration files.

The following list describes some configuration parameters you may want to change, depending on the requirements of your site.

NOTE

You change these parameters in the .mc file that is used to generate the sendmail.cf file, not in the sendmail.cf file itself. The parameters are mentioned here so that you know what they look like in the resulting configuration file.

  • Time values.

    Specify how often sendmail runs the queue. The interval is typically set to between 15 minutes and 1 hour.

    Specify read timeouts.

    Specify how long a message remains in the queue before it is returned to the sender.

  • Delivery modes specify how quickly mail is to be delivered.

  • Load limiting prevents wasted time during loaded periods because it does not attempt to deliver large messages, messages to many recipients, or messages to sites that have been down for a long time.

  • Log level specifies what kinds of problems are logged.

  • File modes.

    setuid for sendmail.

    Temporary file modes.

    /etc/mail/aliases permissions.

The sendmail program receives a message from a program such as mailx, mailtool, or dtmail, edits the message header as required by the destination mailer, and calls appropriate delivery agents to make the delivery. If delivery cannot be made immediately, sendmail requeues the request and tries to hand off delivery to the proper delivery agent at regular intervals until delivery is successful or until a timeout value is reached.

NOTE

The sendmail program never edits or changes the body of a message. Any changes that it makes to interpret e-mail addresses are made only in the header of the message.

Argument Processing and Address Parsing

When sendmail processes a message, it collects recipient names (either from the command line or from the SMTP protocol) and generates two files. One is an envelope that contains a list of recipients and information about delivery. The other file contains the header and the body of the message. The sendmail program ex_pands aliases, including mailing lists, and validates as much as possible the remote recipient; sendmail checks syntax and verifies local recipients. Detailed checking of host names is deferred until delivery. As local recipients are verified, messages are forwarded to them.

After parsing the recipient lists, sendmail appends each name to both the envelope and the header of the message. When a name is aliased or forwarded, it retains the old name in the list and sets a flag to tell the delivery phase to ignore this recipient. The lists are kept free from duplicates, preventing "alias loops" and duplicate messages delivered to the same recipient, which can occur if a recipient is in two different alias groups.

NOTE

Users may receive duplicate copies of the same message when alias lists contain e-mail addresses for the same person (who is using different syntax). The sendmail program cannot always match the duplicate e-mail addresses.

Message Collection

The sendmail program then collects the message. The message has a header at the beginning. The header and the body of the message must be separated by a blank line. The only formatting requirement imposed on the message body is that its lines of text must be no greater than 1,024 bytes. The sendmail program stores the header in memory and stores the body of the message in a temporary file. To simplify the program interface, the message is collected even if no names are valid—in which case the message is returned with an error.

NOTE

Until now, sendmail could not transmit binary data as part of mail messages. With the advent of the multimedia mailtool, users can now transmit binary data. It must, however, be encoded by a mail user agent. sendmail does not do any automatic encoding of binary data. Refer to the documentation for Mail Tool or dtmail for information on how to encode and decode electronic mail messages.

Message Delivery

For each unique mailer and host in the recipient list, sendmail calls the appropriate delivery agent. Each invocation of a delivery agent sends a message to all of the users on one host. Delivery agents that accept only one recipient at a time are handled properly.

The sendmail program sends the message to the delivery agent with one of the same interfaces used to submit a message to sendmail (using the conventional UNIX argument vector/return status, speaking over a pair of UNIX pipes and speaking SMTP over a TCP connection). Each copy of the message has a customized header attached to the beginning of it. The delivery agent catches and checks the status code, and a suitable error message is given as appropriate. The exit code must conform to a system standard. If a nonstandard exit code is used, the message Services unavailable is used.

Queuing for Retransmission

When the delivery agent returns a status that shows it might be able to handle the mail later (for example, the next host is down or the phone is busy for UUCP), sendmail stores it in a queue and tries again later.

Return to Sender

If errors occur during processing, sendmail returns the message to the sender for retransmission. The letter may be mailed back or written to the dead.letter file in the sender's home directory.

.forward Files

Users can create a .forward file in their home directory that sendmail uses to temporarily redirect mail or send mail to a custom set of programs. With a .forward file, users can redirect their mail without needing to bother a system administrator with frequent alias change requests. When troubleshooting mail problems, particularly problems of mail not being delivered to the expected address, always check the user's home directory for a .forward file.

Mail Delivery Agents

A mail delivery agent (or delivery agent) specifies a program external to sendmail that sendmail uses to deliver messages to various locations and for various purposes. The following list provides examples of delivery agents.

  • local—This delivery agent actually delivers an e-mail message into a user's mailbox, usually on a central mail hub system.

  • prog—This delivery agent enables an e-mail message to be passed into a program instead of into a mailbox.

  • smtp—This delivery agent does not actually call a program. Instead, it instructs sendmail to open a TCP network connection with another sendmail program running on another host. smtp enables sendmail to transmit messages to users that don't have a mailbox on the local system.

Delivery agents return the status of their deliveries to sendmail. If the delivery is successful, sendmail does no further work. If the delivery fails, then sendmail determines whether to requeue the message for another delivery attempt later or to bounce the message back to the original sender. sendmail makes this decision based on the status returned by the delivery agent.

Delivery agents are sometimes called mailers. This terminology is confusing because the m4 macros used to specify delivery agents in .mc files are called MAILERs. Therefore, we use the term delivery agent here. For more information, see "Mailers" on page 51.

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020