Package: postfix
Version: 2.2.8-2
Severity: wishlist
Tags: patch

Hi

Attached I include a patch for src/pipe/pipe.c which is needed by the
Kolab packages. I think this patch will be available in the new postfix
upstream version 2.3, but it would be nice if you could add it and make
a Debian version. This would make it easier for the Kolab Maintainers.

Thanks a lot

Greetings
Steffen

Here is the finish dpatch:

#! /bin/sh /usr/share/dpatch/dpatch-run
## 30kolab.dpatch by Steffen Joeris <[EMAIL PROTECTED]>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Patch for Kolab.

@DPATCH@
--- postfix-2.2.8/src/pipe/pipe.c.orig  2005-02-05 05:21:23.000000000 +0100
+++ postfix-2.2.8/src/pipe/pipe.c       2005-07-19 02:49:43.000000000 +0200
@@ -51,7 +51,7 @@
 /*     \fB\er\en\fR or \fB\en\fR. The usual C-style backslash escape
 /*     sequences are recognized: \fB\ea \eb \ef \en \er \et \ev
 /*     \e\fIddd\fR (up to three octal digits) and \fB\e\e\fR.
-/* .IP "\fBflags=BDFORhqu.>\fR (optional)"
+/* .IP "\fBflags=BDFORhnqu.>\fR (optional)"
 /*     Optional message processing flags. By default, a message is
 /*     copied unchanged.
 /* .RS
@@ -82,6 +82,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
@@ -399,6 +402,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)

@@ -719,6 +723,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;
@@ -901,22 +908,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
@@ -932,6 +923,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)) {



-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.15-1-686
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)

Versions of packages postfix depends on:
ii  adduser                      3.80        Add and remove users and groups
ii  debconf [debconf-2.0]        1.4.67      Debian configuration management sy
ii  dpkg                         1.13.11.0.1 package maintenance system for Deb
ii  libc6                        2.3.5-11    GNU C Library: Shared libraries an
ii  libdb4.3                     4.3.29-3    Berkeley v4.3 Database Libraries [
ii  libsasl2                     2.1.19-1.8  Authentication abstraction library
ii  libssl0.9.8                  0.9.8a-5    SSL shared libraries
ii  lsb-base                     3.0-13      Linux Standard Base 3.0 init scrip
ii  netbase                      4.24        Basic TCP/IP networking system

Versions of packages postfix recommends:
ii  kmail [mail-read 4:3.4.3-1               KDE Email client
ii  mailx [mail-read 1:8.1.2-0.20050715cvs-1 A simple mail user agent
ii  mutt [mail-reade 1.5.11-5                Text-based mailreader supporting M
pn  resolvconf       <none>                  (no description available)

-- debconf information excluded


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to