Home Index Search Links About Us
[LinuxFocus Image]
[Navegation Bar]
  News   Archives   Companies   Tips  

Building, Installing, and Configuring sendmail 8.8.x

by John E. Gotts

Attached is a patch for Makefile.Linux that turns on TCP wrappers and makes a few other other harmless modifications. (With TCP wrappers enabled you can restrict remote access to your sendmail daemon according to the hosts_access(5) man page). (1) Assuming that you've saved it as sendmail.diff, apply it from the directory below sendmail-8.8.x with:

patch -p0 

Change into the src directory and execute

sendmail should build without any problems.

Henceforth I'm going to assume that you just use TCP/IP electronic mail. UUCP support is beyond the scope of this document.

Change into the cf/cf directory and create a new file, generic-linux2.mc:
VERSIONID(`@(#)generic-linux2.mc 8.8 (Local) 11/22/97')
If you want to use masquerading, add the following two lines:

This means that all the e-mail that gets sent from your machine (except e-mail from root) will appear to have originated from the hostname that you specify. (This option is useful for people with intermittent network connections, i.e. users of SLIP and PPP, and for machines that have dynamically assigned IP addresses via BOOTP or DHCP). For sendmail versions 8.8.8 and newer, omit EXPOSED_USER(root) as it has become the default behavior.

If you want to use procmail as your local mailer (standard practice with Red Hat Linux), add:

Transform "generic-linux2.mc" into a sendmail.cf file:
m4 ../m4/cf.m4 generic-linux2.mc > obj/sendmail.cf
You might need to comment out

in obj/sendmail.cf with a # sign as it appears to disrupt incoming e-mail on newer Linux distributions.

Back up your old /etc/sendmail.cf file and install obj/sendmail.cf:
install -m 644 -o 0 -g 0 obj/sendmail.cf /etc/sendmail.cf

After you've installed your new sendmail.cf, kill the sendmail daemon, change back into the src directory, and execute:

cd obj.Linux.*.* ; make install

This will install the sendmail binary and symbolic links. You'll need to install the manual pages by hand.

If you haven't opted to use procmail, change into the main sendmail directory and type:

uudecode contrib/mail.local.linux
mv mail.local mail.local.old
tar zxvf mail.local.linux.tar.Z
cd mail.local
gcc -O3 -o mail.local mail.local.c
strip mail.local
install -m 2711 -o 0 -g mail mail.local /bin
install -m 644 -o 0 -g 0 mail.local.8 /usr/man/man8

Your /var/spool/mail directory needs to be mode 775, owned by user root and group mail. Your mail clients need to be SGID mail (mode 2711 and owned by user root and group mail).

Now you should be ready to restart your sendmail daemon. Mine is started like this:

/usr/sbin/sendmail -bd -q1h

NOTE: Red Hat starts sendmail without its full path name. This can lead to problems such as preventing you from being able to HUP sendmail to cause it to reread its configuration file. To fix this, make sure /etc/rc.d/init.d/ sendmail.init starts sendmail as /usr/sbin/sendmail (with the same arguments).

If you have an intermittent connection, you might want to start sendmail in deferred mode:

/usr/sbin/sendmail -bd -o DeliveryMode=d
on boot and invoke sendmail as:
/usr/sbin/sendmail -q

to deliver all deferred e-mail when you first connect to the network and periodically while you are connected (perhaps as a cron job).

At this point, you should test your new sendmail installation. Here's one way to do this:

% telnet localhost smtp
Connected to localhost.
Escape character is '^]'.
220  ESMTP Sendmail 8.8.8/8.8.8; Fri, 22 Nov 1997 03:21:18 -0500
helo localhost
250  Hello jgotts@localhost [], pleased to meet you
mail from: jgotts
250 jgotts... Sender ok
rcpt to: jgotts
250 jgotts... Recipient ok
354 Enter mail, end with "." on a line by itself
This is a test.
250 DAA23297 Message accepted for delivery

Also be sure to test that your e-mail clients still work and that you can still receive mail from the outside world.

(1) TCP wrapper support is broken in 8.8.8. For a patch see http://www-personal.engin.umich.edu/~jgotts/linux/sendmail-8.8.8-tcp-wrappers-patch

While you're at it, you might as well also apply: http://www-personal.engin.umich.edu/~jgotts/linux/sendmail-8.8.8-core-dump-patch

For more information:
  • Consult the sendmail manual page.

╘ 1998 John E. Gotts
This website is mantained by Miguel A Sepulveda.