- 论坛徽章:
- 1
|
Reference http://www.deer-run.com/~hal/sysadmin/sendmail.html
Local Sendmail Configuration
We still need to make sure that each system has an appropriate Sendmail configuration file, however, so that users and processes on the machine can send out email from the host. Generally our email "client" type machines will want to simply relay all outgoing email to some local mail server for processing and routing. This is exactly what the standard "nullclient" configuration is designed to do:
include(`cf/m4/cf.m4')
define(`__OSTYPE__',`')
FEATURE(`nullclient', `mailhost')
The second argument to FEATURE(`nullclient') is the name (or IP address) of the mail server outgoing email should be relayed to. Obviously, you will need to change this hostname to something appropriate for your site.
The other two lines in this configuration also deserve a little explanation. The cf.m4 file contains all of the macro definitions which expand items like FEATURE(`nullclient') into the actual Sendmail configuration language that is used in the sendmail.cf file. The cf.m4 file is found in the Sendmail source distribution under the cf/m4 subdirectory-- be sure to replace the pathname in the first line above with the correct pathname to the cf.m4 file on your system.
The second line defines the OSTYPE macro to be the empty string. Normally, OSTYPE would be set to a string that indicates what OS platform the config file would be used on, and controls various OS-specific parameters (file locations, command line arguments, et al). However, for a simple nullclient configuration, none of that OS-specific information is important so we can just generate a completely generic configuration file that will work on any OS platform simply by setting OSTYPE to null.
In order to generate a Sendmail configuration file for your system from the above macros, simply type the above three lines into a text file taking care to preserve the balanced left and right quotes and making the appropriate changes on the first and third lines for your local environment. Assuming the new file name is nullclient.mc, you can generate a sendmail.cf file with the following command:
m4 nullclient.mc > sendmail.cf
Install the resulting sendmail.cf file in the appropriate location on your system (usually /etc/mail/sendmail.cf, but sometimes just /etc/sendmail.cf). |
|