summaryrefslogtreecommitdiff
path: root/postfix
diff options
context:
space:
mode:
authorSteffen Hansen <steffen@kdab.com>2005-05-31 07:43:51 (GMT)
committerSteffen Hansen <steffen@kdab.com>2005-05-31 07:43:51 (GMT)
commit8a788c107f3d4c5f266862f24dc87e2dc8859433 (patch)
tree386436d87652600328c915fa88eb15ce003f7a21 /postfix
parentc256a07593a12ff49170f6bbb1c27e8d7f241cfc (diff)
downloadserver-8a788c107f3d4c5f266862f24dc87e2dc8859433.tar.gz
patch to make postfix pipe transport allow empty envelope sender
Diffstat (limited to 'postfix')
-rw-r--r--postfix/Makefile1
-rw-r--r--postfix/kolab.patch14
-rw-r--r--postfix/postfix-pipe-allow-empty-sender.patch87
3 files changed, 96 insertions, 6 deletions
diff --git a/postfix/Makefile b/postfix/Makefile
index 2b01636..6ffab02 100644
--- a/postfix/Makefile
+++ b/postfix/Makefile
@@ -18,6 +18,7 @@ all: postfix-$(VERSION)-$(RELEASE).src.rpm
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'
diff --git a/postfix/kolab.patch b/postfix/kolab.patch
index d0ccf28..4102798 100644
--- a/postfix/kolab.patch
+++ b/postfix/kolab.patch
@@ -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)
diff --git a/postfix/postfix-pipe-allow-empty-sender.patch b/postfix/postfix-pipe-allow-empty-sender.patch
new file mode 100644
index 0000000..85b4ed7
--- /dev/null
+++ b/postfix/postfix-pipe-allow-empty-sender.patch
@@ -0,0 +1,87 @@
+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~