Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Nov 2006 09:39:24 -0500
From:      "David Robillard" <>
To:        DAve <>
Cc:        FreeBSD Questions <>
Subject:   Re: Building Sendmail from ports
Message-ID:  <>

Next in thread | Raw E-Mail | Index | Archive | Help
[ ---8<--- Text has been removed! ---8<---]

> But, where will the port install my *.mc and *.cf files? This I can't
> seem to figure out. I would like to know before I hit 'make install' in
> the port dir. I would think it will install them into
> /usr/local/share/sendmail/cf, would that be correct?

Hi DAve,

When you use the mail/sendmail port, it does install files in
/usr/local/share/sendmail. Think of it as the base system's sendmail
files in /usr/share/sendmail.

Now, the .mc and .cf files are still kept in /etc/mail and not in
/usr/local/etc/mail as one could think by using a port.

Note that you will find two scripts in /usr/local/etc/rc.d when you
install the sendmail port. They are `' and
`'. But you don't need to use them. The base
system's /etc/rc.d/sendmail script handles both the base system's
sendmail and the port's sendmail.

The key for a pain free mail/sendmail ports usage is to do what you
said. That is to edit make.conf(5) and to use special make(1) targets
from the mail/sendmail's Makefile.

Briefly, here's the way I do things when I update mail/sendmail (YMMV of course)

sudo vi /etc/make.conf

# mail/sendmail port configuration.

# Do not build and install the base distribution of sendmail.

# Specify where the configuration directory is located.

.if ${.CURDIR:M*/mail/sendmail}

sudo porteasy -uv mail/sendmail
sudo porteasy -uv security/openssl
sudo porteasy -uv security/gnutls

cd /usr/ports/mail/sendmail

sudo make
# -OR if you don't want to edit make.conf(5), you can run something like this:

sudo make tls-install
sudo make install
sudo make mailer.conf
sudo make clean

Now, you might not need the exact same features of Sendmail as I do,
of course. But the `make mailer.conf' is quite important. That's going
to edit /etc/mail/mailer.conf which instructs the OS to use
/usr/local/sbin/sendmail instead of the base system's sendmail. You
don't have to change your PATH either.

Why? Because if take a look at /usr/sbin/sendmail, it's not a binary,
it's a symbolic link to `/usr/sbin/mailwrapper'. Just read the
mailwrapper(8) man page and you'll understand how things work.

> I want to make certain that when I build new and
> the correct files are used by m4. Currently I run the
> following when making changes to my *.mc files
> /usr/bin/m4 -D_CF_DIR_=/usr/share/sendmail/cf/
> /usr/share/sendmail/cf/m4/cf.m4 >

Take a look at the /etc/mail/Makefile and you'll see that it can
determine your _CF_DIR_. But it takes a wrong decision. It uses either
/usr/share/sendmail/cf or /usr/src/contrib/sendmail/cf.

To work around this, you can edit /etc/mail/Makefile or use the
following at the top of your files:

dnl include.
dnl Use the following m4 macro file.

That's it. If you need any help, don't hesitate to contact me.

Have fun :)

David Robillard
UNIX systems administrator & Oracle DBA
CISSP, RHCE & Sun Certified Security Administrator
Montreal: +1 514 966 0122

Want to link to this message? Use this URL: <>