The more commonly used transports available to you using the
This transport includes both the local delivery agent used to send mail into the mailbox of users on this machine and the
This transport implements the Simple Mail Transport Protocol (SMTP), which is the most common means of transporting mail on the Internet. When you include this transport, four mailers are configured: smtp (basic SMTP), esmtp (Extended SMTP), smtp8 (8bit binary clean SMTP), and relay (specifically designed for gatewaying messages between hosts).
The
This mailer allows you to send mail messages directly into Usenet style news networks. Any local message directed to an address of
If you have the HylaFAX software installed, this mailer will allow you to direct email to it so that you may build an email-fax gateway. This feature is experimental at the time of writing and more information may be obtained from http://www.vix.com/hylafax/.
There are others, such as the
Configure mail routing for local hosts
The Virtual Brewery's configuration is probably more complex than most sites require. Most sites today would use the SMTP transport only and do not have to deal with UUCP at all. In our configuration we've configured a 'smart host' that is used to handle all outgoing mail. Since we are using the SMTP transport on our local network we must tell sendmail that it is not to send local mail via the smart host. The LOCAL_NET_CONFIG macro allows you to insert sendmail rules directly into the output
Generating the sendmail.cf File
When you have completed editing your m4 configuration file, you must process it to produce the
# cd /etc/mail
# m4 /usr/share/sendmail.cf/m4/cf.m4 vstout.uucpsmtp.mc ›sendmail.cf
This command invokes the m4 macro processor, supplying it the name of two macro definition files to process. m4 processes the files in the order given. The first file is a standard sendmail macro template supplied with the sendmail source package, the second, of course, is the file containing our own macro definitions. The output of the command is directed to the
You may now start sendmail with the new configuration.
Interpreting and Writing Rewrite Rules
Arguably the most powerful feature of sendmail is the rewrite rule. Rewrite rules are used by sendmail to determine how to process a received mail message. sendmail passes the addresses from the
Each rule has a lefthand side and a righthand side, separated by at least one tab character. When sendmail is processing mail it scans through the rewriting rules looking for a match on the lefthand side. If an address matches the lefthand side of a rewrite rule, the address is replaced by the righthand side and processed again.
sendmail.cf R and S Commands
In the
The rules themselves appear in commands coded as R. As each R command is read, it is added to the current ruleset.
If you're dealing only with the
A sendmail ruleset therefore looks like:
S
R
R
Some Useful Macro Definitions
sendmail uses a number of standard macro definitions internally. The most useful of these in writing rulesets are: