Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Nov 2006 11:38:14 -0500
From:      DAve <>
To:        FreeBSD Questions <>
Subject:   Re: Building Sendmail from ports
Message-ID:  <>
In-Reply-To: <>
References:  <>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
David Robillard wrote:
> [ ---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.

As I expected.

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

Got that from reading the make files, good to confirm.

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

I use a custom rc script already due to my split config.

> 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.
> #
> SENDMAIL_CF_DIR=/usr/local/share/sendmail/cf
> .if ${.CURDIR:M*/mail/sendmail}
> .endif
> 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.

Saw that in the Makefile.

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

Previously I didn't want to change the installed Makefile in /etc/mail, 
I likely will now.

> 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.
> dnl
> include(`/usr/share/sendmail/cf/m4/cf.m4')dnl

Excellent idea!

> That's it. If you need any help, don't hesitate to contact me.
> Have fun :)

I appreciate the heads up, thanks!


Three years now I've asked Google why they don't have a
logo change for Memorial Day. Why do they choose to do logos
for other non-international holidays, but nothing for

Maybe they forgot who made that choice possible.

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