Accepting Incoming Mail

In order to accept incoming mail, sendmail must be configured to accept incoming network connections. Slackware's default sendmail configuration does this, so you shouldn't need to modify it. Red Hat, though, configures its sendmail to accept only local connections. This configuration is good for workstations that may need to send outgoing mail or send mail between local users but that shouldn't receive mail from outside systems. If you want to receive mail from other computers, though, you must modify this configuration. To do so, edit the /etc/mail/sendmail.mc file or your localized copy of it. Look for the following line, which is about halfway through the file:

DAEMON_OPTIONSCPort=smtp,Addr=127.0.0.1, Name=MTA')dnl

Comment this line out by adding the string dnl and a space to the start of the line. (Unlike most configuration files, sendmail m4 files use dnl as a comment indicator.) You can then create a new sendmail.cf file, as described in the earlier section, "Sendmail Configuration Files." Restart the server by typing killall -HUP sendmail or /etc/rc.d/init.d/sendmail restart and the server should accept connections from remote systems.

Another aspect of accepting remote connections is telling sendmail what hostnames to recognize as local. For instance, consider Figure 25.1. If smtp.pangaea.edu is the computer to which the pangaea.edu domain's MX record points, then smtp.pangaea.edu must know to accept mail addressed to [email protected]. Ordinarily, sendmail rejects messages addressed to anything but the computer's own hostname. You can change this behavior by adding any aliases for the mail server computer itself to a special configuration file. This file is called /etc/mail/local-host-names, and its use is enabled by default in Red Hat's configuration. In Slackware, you must first add a line to the sendmail m4 configuration file and create a new sendmail.cf file, as described earlier in "Sendmail Configuration Files." The line you need to add is:

FEATURE(use_cw_file)

Be sure this line appears before the two MAILER lines at the bottom of the default file. After you've rebuilt the sendmail.cf file, create or edit /etc/mail/local-host-names and add the names you want sendmail to recognize as local. For instance, you might add lines such as the following:

pangaea.edu mail.pangaea.edu

Once this task is done, the server will accept mail to these domains as local mail, even if the server's hostname doesn't bear any resemblance to these names. For instance, entering these two lines on mail.example.corn's local-host-names file will cause it to deliver mail addressed to [email protected] to any local account with a username of sue.

0 0

Post a comment