Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Jul 2008 02:20:11 GMT
From:      Sahil Tandon <sahil@tandon.net>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/125133: [PATCH] mail/postfix - default data_directory parameter in mail_params.h should be /var/db/postfix
Message-ID:  <200807010220.m612KBXP013063@www.freebsd.org>
Resent-Message-ID: <200807010230.m612U24J091490@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         125133
>Category:       ports
>Synopsis:       [PATCH] mail/postfix - default data_directory parameter in mail_params.h should be /var/db/postfix
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jul 01 02:30:02 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Sahil Tandon
>Release:        FreeBSD 7.0-RELEASE
>Organization:
>Environment:
FreeBSD aegis.hamla.org 7.0-RELEASE FreeBSD 7.0-RELEASE #0: Sun Feb 24 19:59:52 UTC 2008     root@logan.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386
>Description:
If data_directory is not set in main.cf and one is upgrading to a new postfix installation (2.5.x or later) that utilizes this parameter, things like TLS will break because in FreeBSD, /var/lib/postfix (the data_directory default) is not reachable by the postfix user.  I think it is appropriate to change the compiled in variable to /var/db/postfix.  A previous PR addressed changing this parameter in the default main.cf, but this does not help with people who have existing main.cf files which do not contain a data_directory parameter (as this was introduced in 2.5).
>How-To-Repeat:
# cd /usr/ports/mail/postfix && make install clean

.. and then

# postconf -d | grep data_directory
data_directory = /var/lib/postfix
tls_random_exchange_name = ${data_directory}/prng_exch

>Fix:
Apply the attached patch.  I followed http://sce-tindy.tecnik93.com/FreeBSD/How-to-submit-a-diff.txt in order to grab the port from cvs and patch against the existing patch for src/global/mail_params.h.  Do let me know if I should just submit a direct patch against mail_params.h itself.

Patch attached with submission follows:

Index: files/patch-src::global::mail_params.h
===================================================================
RCS file: /home/ncvs/ports/mail/postfix/files/patch-src::global::mail_params.h,v
retrieving revision 1.1
diff -u -r1.1 patch-src::global::mail_params.h
--- files/patch-src::global::mail_params.h	19 Mar 2005 23:17:54 -0000	1.1
+++ files/patch-src::global::mail_params.h	1 Jul 2008 02:06:24 -0000
@@ -1,6 +1,6 @@
---- src/global/mail_params.h.orig	Fri Feb 11 21:53:21 2005
-+++ src/global/mail_params.h	Sat Mar  5 11:53:42 2005
-@@ -64,7 +64,7 @@
+--- src/global/mail_params.h.orig	Mon Jun 30 18:57:48 2008
++++ src/global/mail_params.h	Mon Jun 30 19:00:05 2008
+@@ -67,7 +67,7 @@
  extern gid_t var_owner_gid;
  
  #define VAR_SGID_GROUP		"setgid_group"
@@ -9,7 +9,7 @@
  extern char *var_sgid_group;
  extern gid_t var_sgid_gid;
  
-@@ -221,7 +221,7 @@
+@@ -241,7 +241,7 @@
    */
  #define VAR_DAEMON_DIR		"daemon_directory"
  #ifndef DEF_DAEMON_DIR
@@ -18,12 +18,21 @@
  #endif
  extern char *var_daemon_dir;
  
-@@ -250,7 +250,7 @@
+@@ -265,7 +265,7 @@
+   */
+ #define VAR_DATA_DIR		"data_directory"
+ #ifndef DEF_DATA_DIR
+-#define DEF_DATA_DIR		"/var/lib/postfix"
++#define DEF_DATA_DIR		"/var/db/postfix"
+ #endif
+ extern char *var_data_dir;
+ 
+@@ -279,7 +279,7 @@
    */
  #define VAR_CONFIG_DIR		"config_directory"
  #ifndef DEF_CONFIG_DIR
 -#define DEF_CONFIG_DIR		"/etc/postfix"
-+#define DEF_CONFIG_DIR		"!!PREFIX!!/etc/postfix"
++#define DEF_CONFIG_DIR		"!!PREFIX!!/etc/postfix"	
  #endif
  extern char *var_config_dir;
  


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200807010220.m612KBXP013063>