]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.10-20120130
authorWietse Venema <wietse@porcupine.org>
Mon, 30 Jan 2012 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:37:58 +0000 (06:37 +0000)
postfix/HISTORY
postfix/src/bounce/bounce_trace_service.c
postfix/src/global/dict_sqlite.c
postfix/src/global/mail_version.h

index 8d0758c5b22178414cd33d929a7db22512e741c8..fc18e1ee723d1961ef060478e479b078985f83a9 100644 (file)
@@ -17589,3 +17589,21 @@ Apologies for any names omitted.
        This is a real stinker that causes Postfix to fail without
        any prior warning.  File: util/warn_stat.[hc], and everything
        that directly calls stat(), fstat() or lstat().
+
+20120127
+
+       Bugfix (introduced: Postfix 2.8): the Postfix client sqlite
+       quoting routine returned the unquoted result instead of the
+       quoted text.  The opportunities for misuse are limited,
+       because Postfix sqlite files are usually owned by root, and
+       because Postfix daemons usually run with non-root privileges.
+       File: global/dict_sqlite.c.
+
+20120130
+
+       Bugfix (introduced: Postfix 2.3): the trace service did not
+       distinguish between notifications for a non-bounce or a
+       single-bounce message. This code pre-dates DSN support and
+       should have been updated when it was re-purposed to handle
+       DSN SUCCESS notifications. Problem reported by Sabahattin
+       Gucukoglu.  File: bounce/bounce_trace_service.c.
index 850515902a78f7269f960af9b174f346c7e19356..e00697157936452fb3b344f8b696fdacf4d0238c 100644 (file)
@@ -83,8 +83,39 @@ int     bounce_trace_service(int flags, char *service, char *queue_name,
     BOUNCE_INFO *bounce_info;
     int     bounce_status = 1;
     VSTREAM *bounce;
-    VSTRING *new_id = vstring_alloc(10);
+    int     notify_mask = name_mask(VAR_NOTIFY_CLASSES, mail_error_masks,
+                                   var_notify_classes);
+    VSTRING *new_id;
     int     count;
+    const char *sender;
+
+    /*
+     * For consistency with fail/delay notifications, send notification for a
+     * non-bounce message as a single-bounce message, send notification for a
+     * single-bounce message as a double-bounce message, and drop requests to
+     * send notification for a double-bounce message.
+     */
+#define NULL_SENDER            MAIL_ADDR_EMPTY /* special address */
+
+    if (strcasecmp(recipient, mail_addr_double_bounce()) == 0) {
+       msg_info("%s: not sending notification for double-bounce message",
+                queue_id);
+       return (0);
+    } else if (*recipient == 0) {
+       if ((notify_mask & MAIL_ERROR_2BOUNCE) != 0) {
+           recipient = var_2bounce_rcpt;
+           sender = mail_addr_double_bounce();
+       } else {
+           msg_info("%s: not sending notification for single-bounce message",
+                    queue_id);
+           if (mail_queue_remove(service, queue_id) && errno != ENOENT)
+               msg_fatal("remove %s %s: %m", service, queue_id);
+           return (0);
+       }
+    } else {
+       /* Always send notification for non-bounce message. */
+       sender = NULL_SENDER;
+    }
 
     /*
      * Initialize. Open queue file, bounce log, etc.
@@ -126,7 +157,6 @@ int     bounce_trace_service(int flags, char *service, char *queue_name,
        bounce_mail_free(bounce_info);
        return (0);
     }
-#define NULL_SENDER            MAIL_ADDR_EMPTY /* special address */
 #define NULL_TRACE_FLAGS       0
 
     /*
@@ -139,7 +169,8 @@ int     bounce_trace_service(int flags, char *service, char *queue_name,
      * there are fewer potential left-over files to remove up when we create
      * a new queue file.
      */
-    if ((bounce = post_mail_fopen_nowait(NULL_SENDER, recipient,
+    new_id = vstring_alloc(10);
+    if ((bounce = post_mail_fopen_nowait(sender, recipient,
                                         INT_FILT_MASK_BOUNCE,
                                         NULL_TRACE_FLAGS,
                                         new_id)) != 0) {
index 7f56cdf30cf9d5d3856764e51012dc5bc841c5fb..8eb0da2f78c6c7ccde0a9aff39dc64ffbf276183 100644 (file)
 /* AUTHOR(S)
 /*     Axel Steiner
 /*     ast@treibsand.com
+/*
+/*     Adopted and updated by:
+/*     Wietse Venema
+/*     IBM T.J. Watson Research
+/*     P.O. Box 704
+/*     Yorktown Heights, NY 10598, USA
 /*--*/
 
 /* System library. */
@@ -109,7 +115,7 @@ static void dict_sqlite_quote(DICT *dict, const char *raw_text, VSTRING *result)
     /* Fix 20100616 */
     if (quoted_text == 0)
        msg_fatal("dict_sqlite_quote: out of memory");
-    vstring_strcat(result, raw_text);
+    vstring_strcat(result, quoted_text);
     sqlite3_free(quoted_text);
 }
 
index 3aa9f4c03ac9315f2877367ffc27a02653ca0257..b714a6c289e3679246a18294c3f2fff2fc05ba4b 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      "20120124"
+#define MAIL_RELEASE_DATE      "20120130"
 #define MAIL_VERSION_NUMBER    "2.10"
 
 #ifdef SNAPSHOT