]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.6-20090114
authorWietse Venema <wietse@porcupine.org>
Wed, 14 Jan 2009 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:35:09 +0000 (06:35 +0000)
postfix/HISTORY
postfix/WISHLIST
postfix/conf/post-install
postfix/conf/postfix-files
postfix/src/bounce/bounce_notify_verp.c
postfix/src/global/Makefile.in
postfix/src/global/mail_copy.c
postfix/src/global/mail_version.h
postfix/src/oqmgr/qmgr_deliver.c
postfix/src/qmgr/qmgr_deliver.c
postfix/src/util/edit_file.c

index c920cef9c953c43117c234f7f59fd08c6158fae0..d7ae8f2b45da8be7f3128046463f5b45cdc74587 100644 (file)
@@ -14882,3 +14882,18 @@ Apologies for any names omitted.
        client, and for the smtp-source and smtp-sink test programs.
        Files: smtp/smtp_connect.c, smtpstone/smtp-source.c,
        smtpstone/smtp-sink.c.
+
+20090114
+
+       Bugfix: VERP now uses the Postfix original recipient, if
+       available, because that is what the VERP consumer expects.
+       Files: *qmgr/qmgr_deliver.c, bounce/bounce_notify_verp.c.
+
+       Safety: extra check for broken third-party patches that
+       allow file size limit < message size limit. This can cause
+       mail to be stuck in the queue forever.
+
+       Invisible change, in preparation for multi-instance support.
+       Except for main.cf and master.cf, all files are optional
+       for non-default Postfix configuration directories. File:
+       conf/postfix-files.
index 466046f15623098c1caa1c21dc5cf3f328513c92..821ecf894f1cddff4472f05299b5b543360e00b4 100644 (file)
@@ -1,9 +1,4 @@
 Wish list:
-       Force a panic when the VDA patch reduces the file size limit
-       under the message size.  They break the code that marks a
-       recipient as "done", when that recipient was added late
-       (e.g., "sendmail -t" or Milter SMFIR_ADDRCPT).
 
        Set a flag when a remote SMTP client speaks before the
        Postfix SMTP server sends the 220 greeting.
@@ -29,6 +24,10 @@ Wish list:
        Make adding Date/From/Message-ID headers dependent on local
        rewrite context.
 
+       Make adding date/from/etc. conditional. Perhaps on header
+       rewrite context? Do we need a more powerful concept than
+       local_header_rewrite_clients/remote_header_rewrite_domain?
+
        Write delivery rate delay example (which _README?) and auth
        failure cache example (SASL_README). Then include them in
        SOHO_README.
@@ -90,10 +89,6 @@ Wish list:
        Update attr_print/scan() so they can send/receive file
        descriptors. This simplifies kludgy code in many daemons.
 
-       Make adding date/from/etc. conditional. Perhaps on header
-       rewrite context? Do we need a more powerful concept than
-       local_header_rewrite_clients/remote_header_rewrite_domain?
-
        Would there be a problem adding $smtpd_mumble_restrictions
        and $smtpd_sender_login_maps to the default proxy_read_maps
        settings?
index 29e3d9616b5417fe11cc88c6015884e726d19068..3bb74f2ca84fc99bedc2062ed283608440a03693 100644 (file)
@@ -250,8 +250,9 @@ $POSTCONF -d mail_version >/dev/null 2>/dev/null || {
     exit 1
 }
 
+def_config_directory=`$POSTCONF -d -h config_directory` || exit 1
 test -n "$config_directory" ||
-    config_directory=`$POSTCONF -d -h config_directory` || exit 1
+    config_directory="$def_config_directory"
 
 test -d "$config_directory" || {
     echo $0: Error: $config_directory is not a directory. 1>&2
@@ -450,6 +451,8 @@ test -n "$create" && {
        case $flags in *c*) create_flag=1;; *) create_flag=;; esac
        case $flags in *r*) recursive="-R";; *) recursive=;; esac
        case $flags in *o*) obsolete_flag=1;; *) obsolete_flag=;; esac
