From owner-freebsd-bugs@FreeBSD.ORG Sun Jul 1 18:50:02 2007 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2A8DF16A41F for ; Sun, 1 Jul 2007 18:50:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 0B18C13C489 for ; Sun, 1 Jul 2007 18:50:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l61Io1QZ080542 for ; Sun, 1 Jul 2007 18:50:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l61Io1He080541; Sun, 1 Jul 2007 18:50:01 GMT (envelope-from gnats) Resent-Date: Sun, 1 Jul 2007 18:50:01 GMT Resent-Message-Id: <200707011850.l61Io1He080541@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Eugene Grosbein Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6C04916A400 for ; 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 ; 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 ; 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 To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: bin/114195: [patch] make default mail directory for mail.local(8) configurable X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jul 2007 18:50:02 -0000 >Number: 114195 >Category: bin >Synopsis: [patch] make default mail directory for mail.local(8) configurable >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Jul 01 18:50:01 GMT 2007 >Closed-Date: >Last-Modified: >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: >Unformatted: