From eugen@grosbein.pp.ru  Sun Jul  1 18:45:59 2007
Return-Path: <eugen@grosbein.pp.ru>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 6C04916A400
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  1 Jul 2007 18:45:59 +0000 (UTC)
	(envelope-from eugen@grosbein.pp.ru)
Received: from grosbein.pp.ru (grgw.svzserv.kemerovo.su [213.184.64.166])
	by mx1.freebsd.org (Postfix) with ESMTP id C0A3113C458
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  1 Jul 2007 18:45:57 +0000 (UTC)
	(envelope-from eugen@grosbein.pp.ru)
Received: from grosbein.pp.ru (localhost [127.0.0.1])
	by grosbein.pp.ru (8.14.1/8.14.1) with ESMTP id l61IjrJY009051
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 2 Jul 2007 02:45:53 +0800 (KRAST)
	(envelope-from eugen@grosbein.pp.ru)
Received: (from root@localhost)
	by grosbein.pp.ru (8.14.1/8.14.1/Submit) id l61IjrYt009050;
	Mon, 2 Jul 2007 02:45:53 +0800 (KRAST)
	(envelope-from eugen)
Message-Id: <200707011845.l61IjrYt009050@grosbein.pp.ru>
Date: Mon, 2 Jul 2007 02:45:53 +0800 (KRAST)
From: Eugene Grosbein <eugen@grosbein.pp.ru>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch] make default mail directory for mail.local(8) configurable
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         114195
>Category:       bin
>Synopsis:       [patch] [request] make default mail directory for mail.local(8) configurable
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gshapiro
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jul 01 18:50:01 GMT 2007
>Closed-Date:    Mon Mar 16 16:28:17 UTC 2009
>Last-Modified:  Mon Mar 16 16:28:17 UTC 2009
>Originator:     Eugene Grosbein
>Release:        FreeBSD 6.2-STABLE i386
>Organization:
Svyaz Service JSC
>Environment:
System: FreeBSD grosbein.pp.ru 6.2-STABLE FreeBSD 6.2-STABLE #0: Sat Jun 9 01:20:24 KRAST 2007 eu@grosbein.pp.ru:/usr/obj/usr/src/sys/DADV i386

>Description:
	mail.local(8) is built without '-p' option (that allows to change
	"/var/mail" to another path) for tradidional mailbox layout.

	It is built with '-p' only for HASHSPOOL layout type
	(see mail.local(8) man page). This restriction is causeless.

>How-To-Repeat:
	Try to use stock mail.local with option '-p' to store
	mail for distinct e-mail domain to distinct directory,
	it won't

>Fix:

	This trivial patch compiles support for '-p'
	independently of compile time option HASHSPOOL
	and corrects manual page.

--- contrib/sendmail/mail.local/mail.local.c.orig	Thu Apr 12 11:11:39 2007
+++ contrib/sendmail/mail.local/mail.local.c	Mon Jul  2 02:27:17 2007
@@ -231,7 +231,7 @@
 #if HASHSPOOL
 	while ((ch = getopt(argc, argv, "7BbdD:f:h:r:lH:p:ns")) != -1)
 #else /* HASHSPOOL */
-	while ((ch = getopt(argc, argv, "7BbdD:f:h:r:ls")) != -1)
+	while ((ch = getopt(argc, argv, "7BbdD:f:h:r:p:ls")) != -1)
 #endif /* HASHSPOOL */
 	{
 		switch(ch)
@@ -283,6 +283,20 @@
 			nofsync++;
 			break;
 
+		  case 'p':
+			if (optarg == NULL || *optarg == '\0')
+			{
+				mailerr(NULL, "-p: missing spool path");
+				usage();
+			}
+			if (sm_strlcpy(SpoolPath, optarg, sizeof(SpoolPath)) >=
+			    sizeof(SpoolPath))
+			{
+				mailerr(NULL, "-p: invalid spool path");
+				usage();
+			}
+			break;
+
 #if HASHSPOOL
 		  case 'H':
 			if (optarg == NULL || *optarg == '\0')
@@ -315,20 +329,6 @@
 			if ((HashDepth <= 0) || ((HashDepth * 2) >= MAXPATHLEN))
 			{
 				mailerr(NULL, "-H: invalid hash depth");
-				usage();
-			}
-			break;
-
-		  case 'p':
-			if (optarg == NULL || *optarg == '\0')
-			{
-				mailerr(NULL, "-p: missing spool path");
-				usage();
-			}
-			if (sm_strlcpy(SpoolPath, optarg, sizeof(SpoolPath)) >=
-			    sizeof(SpoolPath))
-			{
-				mailerr(NULL, "-p: invalid spool path");
 				usage();
 			}
 			break;
--- contrib/sendmail/mail.local/mail.local.8.orig	Mon Jul  2 02:29:31 2007
+++ contrib/sendmail/mail.local/mail.local.8	Mon Jul  2 02:30:36 2007
@@ -76,6 +76,9 @@
 .BI \-h " filename"
 Store incoming mail in \fIfilename\fR in the user's home directory instead
 of a system mail spool directory.
+.TP
+.BI \-p " path"
+Specify an alternate mail spool path.
 .PP
 The next options are only available if
 .B mail.local
@@ -92,9 +95,6 @@
 .BI \-H " u2"
 selects user name hashing with a hash depth of 2.
 Note: there must be no space between the hash type and the depth.
-.TP
-.BI \-p " path"
-Specify an alternate mail spool path.
 .TP
 .BI \-n
 Specify that the domain part of recipient addresses in LMTP mode


Eugene Grosbein
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->gshapiro 
Responsible-Changed-By: maxim 
Responsible-Changed-When: Sat Jan 12 19:46:00 UTC 2008 
Responsible-Changed-Why:  
Gregory, 

could you please take a look at this PR?  The suggestion sounds 
reasonable.  Thanks in advance. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=114195 
State-Changed-From-To: open->patched 
State-Changed-By: gshapiro 
State-Changed-When: Sun Feb 17 05:02:00 UTC 2008 
State-Changed-Why:  
I've added your idea as an FFR to mail.local in the upcoming 8.14.2 
release.  I'll leave this ticket in the patched state until 8.14.2 is 
released and imported into FreeBSD. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=114195 
State-Changed-From-To: patched->closed 
State-Changed-By: gshapiro 
State-Changed-When: Mon Mar 16 16:26:47 UTC 2009 
State-Changed-Why:  
8.14.2 was imported a while back but I forgot to update this ticket. 
You can enable the requested functionality by adding this to your 
/etc/make.conf and rebuilding mail.local: 

SENDMAIL_CFLAGS+=_FFR_SPOOL_PATH 

It will become part of the base OS installation after sendmail 8.15 is 
released. 


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