+       case $flags in *[1i]*) test ! -r "$path" -a "$config_directory" != \
+                               "$def_config_directory" && continue;; esac
        # Flag obsolete objects. XXX Solaris 2..9 does not have "test -e".
        if [ -n "$obsolete_flag" ]
        then
index a46a6f987570049753c0c19e26becd30801ec076..72d3e49e1ce15d1a0e0be5f5a852017b1801b9ed 100644 (file)
@@ -35,6 +35,7 @@
 #      c=create missing directory (post-install create-missing).
 #      r=apply owner/group recursively (post-install set/upgrade-permissions).
 #      o=obsolete, no longer part of Postfix
+#      1=optional for non-default instance (config_dir != built-in default).
 #
 # Note: the "u" flag is for upgrading the permissions of existing files
 # or directories after changes in Postfix architecture. For robustness
@@ -105,28 +106,28 @@ $command_directory/postqueue:f:root:$setgid_group:2755:u
 $sendmail_path:f:root:-:755
 $newaliases_path:l:$sendmail_path
 $mailq_path:l:$sendmail_path
-$config_directory/LICENSE:f:root:-:644
-$config_directory/TLS_LICENSE:f:root:-:644
-$config_directory/access:f:root:-:644:p
-$config_directory/aliases:f:root:-:644:p
-$config_directory/bounce.cf.default:f:root:-:644
-$config_directory/canonical:f:root:-:644:p
+$config_directory/LICENSE:f:root:-:644:1
+$config_directory/TLS_LICENSE:f:root:-:644:1
+$config_directory/access:f:root:-:644:p1
+$config_directory/aliases:f:root:-:644:p1
+$config_directory/bounce.cf.default:f:root:-:644:1
+$config_directory/canonical:f:root:-:644:p1
 $config_directory/cidr_table:f:root:-:644:o
-$config_directory/generic:f:root:-:644:p
+$config_directory/generic:f:root:-:644:p1
 $config_directory/generics:f:root:-:644:o
-$config_directory/header_checks:f:root:-:644:p
+$config_directory/header_checks:f:root:-:644:p1
 $config_directory/install.cf:f:root:-:644:o
-$config_directory/main.cf.default:f:root:-:644
+$config_directory/main.cf.default:f:root:-:644:1
 $config_directory/main.cf:f:root:-:644:p
-$config_directory/makedefs.out:f:root:-:644
+$config_directory/makedefs.out:f:root:-:644:1
 $config_directory/master.cf:f:root:-:644:p
 $config_directory/pcre_table:f:root:-:644:o
 $config_directory/postfix-files:f:root:-:644:o
 $config_directory/regexp_table:f:root:-:644:o
-$config_directory/relocated:f:root:-:644:p
+$config_directory/relocated:f:root:-:644:p1
 $config_directory/tcp_table:f:root:-:644:o
-$config_directory/transport:f:root:-:644:p
-$config_directory/virtual:f:root:-:644:p
+$config_directory/transport:f:root:-:644:p1
+$config_directory/virtual:f:root:-:644:p1
 $config_directory/postfix-script:f:root:-:755:o
 $config_directory/postfix-script-sgid:f:root:-:755:o
 $config_directory/postfix-script-nosgid:f:root:-:755:o
index dbc5e5613898c7412237e25fc3c7e594dfd85f46..715611d37abeb1a4f09407c3eacfb714cf2146c9 100644 (file)
@@ -135,7 +135,6 @@ int     bounce_notify_verp(int flags, char *service, char *queue_name,
        bounce_mail_free(bounce_info);
        return (bounce_status);
     }
-
 #define NULL_SENDER            MAIL_ADDR_EMPTY /* special address */
 #define NULL_TRACE_FLAGS       0
 
