The following document answers both of your questions, so I won't restate them.
Newsgroups: comp.os.linux.misc,comp.os.linux.networking
Subject: MINI-HOWTO: Building and Installing sendmail 8.8.x (was Re: security breach!)
Followup-To:
X-Preferred-Operating-System: Linux
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
sendmail-8.8.x with:
patch -p0 < sendmail.diff
Change into the src directory and execute
./makesendmail
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
appropriate documentation.
Change into the cf/cf directory and create a new file, generic-linux2.mc:
divert(-1)
divert(0)dnl
OSTYPE(linux)
FEATURE(nouucp)
MAILER(local)
MAILER(smtp)
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,
and execute:
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:
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. 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
this:
/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
Trying 127.0.0.1...
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
helo loopback
mail from: jgotts
250 jgotts... Sender ok
rcpt to: jgotts
250 jgotts... Recipient ok
data
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)
-O= -O
+O= -O3
# 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
+DBMDEF= -DNEWDB
# environment definitions (e.g., -D_AIX3)
-ENVDEF=
+ENVDEF= -DTCPWRAPPERS
# see also conf.h for additional compilation flags
# include directories
-INCDIRS=-I/usr/local/include
+INCDIRS=
# library directories
-LIBDIRS=-L/usr/local/lib
+LIBDIRS=
# 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)
${DESTDIR}/usr/bin/hoststat ${DESTDIR}/usr/bin/purgestat
INSTALL=install
BINOWN= root
-BINGRP= kmem
-BINMODE=6555
+BINGRP= mail
+BINMODE=6711
ALL= sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
--
Senior, EE/Motif Programmer/SysAdmin/Linux Hacker/Amateur Radio Callsign N8QDW