From owner-freebsd-questions@FreeBSD.ORG Wed Nov 22 14:39:27 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 58FEF16A403 for ; Wed, 22 Nov 2006 14:39:27 +0000 (UTC) (envelope-from david.robillard@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.172]) by mx1.FreeBSD.org (Postfix) with ESMTP id 99E5643D46 for ; Wed, 22 Nov 2006 14:38:57 +0000 (GMT) (envelope-from david.robillard@gmail.com) Received: by ug-out-1314.google.com with SMTP id o2so154842uge for ; Wed, 22 Nov 2006 06:39:25 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:mime-version:content-type:content-transfer-encoding:content-disposition; b=FRUEtOPnBN0I3ybzMRGtpvHoChHMhnj87y19J9eYbVp0BC6a0zM7CLpFLzkqSV3WS50Ht2Vwiq5eVshite3Ioub8UpJ3KfyNy8hoyiKdEX4fPWYiXvRe6XplFljufIoNrerXNiziOFSqJzaCwEQtBjZPeo19XH0eyBVZosuBE3k= Received: by 10.67.106.3 with SMTP id i3mr3096865ugm.1164206364899; Wed, 22 Nov 2006 06:39:24 -0800 (PST) Received: by 10.67.106.17 with HTTP; Wed, 22 Nov 2006 06:39:24 -0800 (PST) Message-ID: <226ae0c60611220639j1dae5331qeadfc60130c75aac@mail.gmail.com> Date: Wed, 22 Nov 2006 09:39:24 -0500 From: "David Robillard" To: DAve MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Cc: FreeBSD Questions Subject: Re: Building Sendmail from ports X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Nov 2006 14:39:27 -0000 [ ---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 `sendmail.sh.sample' and `sm-client.sh.sample'. 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. # NO_SENDMAIL= TRUE # Specify where the configuration directory is located. # SENDMAIL_CF_DIR=/usr/local/share/sendmail/cf .if ${.CURDIR:M*/mail/sendmail} SENDMAIL_WITHOUT_IPV6=yes \ SENDMAIL_WITHOUT_NIS=yes \ SENDMAIL_WITH_TLS=yes \ SENDMAIL_WITH_SMTPS=yes \ SENDMAIL_WITH_LDAP=yes \ SENDMAIL_WITH_BERKELEYDB_VER=42 \ SENDMAIL_WITH_SOCKETMAP=yes \ SENDMAIL_WITH_PICKY_HELO_CHECK=yes \ SENDMAIL_WITH_SHARED_MILTER=yes .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 -DSENDMAIL_WITHOUT_IPV6 -DSENDMAIL_WITHOUT_NIS -DSENDMAIL_WITH_TLS -DSENDMAIL_WITH_SMTPS \ -DSENDMAIL_WITH_BERKELEYDB_VER=42 -DSENDMAIL_WITH_SOCKETMAP -DSENDMAIL_WITH_PICKY_HELO_CHECK -DSENDMAIL_WITH_SHARED_MILTER 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 sendmail.in.cf and > sendmail.out.cf 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 sendmail.in.mc > sendmail.in.cf 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 sendmail.mc files: dnl include. dnl Use the following m4 macro file. dnl include(`/usr/share/sendmail/cf/m4/cf.m4')dnl That's it. If you need any help, don't hesitate to contact me. Have fun :) David -- David Robillard UNIX systems administrator & Oracle DBA CISSP, RHCE & Sun Certified Security Administrator Montreal: +1 514 966 0122