@@ -151,12 +150,16 @@ int     bounce_notify_verp(int flags, char *service, char *queue_name,
 
        /*
         * Notify the originator, subject to DSN NOTIFY restrictions.
+        * 
+        * Fix 20090114: Use the Postfix original recipient, because that is
+        * what the VERP consumer expects.
         */
        if (rcpt->dsn_notify != 0               /* compat */
            && (rcpt->dsn_notify & DSN_NOTIFY_FAILURE) == 0) {
            bounce_status = 0;
        } else {
-           verp_sender(verp_buf, verp_delims, recipient, rcpt->address);
+           verp_sender(verp_buf, verp_delims, recipient, rcpt->orig_addr[0] ?
+                       rcpt->orig_addr : rcpt->address);
            if ((bounce = post_mail_fopen_nowait(NULL_SENDER, STR(verp_buf),
                                                 INT_FILT_BOUNCE,
                                                 NULL_TRACE_FLAGS,
index dfcd2c06cb2762db855d559f5eba3e9325a8d87f..d3a76bf676f1b5a4d3239dfee6a60cfa7b6d9ee7 100644 (file)
@@ -1182,6 +1182,7 @@ mail_connect.o: mail_connect.c
 mail_connect.o: mail_proto.h
 mail_connect.o: timed_ipc.h
 mail_copy.o: ../../include/htable.h
+mail_copy.o: ../../include/iostuff.h
 mail_copy.o: ../../include/msg.h
 mail_copy.o: ../../include/safe_open.h
 mail_copy.o: ../../include/stringops.h
index 7088f480db313f13b90158f5250fec61f3b67f16..3dc6c609683204bb23726fa9600ed3d616f31595 100644 (file)
@@ -92,6 +92,7 @@
 /* System library. */
 
 #include <sys_defs.h>
+#include <sys/stat.h>
 #include <string.h>
 #include <unistd.h>
 #include <time.h>
 #include <vstring.h>
 #include <vstring_vstream.h>
 #include <stringops.h>
+#include <iostuff.h>
 
 /* Global library. */
 
@@ -138,6 +140,25 @@ int     mail_copy(const char *sender,
     time_t  now;
     int     type;
     int     prev_type;
+    struct stat st;
+    off_t   size_limit;
+
+    /*
+     * Workaround 20090114. This will hopefully get someone's attention. The
+     * problem with file_size_limit < message_size_limit is that mail will be
+     * delivered again and again until someone removes it from the queue by
+     * hand, because Postfix cannot mark a recipient record as "completed".
+     */
+    if (fstat(vstream_fileno(src), &st) < 0)
+       msg_fatal("fstat: %m");
+    if ((size_limit = get_file_limit()) < st.st_size)
+       msg_panic("file size limit %lu < message size %lu. This "
+                 "causes large messages to be delivered repeatedly "
+                 "after they were submitted with \"sendmail -t\" "
+                 "or after recipients were added with the Milter "
+                 "SMFIR_ADDRCPT request",
+                 (unsigned long) size_limit,
+                 (unsigned long) st.st_size);
 
     /*
      * Initialize.
index d9631538058cb36134df68aea07cb45ef58ba80b..b01abb07290718d17e974972d3d7e44f84132508 100644 (file)
@@ -20,7 +20,7 @@
   * Patches change both the patchlevel and the release date. Snapshots have no
   * patchlevel; they change the release date only.
   */
-#define MAIL_RELEASE_DATE      "20090110"
+#define MAIL_RELEASE_DATE      "20090114"
 #define MAIL_VERSION_NUMBER    "2.6"
 
 #ifdef SNAPSHOT
index 0a339aad3f2abced8c714cf52545aae29a1fbcf9..5df6da8c3dc1fa463b2f5de4c9751cfc8af50454 100644 (file)
@@ -140,13 +140,17 @@ static int qmgr_deliver_send_request(QMGR_ENTRY *entry, VSTREAM *stream)
      * If variable envelope return path is requested, change prefix+@origin
      * into prefix+user=domain@origin. Note that with VERP there is only one
      * recipient per delivery.
+     * 
+     * Fix 20090114: Use the Postfix original recipient, because that is what
+     * the VERP consumer expects.
      */
     if (message->verp_delims == 0) {
        sender = message->sender;
     } else {
        sender_buf = vstring_alloc(100);
        verp_sender(sender_buf, message->verp_delims,
-                   message->sender, list.info->address);
+                   message->sender, list.info->orig_addr[0] ?
+                   list.info->orig_addr : list.info->address);
        sender = vstring_str(sender_buf);
     }
 
index 811e1233cb77d8e9a10b92abdad77acb5b2b92f1..40f9faef2efe0f3cb333751dcbb755022bf52eff 100644 (file)
@@ -145,13 +145,17 @@ static int qmgr_deliver_send_request(QMGR_ENTRY *entry, VSTREAM *stream)
      * If variable envelope return path is requested, change prefix+@origin
      * into prefix+user=domain@origin. Note that with VERP there is only one
      * recipient per delivery.
+     * 
+     * Fix 20090114: Use the Postfix original recipient, because that is what
+     * the VERP consumer expects.
      */
     if (message->verp_delims == 0) {
        sender = message->sender;
     } else {
        sender_buf = vstring_alloc(100);
        verp_sender(sender_buf, message->verp_delims,
-                   message->sender, list.info->address);
+                   message->sender, list.info->orig_addr[0] ?
+                   list.info->orig_addr : list.info->address);
        sender = vstring_str(sender_buf);
     }
 
index abd3dd91777982666e7b40cbd15eda841536ebf0..9b5388ab0f84fec72b0266a7ff1b29b663b935ed 100644 (file)
 /*     At this point in the protocol, the current process controls
 /*     both the output file content and its temporary pathname.
 /*
-/*     In the second phase, the application is expected to update
-/*     the output file via the \fBtmp_fp\fR member of
-/*     the EDIT_FILE data structure.  This phase is not implemented
-/*     by the edit_file() module.
+/*     In the second phase, the application opens the original
+/*     file if needed, and updates the output file via the
+/*     \fBtmp_fp\fR member of the EDIT_FILE data structure.  This
+/*     phase is not implemented by the edit_file() module.
 /*
 /*     edit_file_close() implements the third and final phase of
 /*     the protocol.  It flushes the output file to persistent
@@ -68,7 +68,9 @@
 /*     The pathname of the original file that will be replaced by
 /*     the output file. The temporary pathname for the output file
 /*     is obtained by appending the suffix defined with EDIT_FILE_SUFFIX
-/*     to a copy of the specified original file pathname.
+/*     to a copy of the specified original file pathname, and is
+/*     made available via the \fBtmp_path\fR member of the EDIT_FILE
+/*     data structure.
 /* .IP output_flags
 /*     Flags for opening the output file. These are as with open(2),
 /*     except that the O_TRUNC flag is ignored.  edit_file_open()
@@ -96,7 +98,9 @@
 /*
 /*     With both functions, the global errno variable indicates
 /*     the nature of the problem.  All errors are relative to the
-/*     temporary output's pathname. 
+/*     temporary output's pathname. With both functions, this
+/*     pathname is not available via the EDIT_FILE data structure,
+/*     because that structure was already destroyed, or not created.
 /* BUGS
 /*     In the non-error case, edit_file_open() will not return
 /*     until it obtains exclusive control over the output file
 /*
 /*     When interrupted, edit_file_close() may leave behind a
 /*     world-readable output file under the temporary pathname.
-/*     On some systems this can be used to inflict a shared-file
+/*     On some systems this can be used to inflict a shared-lock
 /*     DOS on the protocol.  Applications that are concerned about
 /*     maximal safety should protect the edit_file_close() call
 /*     with sigdelay() and sigresume() calls, but this introduces