A default sendmail.cf file will be installed in
/etc. The default configuration should work for
most SMTP-only sites. It will not work for UUCP
(UNIX to UNIX Copy) sites; you will need to generate a new
sendmail.cf if you must use UUCP mail transfers.
 | Note |
|---|
| | Although SMTP servers are supported automatically,
IMAP (Internet Message Access Protocol) servers
are not. If your ISP uses an IMAP server rather than an SMTP sever,
you must install the IMAP package. Without it, your system won't know
how to pass information to the IMAP server or retrieve your mail.
|
If you need to generate a new
/etc/sendmail.cf file to configure
Sendmail, you should utilize the
m4 macro processor. If you ever edit the
/etc/mail/sendmail.mc to add functionality to
Sendmail, backup your current
/etc/sendmail.cf file, generate a new one by
executing the m4 /etc/mail/sendmail.mc >
/etc/sendmail.cf command, and add any previous changes from
the /etc/sendmail.cf you backed up to the new
/etc/sendmail.cf file. After creating a new
/etc/sendmail.cf, you must restart
Sendmail to make it take effect. The easiest
way to do this is to type the /sbin/service sendmail
restart command as root.
By default, the m4 macro processor
is installed with Sendmail. The
m4 macro processor is included with the
sendmail-cf package, which is installed in
/usr/lib/sendmail-cf.
You should consult the /usr/lib/sendmail-cf/README file
before you edit any of the files in the directories under the
/usr/lib/sendmail-cf directory, as they can affect
how future /etc/sendmail.cf files are configured.
 | Warning! |
|---|
| | Do not use Linuxconf to configure Sendmail!
The Linuxconf module
mailconf, designed to make editing
/etc/sendmail.cf easier, is broken and contains
out-of-date information about rule sets used in Sendmail
configuration.
|
One common Sendmail configuration is to have
a single machine act as a mail gateway for all the machines on your
network. For instance, a company may want to have a machine called
mail.bigcorp.com that does all our mail. On that
machine, we simply need to add the names of machines for which
mail.bigcorp.com will handle mail to
/etc/mail/local-host-names. Here is an example:
# sendmail.cw - include all aliases for your machine
# here.
torgo.bigcorp.com
poodle.bigcorp.com
devel.bigcorp.com |
Then on the other machines, torgo,
poodle, and devel, we need to
edit /etc/sendmail.cf to "masquerade" as
mail.bigcorp.com when sending mail and to forward
any local mail processing to bigcorp.com. Find the
DH and DM lines in
/etc/sendmail.cf and edit them as such:
# who I send unqualified names to
# (null means deliver locally)
DRmail.bigcorp.com
# who gets all local email traffic
DHmail.bigcorp.com
# who I masquerade as (null for no masquerading)
DMbigcorp.com |
With this type of configuration, all mail sent will appear as if it were
sent from bigcorp.com, and any mail sent to
torgo.bigcorp.com or the other hosts will be
delivered to mail.bigcorp.com.
Please be aware that if you configure your system to masquerade as
another, any email sent from your system to your system will be sent to
the machine you are masquerading as. For example, in the above
illustration, log files that are periodically sent to
<root@poodle.bigcorp.com> by the cron daemon would be
sent to <root@mail.bigcorp.com>.