Sendmail

In this section we'll look at how we can configure sendmail to enable it to be used for mail delivery on our system. This has traditionally been a very awkward task to perform. The main reason for this concerns the configuration file itself, /etc/mail/sendmail.cf—it contains everything required to get the mail system functioning, but is notoriously difficult to set up.

Originally, there was only one way to create the correct sendmail.cf. This was by copying an existing (functioning) or template file, working through it, and editing it as required. Two template files (main.cf and subsidiary.cf) were, and still are, included to help with this should you still want to follow that procedure—you'll find them in /etc/mail. When the operating system is installed, the /etc/mail/sendmail.cf file is actually a copy of the subsidiary.cf template. The choice of which template file to use depends on the required operating mode of the machine. Table 20.3 shows the different modes along with the name of the correct file that the working sendmail.cf should be based on.

From this table we can see that if we are setting up a mail client or mail server, we don't have to make any changes to the system to get it working. The only machine we would need to configure would be the mail host.

Thankfully, starting from Version 8 of sendmail, this manual method has been replaced by a mechanism based on a program named m4. This is a macroprocessor that has long been associated with C and other programming languages. In fact, because of this association, it's also located in the same directory as the programming-type tools—/usr/ccs/bin. This directory isn't defined in the normal profile by default, but for our examples here, we'll assume we have updated the path to suit.

In this chapter, we'll concentrate on this newer method of configuration. So let's move on and see how it works.

Table 20.3. Mail Configuration Modes
Operating ModeExplanationConfiguration File
Mail HostThe main mail machine on the networkmain.cf
Mail ServerA system that stores mail in its mailbox directory, /var/mailsubsidiary.cf
Mail ClientA machine that uses the mail capabilities (including the mailbox area) of the mail serversubsidiary.cf
Mail GatewayA machine that handles connections between different networks or protocolsmain.cf

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset