The Mailer Definitions Section (Part 2):
The next five mailer commands define mailers for TCP/IP mail delivery. The first one, designed to deliver traditional 7-bit ASCII SMTP mail, is called smtp. The next mailer definition, which is for Extended SMTP mail, is called esmtp. The smtp8 mailer definition handles unencoded 8-bit SMTP data. The dsmtp mailer provides support for on-demand SMTP, which is special form of SMTP in which the recipient downloads mail instead of the normal case in which the sender initiates mail transfer. Finally, relay is a mailer that relays TCP/IP mail through an external mail relay host. Of these, only esmtp, which is the default mailer, and relay are actually used anywhere in the basic configuration.
The last mailer definition in the previous listing is for procmail. procmail is an optional mailer found on most Linux systems. The A argument in this definition invokes procmail with the –m command-line argument, which allows procmail to be used for mail filtering. Like most of the SMTP mailers, this mailer is not used anywhere in the basic sendmail.cf file. These unused definitions provide a complete set of mailers, but they are not needed for most configurations.
Examining any one of the mailer entries, such as the entry for the smtp mailer, explains the structure of all of them:
- M Beginning a line with an M indicates that the command is a mailer definition.
- smtp Immediately following the M is the name of the mailer, which can be anything you wish. In this sample, the name is smtp.
- P=[IPC] The P argument defines the path to the program used for this mailer. In this case, it is [IPC], which means this mail is delivered by sendmail. Other mailer definitions, such as local, have the full path of some external program in the field.
- F=mDFMuXThe F argument defines the sendmail flags for this mailer. Other than knowing that these are mailer flags, the meaning of each individual mailer flag is of little interest because the flags are correctly set by the m4 macro that builds the mailer entry. In this example, m says that this mailer can send to multiple recipients at once; DFM says that Date, From, and Message-ID headers are needed; u says that uppercase should be preserved in hostnames and usernames; and X says that message lines beginning with a dot should have an extra dot prepended.
- S=EnvFromSMTP/HdrFromSMTP The S argument defines the S rulesets illustrated in the rulesets figure (previous section). The rulesets can be different for every mailer, allowing different mailers to process e-mail addresses differently. In this case, the sender address in the mail "envelope" is processed through ruleset EnvFromSMTP, also known as ruleset 11, and the sender address in the message is processed through ruleset HdrFromSMTP, also known as ruleset 31. (You'll see more on this later when a sendmail configuration is tested.)
- R=EnvToSMTP The R argument defines the R ruleset shown in rulesets figure . This value can be different for every mailer to allow each mailer to handle addresses differently. The sample mailer processes all recipient addresses through ruleset EnvToSMTP, also known as ruleset 21. Only one ruleset is used for the R argument with the smtp mailer; however, it is possible to specify two different rulesets, one for envelope processing and one for header processing, in exactly the same way as two rulesets were defined for the S argument.
- E=\r\n The E argument defines how individual lines in a message are terminated. In this case, lines are terminated with a carriage return and a line feed.
- L=990 The L argument defines the maximum line length for this mailer. This mailer can handle messages that contain individual lines up to 990 bytes long.
- T=DNS/RFC822/SMTP The T argument defines the MIME types for messages handled by this mailer. This mailer uses DNS for hostnames, RFC822 e-mail addresses, and SMTP error codes.
- A=TPC $h The A argument defines the command used to execute the mailer. In this case, the argument refers to an internal sendmail process. (Note that TCP and IPC can be used interchangeably.) In other cases (the local mailer is a good example), the A argument is clearly a command line.
The mailer definitions that come with your Linux system will include local, prog and the SMTP mailers. These are the correct mailer definitions to run sendmail in a TCP/IP network environment.