From vadim@netadmin2.ic.tsu.ru  Thu Jan 16 09:24:53 2003
Return-Path: <vadim@netadmin2.ic.tsu.ru>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 09CEB37B401
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 16 Jan 2003 09:24:53 -0800 (PST)
Received: from netadmin2.ic.tsu.ru (netadmin2.ic.tsu.ru [212.192.97.145])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 083E343F3F
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 16 Jan 2003 09:24:50 -0800 (PST)
	(envelope-from vadim@netadmin2.ic.tsu.ru)
Received: from netadmin2.ic.tsu.ru (localhost.ic.tsu.ru [127.0.0.1])
	by netadmin2.ic.tsu.ru (8.12.7/8.12.7/vadim) with ESMTP id h0GHOki0042118;
	Thu, 16 Jan 2003 23:24:47 +0600 (TSK)
	(envelope-from vadim@netadmin2.ic.tsu.ru)
Received: (from vadim@localhost)
	by netadmin2.ic.tsu.ru (8.12.7/8.12.7/Submit) id h0GHOktE042117;
	Thu, 16 Jan 2003 23:24:46 +0600 (TSK)
	(envelope-from vadim)
Message-Id: <200301161724.h0GHOktE042117@netadmin2.ic.tsu.ru>
Date: Thu, 16 Jan 2003 23:24:46 +0600 (TSK)
From: Vadim Ostranitsyn <vadim@alpha.tsu.ru>
Reply-To: Vadim Ostranitsyn <vadim@alpha.tsu.ru>
To: FreeBSD-gnats-submit@freebsd.org
Cc: vadim@alpha.tsu.ru
Subject: [PATCH] First look at /usr/local/share/sendmail/cf for sendmail.cf generation.
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         47147
>Category:       conf
>Synopsis:       [PATCH] First look at /usr/local/share/sendmail/cf for sendmail.cf generation.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gshapiro
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan 16 09:30:02 PST 2003
>Closed-Date:    Sat Feb 08 13:20:49 PST 2003
>Last-Modified:  Sat Feb 08 13:20:49 PST 2003
>Originator:     Vadim Ostranitsyn <vadim@alpha.tsu.ru>
>Release:        FreeBSD 4.7-RC i386
>Organization:
Tomsk State University
>Environment:
System: FreeBSD netadmin2.ic.tsu.ru 4.7-RC FreeBSD 4.7-RC #0: Thu Sep 26 17:23:52 TSD 2002 root@netadmin2.ic.tsu.ru:/export/WORLD/obj/.amd_mnt/disk4/private/FreeBSD/stable4/src/sys/NetAdmin2 i386

>Description:
	When you install sendmail from ports, your config still be generated
from config data at /usr/share/sendmail/cf. We need to generate config
from data at /usr/local/share/sendmail/cf.

>How-To-Repeat:
	Install sendmail from ports. Then go to /etc/mail directory, change
your "hostname".mc and run make.

>Fix:
	Just apply a patch below.

--- Makefile.diff begins here ---
--- Makefile.orig	Thu Sep 26 17:39:38 2002
+++ Makefile	Thu Jan 16 22:02:18 2003
@@ -83,7 +83,9 @@
 # This is the directory where the sendmail configuration files are
 # located.
 #
-.if exists(/usr/share/sendmail/cf)
+.if exists(/usr/local/share/sendmail/cf)
+SENDMAIL_CF_DIR?=	/usr/local/share/sendmail/cf
+.elif exists(/usr/share/sendmail/cf)
 SENDMAIL_CF_DIR?=	/usr/share/sendmail/cf
 .elif exists(/usr/src/contrib/sendmail/cf)
 SENDMAIL_CF_DIR?=	/usr/src/contrib/sendmail/cf
--- Makefile.diff ends here ---


>Release-Note:
>Audit-Trail:

From: Giorgos Keramidas <keramida@freebsd.org>
To: Vadim Ostranitsyn <vadim@alpha.tsu.ru>
Cc: bug-followup@freebsd.org
Subject: Re: conf/47147: [PATCH] First look at /usr/local/share/sendmail/cf
 for sendmail.cf generation.
Date: Sun, 19 Jan 2003 00:51:36 +0200 (EET)

 On 2003-01-16 23:24, Vadim Ostranitsyn wrote:
 > --- Makefile.diff begins here ---
 > --- Makefile.orig	Thu Sep 26 17:39:38 2002
 > +++ Makefile	Thu Jan 16 22:02:18 2003
 > @@ -83,7 +83,9 @@
 >  # This is the directory where the sendmail configuration files are
 >  # located.
 >  #
 > -.if exists(/usr/share/sendmail/cf)
 > +.if exists(/usr/local/share/sendmail/cf)
 > +SENDMAIL_CF_DIR?=	/usr/local/share/sendmail/cf
 > +.elif exists(/usr/share/sendmail/cf)
 >  SENDMAIL_CF_DIR?=	/usr/share/sendmail/cf
 >  .elif exists(/usr/src/contrib/sendmail/cf)
 >  SENDMAIL_CF_DIR?=	/usr/src/contrib/sendmail/cf
 > --- Makefile.diff ends here ---
 
 A better check would probably be to look for a file that really *has*
 to be there, or to avoid the conditional setting of SENDMAIL_CF_DIR
 with /usr/local subdirs.  It is possible that ports are not installed
 in subdirectories of /usr/local but under /foo.  Since it's not
 possible to know everything about the local setup, the only safe way
 of using SENDMAIL_CF_DIR in /etc/mail with the Makefile is to use:
 
 	# cd /etc/mail
 	# make SENDMAIL_CF_DIR=/real/path/to/sendmail/cf
 
 The conditional assignments of SENDMAIL_CF_DIR in Makefile will work
 as expected, and you can use any path you wish for your CF_DIR.  To
 depend on the existence of the /usr/local/share/sendmail/cf directory
 might even prove to be unsafe and/or break things, on a system that
 just happens to have an old, empty directory with that name.
Responsible-Changed-From-To: freebsd-bugs->gshapiro 
Responsible-Changed-By: keramida 
Responsible-Changed-When: Sun Jan 26 17:26:03 PST 2003 
Responsible-Changed-Why:  
Gregory is our Sendmail guru, and can handle this. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=47147 
State-Changed-From-To: open->closed 
State-Changed-By: gshapiro 
State-Changed-When: Sat Feb 8 13:18:50 PST 2003 
State-Changed-Why:  
The SENDMAIL_CF_DIR variable is a variable which can be set in /etc/make.conf 
for this very reason.  If you want to use a non-standard (i.e., not in the 
base OS) directory, set it in /etc/make.conf.  I prefer not to have 
base-OS Makefile's looking in non-standard locations. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=47147 
>Unformatted:
