From nobody@FreeBSD.org  Mon Apr  2 12:54:41 2001
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id 0B81637B725
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  2 Apr 2001 12:54:41 -0700 (PDT)
	(envelope-from nobody@FreeBSD.org)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.1/8.11.1) id f32JsfU17925;
	Mon, 2 Apr 2001 12:54:41 -0700 (PDT)
	(envelope-from nobody)
Message-Id: <200104021954.f32JsfU17925@freefall.freebsd.org>
Date: Mon, 2 Apr 2001 12:54:41 -0700 (PDT)
From: brett@lariat.org
To: freebsd-gnats-submit@FreeBSD.org
Subject: Improvement to Makefile in /etc/mail allows library of mc's for different hosts
X-Send-Pr-Version: www-1.0

>Number:         26299
>Category:       misc
>Synopsis:       Improvement to Makefile in /etc/mail allows library of mc's for different hosts
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    gshapiro
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Apr 02 13:00:01 PDT 2001
>Closed-Date:    Thu May 24 13:52:27 PDT 2001
>Last-Modified:  Thu May 24 13:52:48 PDT 2001
>Originator:     Brett Glass
>Release:        4.3-RC2
>Organization:
>Environment:
>Description:
The Makefile in /etc/mail is a great improvement over past releases.
However, it doesn't make it easy to keep a set of different .mc
files on hand for different hosts! I've added a bit of code to
the Makefile that looks at the output of `hostname` and uses
`hostname`.mc as the .mc file from which sendmail.cf is built.
This lets an administrator take a library of .mc files from host
to host; the correct one is installed according to the host name.
>How-To-Repeat:

>Fix:
The code I use is as follows (replacing the line that says 

SENDMAIL_MC?=           freebsd.mc

in the original):

# If the environment variable SENDMAIL_MC is defined, build cf from
# that. Otherwise, try to build `hostname`.mc. If there's no such
# file, fall back to freebsd.mc.

.ifndef SENDMAIL_MC
SENDMAIL_MC!=           hostname
SENDMAIL_MC:=           ${SENDMAIL_MC}.mc

.if !exists(${SENDMAIL_MC})
SENDMAIL_MC=            freebsd.mc
.endif
.endif

(and then continuing with

INSTALL_CF=             ${SENDMAIL_MC:R}.cf

etc.)

etc.
>Release-Note:
>Audit-Trail:

From: Brett Glass <brett@lariat.org>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: misc/26299: Improvement to Makefile in /etc/mail allows
  library of mc's for different hosts
Date: Mon, 02 Apr 2001 14:28:09 -0600

 One additional note: A big advantage of having this code in place is that 
 an administrator who desides to modify his sendmail.cf can copy 
 freebsd.mc to foo.bar.com.mc and then begin editing THAT instead of the 
 original. The original freebsd.mc can stay around as an example and/or as 
 a fallback.
 
 A note advising the administrator that this can be done (that is, copy 
 freebsd.mc to foo.bar.com.mc and then modify it) should be added to the 
 README if the code is inserted.
 
 --Brett
 
State-Changed-From-To: open->analyzed 
State-Changed-By: gshapiro 
State-Changed-When: Mon Apr 2 20:25:25 PDT 2001 
State-Changed-Why:  
Why couldn't this be done with a /etc/make.conf entry?  I'm not inclined to 
go overboard with this Makefile. 


Responsible-Changed-From-To: freebsd-bugs->gshapiro 
Responsible-Changed-By: gshapiro 
Responsible-Changed-When: Mon Apr 2 20:25:25 PDT 2001 
Responsible-Changed-Why:  
Over to sendmail maintainer 

http://www.freebsd.org/cgi/query-pr.cgi?pr=26299 

From: James Housley <jim@thehousleys.net>
To: freebsd-gnats-submit@freebsd.org, brett@lariat.org
Cc:  
Subject: Re: misc/26299: Improvement to Makefile in /etc/mail allows library of 
 mc's for different hosts
Date: Tue, 03 Apr 2001 06:30:53 -0400

 Brett,
   I think your idea is a good one, but why not go all the way?  Create
 the file for the user/admin if it doesn't exist.  That way the
 instructions can be simpler, no if you don't have ... then copy ... .
 
 --- Makefile.orig       Thu Mar 29 11:03:42 2001
 +++ Makefile    Tue Apr  3 06:27:21 2001
 @@ -37,7 +37,14 @@
  # uucpdomain, virtusertable
  #
  
 -SENDMAIL_MC?=          freebsd.mc
 +.ifndef SENDMAIN_MC
 +SENDMAIL_MC!=          hostname
 +SENDMAIL_MC:=          ${SENDMAIL_MC}.mc
 +
 +${SENDMAIL_MC}:
 +       cp freebsd.mc ${SENDMAIL_MC}
 +.endif
 +
  INSTALL_CF=            ${SENDMAIL_MC:R}.cf
  
  SENDMAIL_ALIASES?=     /etc/mail/aliases
 
 -- 
 /"\   ASCII Ribbon Campaign  .
 \ / - NO HTML/RTF in e-mail  .
  X  - NO Word docs in e-mail .
 / \ -----------------------------------------------------------------
 jeh@FreeBSD.org      http://www.FreeBSD.org     The Power to Serve
 jim@TheHousleys.Net  http://www.TheHousleys.net
 ---------------------------------------------------------------------
 microsoft: "where do you want to go today?"
 linux:     "where do you want to go tomorrow?"
 BSD:       "are you guys coming, or what?"

From: Brett Glass <brett@lariat.org>
To: jim@thehousleys.net, freebsd-gnats-submit@freebsd.org
Cc:  
Subject: Re: misc/26299: Improvement to Makefile in /etc/mail allows
  library of  mc's for different hosts
Date: Tue, 03 Apr 2001 11:23:13 -0600

 James:
 
 Interesting idea. The only catch is that you usually want to 
 make edit the copy BEFORE you build. This wouldn't create the
 copy until you ran make.
 
 --Brett
 
 At 04:30 AM 4/3/2001, James Housley wrote:
   
 >Brett,
 >  I think your idea is a good one, but why not go all the way?  Create
 >the file for the user/admin if it doesn't exist.  That way the
 >instructions can be simpler, no if you don't have ... then copy ... .
 >
 >--- Makefile.orig       Thu Mar 29 11:03:42 2001
 >+++ Makefile    Tue Apr  3 06:27:21 2001
 >@@ -37,7 +37,14 @@
 > # uucpdomain, virtusertable
 > #
 > 
 >-SENDMAIL_MC?=          freebsd.mc
 >+.ifndef SENDMAIN_MC
 >+SENDMAIL_MC!=          hostname
 >+SENDMAIL_MC:=          ${SENDMAIL_MC}.mc
 >+
 >+${SENDMAIL_MC}:
 >+       cp freebsd.mc ${SENDMAIL_MC}
 >+.endif
 >+
 > INSTALL_CF=            ${SENDMAIL_MC:R}.cf
 > 
 > SENDMAIL_ALIASES?=     /etc/mail/aliases
 >
 >-- 
 >/"\   ASCII Ribbon Campaign  .
 >\ / - NO HTML/RTF in e-mail  .
 > X  - NO Word docs in e-mail .
 >/ \ -----------------------------------------------------------------
 >jeh@FreeBSD.org      http://www.FreeBSD.org     The Power to Serve
 >jim@TheHousleys.Net  http://www.TheHousleys.net
 >---------------------------------------------------------------------
 >microsoft: "where do you want to go today?"
 >linux:     "where do you want to go tomorrow?"
 >BSD:       "are you guys coming, or what?"
 
State-Changed-From-To: analyzed->feedback 
State-Changed-By: gshapiro 
State-Changed-When: Tue May 15 09:01:48 PDT 2001 
State-Changed-Why:  
The change has been committed to the HEAD (-CURRENT).  It will be MFC'ed to 
RELENG_4 (-STABLE) in 8 days, at which time this PR will be closed. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=26299 
State-Changed-From-To: feedback->closed 
State-Changed-By: gshapiro 
State-Changed-When: Thu May 24 13:52:27 PDT 2001 
State-Changed-Why:  
The changes have been committed to -STABLE (RELENG_4). 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=26299 
>Unformatted:
