The following document answers both of your questions, so I won't restate them.
Subject: MINI-HOWTO: Building and Installing sendmail 8.8.x (was Re: security breach!)
Quote:> Not that something is wrong with my setup, but it turns out that, for
> some reason, ndbm compatibility headers are not included in gdbm
> binary distribution. After getting source distribution and installing
> ndm.h, it compiles fine. I now need to figure out what is wrong with
> .cf file that I created; that all mail accepted by sendmail goes into
> some black hole rather then being delivered ...
Use libdb instead. I've attached a diff for Makefile.Linux. Assuming that
you've saved it as sendmail.diff, apply it from the parent directory of
patch -p0 < sendmail.diff
Change into the src directory and execute
sendmail should build without any problems.
I'm going to assume that your site has a fairly generic SMTP configuration.
If you want UUCP support or have other needs, you'll need to consult the
Change into the cf/cf directory and create a new file, generic-linux2.mc:
Transform this into sendmail.cf, sendmail's primary configuration file:
m4 ../m4/cf.m4 generic-linux2.mc > obj/sendmail.cf
Back up your original /etc/sendmail.cf and install obj/sendmail.cf:
cp /etc/sendmail.cf /etc/sendmail.cf.old
install -m 644 -o 0 -g 0 obj/sendmail.cf /etc/sendmail.cf
Now kill your currently running sendmail daemon, change into the src directory,
cd obj.Linux.* ; make install
This will install the sendmail binary and symbolic links. You'll need to
install the man pages separately:
install -m 644 -o 0 -g 0 aliases.5 /usr/man/man5
install -m 644 -o 0 -g 0 mailq.1 /usr/man/man1
install -m 644 -o 0 -g 0 newaliases.1 /usr/man/man1
install -m 644 -o 0 -g 0 sendmail.8 /usr/man/man8
Change into the main sendmail directory and type:
mv mail.local mail.local.old
tar zxvf mail.local.linux.tar.Z
gcc -O3 -o mail.local mail.local.c
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. Each user who receives mail on your system should have a spool
file owned by him or her and group mail with mode 660. 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
/usr/sbin/sendmail -bd -q1h
NOTE: Red Hat 3.0.3 (and quite possibly 4.0) starts sendmail without its full
path name. To fix this problem, make sure /etc/rc.d/init.d/sendmail.init
starts sendmail as /usr/sbin/sendmail (with the same arguments).
You might want to test your new sendmail installation. Here's what I did:
linux(~)% telnet localhost smtp
Connected to loopback.
Escape character is '^]'.
220 linux.reshall.umich.edu ESMTP Sendmail 8.8.5/8.8.5; Sat, 7 Dec 1996 03:21:18 -0500
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 insure that your mail clients still work!
That's all. Have fun!
--- sendmail-8.8.5-orig/src/Makefiles/Makefile.Linux Fri Sep 20 16:08:01 1996
# use O=-O (usual) or O=-g (debugging)
# define the database mechanisms available for map & alias lookups:
# The really old (V7) DBM library is no longer supported.
# See READ_ME for a description of how these flags interact.
-DBMDEF= -DNDBM -DNEWDB
# environment definitions (e.g., -D_AIX3)
# see also conf.h for additional compilation flags
# include directories
# library directories
# libraries required on your system
# you may need to add -lresolv if you've installed BIND on
# your system (see the BIND section for linux in src/READ_ME)
-LIBS= -lgdbm -ldb
+LIBS= -ldb -lwrap
# location of sendmail binary (usually /usr/sbin or /usr/lib)
ALL= sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
Senior, EE/Motif Programmer/SysAdmin/Linux Hacker/Amateur Radio Callsign N8QDW