Redhat 4.0, Sendmail 8.8.5 database problem and .cf file building

Redhat 4.0, Sendmail 8.8.5 database problem and .cf file building

Post by C. Wayne Wrigh » Thu, 06 Feb 1997 04:00:00

When compiling sendmail 8.8.5 I get:

cc -I. -O -I/usr/local/include -DNDBM -DNEWDB    -c map.c -o map.o
map.c:44: parse error before `README'
make: *** [map.o] Error 1

and line 44 in map.c says:

  ERROR README: You are running the Berkeley DB version of ndbm.h.  See
  ERROR README: the READ_ME file about tweaking Berkeley DB so it can
  ERROR README: coexist with NDBM, or delete -DNDBM from the Makefile
  ERROR README: and use -DNEWDB instead.

My question is where can I find this "Berkeley DB version of ndbm.h" so
I can compile the sendmail program.    I did get the 8.8.5 binary RPM
from redhat, and it works, but I'd still like to be able to compile it


  Has anyone got ( or know where I can find) the .mc file that RedHat
used to build the file?   I got the source code RPM from
redhat, but I didn't see the m4 configuration file that they generated
the file which was included in their binary RPM.

W. Wright


Redhat 4.0, Sendmail 8.8.5 database problem and .cf file building

Post by John Got » Tue, 11 Feb 1997 04:00:00

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!)

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


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,



Transform this into, sendmail's primary configuration file:

m4 ../m4/cf.m4 > obj/

Back up your original /etc/ and install obj/

cp /etc/ /etc/
install -m 644 -o 0 -g 0 obj/ /etc/

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

/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 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
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.

 # 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)

        ${DESTDIR}/usr/bin/hoststat ${DESTDIR}/usr/bin/purgestat
 BINOWN=        root
-BINGRP=        kmem
+BINGRP=        mail

 ALL=   sendmail aliases.0 mailq.0 newaliases.0 sendmail.0


Senior, EE/Motif Programmer/SysAdmin/Linux Hacker/Amateur Radio Callsign N8QDW


1. 4.0-RELEASE .mc file that generated stock

I want to tweak my and add some more features.  I really
don't want to reverse-engineer (so to speak) the /etc/mail/
that came with 4.0-RELEASE to get an .mc file started.

Where can I get the .mc file that generated the for 4.0-RELEASE?

I already have the sendmail-8.9.3 source from and it's
waiting to have an .mc dropped in cf/cf for munging.

Could someone just mail it to me?  If so, thanks, and the email

2. Aliases & awk 1-line pgms

3. AIX 4.1 to AIX 4.2

4. Client linux share is significantly < 1%

5. Web based file generator for sendmail 8

6. Is it possible for a client program to access kernel memory?

7. build

8. S/Key?

9. problem in unstanding sendmail/cf SMTP auth (Solaris 8 Sendmail 8.10) Please Explain

10. mail sendmail problems

11. RH 6.0 Linux file question/problem

12. mkdev cf generates bad

13. Redhat 4.0 sendmail problem