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

*** SECOND QUESTION ***

  Has anyone got ( or know where I can find) the .mc file that RedHat
used to build the sendmail.cf file?   I got the source code RPM from
redhat, but I didn't see the m4 configuration file that they generated
the sendmail.cf 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!)


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

 
 
 

1. 4.0-RELEASE .mc file that generated stock sendmail.cf?

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

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

I already have the sendmail-8.9.3 source from ftp.sendmail.org 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 sendmail.cf to AIX 4.2 sendmail.cf

4. Client linux share is significantly < 1%

5. Web based sendmail.cf file generator for sendmail 8

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

7. Sendmail.cf build

8. S/Key?

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

10. mail sendmail sendmail.cf problems

11. RH 6.0 Linux Sendmail.cf file question/problem

12. mkdev cf generates bad sendmail.cf

13. Redhat 4.0 sendmail problem