steffen: server/postfix postfix-pipe-allow-empty-sender.patch, NONE, 1.1 Makefile, 1.10, 1.11 kolab.patch, 1.2, 1.3

cvs at intevation.de cvs at intevation.de
Tue May 31 09:43:53 CEST 2005


Author: steffen

Update of /kolabrepository/server/postfix
In directory doto:/tmp/cvs-serv31400

Modified Files:
	Makefile kolab.patch 
Added Files:
	postfix-pipe-allow-empty-sender.patch 
Log Message:
patch to make postfix pipe transport allow empty envelope sender

--- NEW FILE: postfix-pipe-allow-empty-sender.patch ---
diff -upr ../postfix-2.1.5.orig/src/pipe/pipe.c ./src/pipe/pipe.c
--- ../postfix-2.1.5.orig/src/pipe/pipe.c	2004-07-24 01:09:21.000000000 +0200
+++ ./src/pipe/pipe.c	2005-05-31 04:30:55.000000000 +0200
@@ -41,7 +41,7 @@
 /* .fi
 /*	The external command attributes are given in the \fBmaster.cf\fR
 /*	file at the end of a service definition.  The syntax is as follows:
-/* .IP "\fBflags=BDFORhqu.>\fR (optional)"
+/* .IP "\fBflags=BDFORhnqu.>\fR (optional)"
 /*	Optional message processing flags. By default, a message is
 /*	copied unchanged.
 /* .RS
@@ -68,6 +68,9 @@
 /*	Fold the command-line \fB$recipient\fR domain name and \fB$nexthop\fR
 /*	host name to lower case.
 /*	This is recommended for delivery via \fBUUCP\fR.
+/* .IP \fBn\fR
+/*      Don't rewrite empty \fB$sender\fR. The default is to rewrite empty 
+/*      \fB$sender\fR to MAILER-DAEMON.
 /* .IP \fBq\fR
 /*	Quote white space and other special characters in the command-line
 /*	\fB$sender\fR and \fB$recipient\fR address localparts (text to the
@@ -349,6 +352,7 @@
 #define PIPE_OPT_FOLD_USER	(1<<16)
 #define PIPE_OPT_FOLD_HOST	(1<<17)
 #define PIPE_OPT_QUOTE_LOCAL	(1<<18)
+#define PIPE_OPT_ALLOW_NO_SENDER (1<<19)
 
 #define PIPE_OPT_FOLD_FLAGS	(PIPE_OPT_FOLD_USER | PIPE_OPT_FOLD_HOST)
 
@@ -660,6 +664,9 @@ static void get_service_attr(PIPE_ATTR *
 		case 'h':
 		    attr->flags |= PIPE_OPT_FOLD_HOST;
 		    break;
+		case 'n':
+		    attr->flags |= PIPE_OPT_ALLOW_NO_SENDER;
+		    break;
 		case 'q':
 		    attr->flags |= PIPE_OPT_QUOTE_LOCAL;
 		    break;
@@ -835,22 +842,6 @@ static int deliver_message(DELIVER_REQUE
 	msg_info("%s: from <%s>", myname, request->sender);
 
     /*
-     * First of all, replace an empty sender address by the mailer daemon
-     * address. The resolver already fixes empty recipient addresses.
-     * 
-     * XXX Should sender and recipient be transformed into external (i.e.
-     * quoted) form? Problem is that the quoting rules are transport
-     * specific. Such information must evidently not be hard coded into
-     * Postfix, but would have to be provided in the form of lookup tables.
-     */
-    if (request->sender[0] == 0) {
-	buf = vstring_alloc(100);
-	canon_addr_internal(buf, MAIL_ADDR_MAIL_DAEMON);
-	myfree(request->sender);
-	request->sender = vstring_export(buf);
-    }
-
-    /*
      * Sanity checks. The get_service_params() and get_service_attr()
      * routines also do some sanity checks. Look up service attributes and
      * config information only once. This is safe since the information comes
@@ -866,6 +857,22 @@ static int deliver_message(DELIVER_REQUE
     }
 
     /*
+     * First of all, replace an empty sender address by the mailer daemon
+     * address. The resolver already fixes empty recipient addresses.
+     * 
+     * XXX Should sender and recipient be transformed into external (i.e.
+     * quoted) form? Problem is that the quoting rules are transport
+     * specific. Such information must evidently not be hard coded into
+     * Postfix, but would have to be provided in the form of lookup tables.
+     */
+    if ((attr.flags & PIPE_OPT_ALLOW_NO_SENDER) == 0 && request->sender[0] == 0) {
+	buf = vstring_alloc(100);
+	canon_addr_internal(buf, MAIL_ADDR_MAIL_DAEMON);
+	myfree(request->sender);
+	request->sender = vstring_export(buf);
+    }
+
+    /*
      * The D flag cannot be specified for multi-recipient deliveries.
      */
     if ((attr.flags & MAIL_COPY_DELIVERED) && (rcpt_list->len > 1)) {
Kun i ./src/pipe: pipe.c~

Index: Makefile
===================================================================
RCS file: /kolabrepository/server/postfix/Makefile,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- Makefile	19 May 2005 11:13:55 -0000	1.10
+++ Makefile	31 May 2005 07:43:51 -0000	1.11
@@ -18,6 +18,7 @@
 
 	cp $(KOLABCVSDIR)/postfix-pipe.patch $(KOLABRPMSRC)/postfix/
 	cp $(KOLABCVSDIR)/postfix-ldap-leafonly.patch $(KOLABRPMSRC)/postfix/
+	cp $(KOLABCVSDIR)/postfix-pipe-allow-empty-sender.patch $(KOLABRPMSRC)/postfix/
 	cp $(KOLABCVSDIR)/kolab.patch $(KOLABRPMSRC)/postfix/           # Patch for postfix.spec
 
 	cd $(KOLABRPMSRC)/postfix && patch < $(KOLABCVSDIR)/kolab.patch && $(RPM) -ba postfix.spec --define 'with_ldap yes' --define 'with_sasl yes' --define 'with_ssl yes'

Index: kolab.patch
===================================================================
RCS file: /kolabrepository/server/postfix/kolab.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- kolab.patch	19 May 2005 11:13:55 -0000	1.2
+++ kolab.patch	31 May 2005 07:43:51 -0000	1.3
@@ -1,29 +1,31 @@
---- postfix.spec.orig	2005-05-19 04:56:45.000000000 +0200
-+++ postfix.spec	2005-05-19 05:13:43.000000000 +0200
+--- postfix.spec.orig	2005-05-31 03:13:30.000000000 +0200
++++ postfix.spec	2005-05-31 03:15:30.000000000 +0200
 @@ -42,7 +42,7 @@ Class:        BASE
  Group:        Mail
  License:      IPL
  Version:      %{V_postfix}
 -Release:      2.2.0
-+Release:      2.2.0_kolab2
++Release:      2.2.0_kolab3
  
  #   package options
  %option       with_fsl       yes
-@@ -67,6 +67,8 @@ Patch1:       postfix.patch.pfls
+@@ -67,6 +67,9 @@ Patch1:       postfix.patch.pfls
  Patch2:       ftp://ftp.openpkg.org/sources/CPY/postfix/postfix-%{V_whoson}-whoson.patch
  Patch3:       http://www.ipnet6.org/postfix/download/postfix-libspf2-%{V_spf}.patch
  Patch4:       http://www.libsrs2.org/patch/postfix-libsrs2-%{V_srs}.patch
-+Patch5:	      postfix-pipe.patch
++Patch5:       postfix-pipe.patch
 +Patch6:       postfix-ldap-leafonly.patch
++Patch7:       postfix-pipe-allow-empty-sender.patch
  
  #   build information
  Prefix:       %{l_prefix}
-@@ -195,6 +197,8 @@ Conflicts:    exim, sendmail, ssmtp
+@@ -195,6 +198,9 @@ Conflicts:    exim, sendmail, ssmtp
  %if "%{with_whoson}" == "yes"
      %patch -p0 -P 2
  %endif
 +    %patch -p0 -P 5
 +    %patch -p0 -P 6
++    %patch -p0 -P 7
  
  %build
      #   configure Postfix (hard-core part I)





More information about the commits mailing list