]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.3-20051118
authorWietse Venema <wietse@porcupine.org>
Fri, 18 Nov 2005 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:31:43 +0000 (06:31 +0000)
postfix/HISTORY
postfix/html/bounce.5.html
postfix/man/man5/bounce.5
postfix/proto/bounce
postfix/src/bounce/2template_test.in [new file with mode: 0644]
postfix/src/bounce/Makefile.in
postfix/src/bounce/bounce_template.c
postfix/src/global/mail_version.h

index a2ff4fa233ff7ca05f24a8c7ccfabf6fa09943ee..915915c9522e85b64ec20b84e0b8dd7dbc8777fc 100644 (file)
@@ -11400,6 +11400,11 @@ Apologies for any names omitted.
        Files: bounce/bounce_template.[hc], bounce/bounce_templates.c,
        bounce/bounce_notify_util.c.
 
+20051118
+
+       Bugfix: new bounce template code did not return after
+       template syntax error. File: bounce/bounce_template.c
+
 Open problems:
 
        "postsuper -r" no longer resets the message arrival time,
index 5101a569b32ac453ed714698ab3dbed58ce0227e..b4900f166a99bdbda9659eeb8c6e5fd2877cc46d 100644 (file)
@@ -113,10 +113,12 @@ BOUNCE(5)                                                            BOUNCE(5)
               text.   See  the  "TEMPLATE  MESSAGE  TEXT  FORMAT"
               description below.
 
-       <b>From:</b>  The sender address that the recipient will see.
+       <b>From:</b>  The sender address in the  message  header  of  the
+              delivery status notification.
 
        <b>Subject:</b>
-              The subject that the recipient will see.
+              The  subject  in the message header of the delivery
+              status notification.
 
        <b>Postmaster-Subject:</b>
               The subject that will be used in Postmaster  copies
index 2c79479dac054550f9e36a2583c117e6b9d5527e..4bbe6463aa47a5c7d77e01b8b4e1224cec019e95 100644 (file)
@@ -128,9 +128,11 @@ The following headers are supported:
 The MIME character set of the template message text.  See
 the "TEMPLATE MESSAGE TEXT FORMAT" description below.
 .IP \fBFrom:\fR
-The sender address that the recipient will see.
+The sender address in the message header of the delivery
+status notification.
 .IP \fBSubject:\fR
-The subject that the recipient will see.
+The subject in the message header of the delivery status
+notification.
 .IP \fBPostmaster-Subject:\fR
 The subject that will be used in Postmaster copies of
 undeliverable or delayed mail notifications. These copies
index bd80b7b0a074a0e6ec98208e3e0fa8b05248aba7..f8ffca51bb1ebc34cb0db31db7c0174af74cbb4c 100644 (file)
 #      The MIME character set of the template message text.  See
 #      the "TEMPLATE MESSAGE TEXT FORMAT" description below.
 # .IP \fBFrom:\fR
-#      The sender address that the recipient will see.
+#      The sender address in the message header of the delivery
+#      status notification.
 # .IP \fBSubject:\fR
-#      The subject that the recipient will see.
+#      The subject in the message header of the delivery status
+#      notification.
 # .IP \fBPostmaster-Subject:\fR
 #      The subject that will be used in Postmaster copies of
 #      undeliverable or delayed mail notifications. These copies
diff --git a/postfix/src/bounce/2template_test.in b/postfix/src/bounce/2template_test.in
new file mode 100644 (file)
index 0000000..47d173d
--- /dev/null
@@ -0,0 +1,136 @@
+failure_template = <<EOF
+Charset: us-ascii
+From: MAILER-DAEMON (Mail Delivery System)
+Subject: Undelivered Mail Returned to Sender
+Postmaster-Subject: Postmaster Copy: Undelivered Mail
+
+This is the $mail_name program at host $myhostname.
+
+I'm sorry to have to inform you that your message could not
+be delivered to one or more recipients. It's attached below.
+
+For further assistance, please send mail to <postmaster>
+
+If you do so, please include this problem report. You can
+delete your own text from the attached returned message.
+
+                   The $mail_name program
+EOF
+
+delay_template = <<EOF
+Charset: us-ascii
+From: MAILER-DAEMON (Mail Delivery System)
+Subject: Delayed Mail (still being retried)
+Postmaster-Subject: Postmaster Warning: Delayed Mail
+
+This is the $mail_name program at host $myhostname.
+
+####################################################################
+# THIS IS A WARNING ONLY.  YOU DO NOT NEED TO RESEND YOUR MESSAGE. #
+####################################################################
+
+Your message could not be delivered for $delay_warning_time_hours hour(s).
+It will be retried until it is $maximal_queue_lifetime_days day(s) old.
+
+For further assistance, please send mail to <postmaster>
+
+If you do so, please include this problem report. You can
+delete your own text from the attached returned message.
+
+                   The $mail_name program
+EOF
+
+success_template = <<EOF
+Charset: us-ascii
+From: MAILER-DAEMON (Mail Delivery System)
+Subject: Successful Mail Delivery Report
+
+This is the $mail_name program at host $myhostname.
+
+Your message was successfully delivered to the destination(s)
+listed below. If the message was delivered to mailbox you will
+receive no further notifications. Otherwise you may still receive
+notifications of mail delivery errors from other systems.
+
+                   The $mail_name program
+EOF
+
+verify_template = <<EOF
+Charset: us-ascii
+From: MAILER-DAEMON (Mail Delivery System)
+Subject: Mail Delivery Status Report
+
+This is the $mail_name program at host $myhostname.
+
+Enclosed is the mail delivery report that you requested.
+
+                   The $mail_name program
+EOF
+failure_template = <<EOF
+Charset: us-ascii
+From: MAILER-DAEMON (Mail Delivery System)
+Subject: Undelivered Mail Returned to Sender
+Postmaster-Subject: Postmaster Copy: Undelivered Mail
+
+This is the $mail_name program at host $myhostname.
+
+I'm sorry to have to inform you that your message could not
+be delivered to one or more recipients. It's attached below.
+
+For further assistance, please send mail to <postmaster>
+
+If you do so, please include this problem report. You can
+delete your own text from the attached returned message.
+
+                   The $mail_name program
+EOF
+
+delay_template = <<EOF
+Charset: us-ascii
+From: MAILER-DAEMON (Mail Delivery System)
+Subject: Delayed Mail (still being retried)
+Postmaster-Subject: Postmaster Warning: Delayed Mail
+
+This is the $mail_name program at host $myhostname.
+
+####################################################################
+# THIS IS A WARNING ONLY.  YOU DO NOT NEED TO RESEND YOUR MESSAGE. #
+####################################################################
+
+Your message could not be delivered for $delay_warning_time_hours hour(s).
+It will be retried until it is $maximal_queue_lifetime_days day(s) old.
+
+For further assistance, please send mail to <postmaster>
+
+If you do so, please include this problem report. You can
+delete your own text from the attached returned message.
+
+                   The $mail_name program
+EOF
+
+success_template = <<EOF
+Charset: us-ascii
+From: MAILER-DAEMON (Mail Delivery System)
+Subject: Successful Mail Delivery Report
+
+This is the $mail_name program at host $myhostname.
+
+Your message was successfully delivered to the destination(s)
+listed below. If the message was delivered to mailbox you will
+receive no further notifications. Otherwise you may still receive
+notifications of mail delivery errors from other systems.
+
+                   The $mail_name program
+EOF
+
+verify_template = <<EOF
+Charset: us-ascii
+From: MAILER-DAEMON (Mail Delivery System)
+Subject: Mail Delivery Status Report
+
+This is the $mail_name program at host $myhostname.
+
+Enclosed is the mail delivery report that you requested.
+
+                   The $mail_name program
+EOF
index 7c2b2febb4c27165ac97b715c733ee97d0263344..9535f27ccbe095491e348f92277379216c48c773 100644 (file)
@@ -37,7 +37,7 @@ Makefile: Makefile.in
 
 test:  $(TESTPROG)
 
-tests: update template_test
+tests: update template_test 2template_test
 
 update: ../../libexec/$(PROG) $(SAMPLES)
 
@@ -70,6 +70,12 @@ template_test: $(PROG) main.cf template_test.ref
        diff template_test.ref template_test.tmp
        rm -f template_test.tmp
 
+2template_test: $(PROG) main.cf template_test.ref 2template_test.in
+       MAIL_CONFIG=. ./$(PROG) -SVzndump_templates \
+           -o bounce_template_file=2template_test.in > template_test.tmp
+       diff template_test.ref template_test.tmp
+       rm -f template_test.tmp
+
 depend: $(MAKES)
        (sed '1,/^# do not edit/!d' Makefile.in; \
        set -e; for i in [a-z][a-z0-9]*.c; do \
index 029c41a7bc718aef701b702648af2877dee1ce6f..90f1e8b07b9a5b9343d7179b6ae0b5efbba7a907 100644 (file)
@@ -222,6 +222,15 @@ void    bounce_template_free(BOUNCE_TEMPLATE *tp)
     myfree((char *) tp);
 }
 
+/* bounce_template_reset - reset template to default */
+
+static void bounce_template_reset(BOUNCE_TEMPLATE *tp)
+{
+    myfree(tp->buffer);
+    myfree((char *) tp->origin);
+    *tp = *(tp->prototype);
+}
+
 /* bounce_template_load - override one template */
 
 void    bounce_template_load(BOUNCE_TEMPLATE *tp, const char *origin,
@@ -231,10 +240,8 @@ void    bounce_template_load(BOUNCE_TEMPLATE *tp, const char *origin,
     /*
      * Clean up after a previous call.
      */
-    if (tp->buffer) {
-       myfree(tp->buffer);
-       myfree((char *) tp->origin);
-    }
+    if (tp->buffer)
+       bounce_template_reset(tp);
 
     /*
      * Postpone the work of template parsing until it is really needed. Most
@@ -244,9 +251,6 @@ void    bounce_template_load(BOUNCE_TEMPLATE *tp, const char *origin,
        tp->flags |= BOUNCE_TMPL_FLAG_NEW_BUFFER;
        tp->buffer = mystrdup(buffer);
        tp->origin = mystrdup(origin);
-    } else {
-       *tp = *(tp->prototype);
-       /* Also resets the buffer and origin fields. */
     }
 }
 
@@ -273,9 +277,8 @@ static void bounce_template_parse_buffer(BOUNCE_TEMPLATE *tp)
      * Discard the unusable template and use the default one instead.
      */
 #define CLEANUP_AND_RETURN() do { \
-       myfree(tp->buffer); \
-       myfree((char *) tp->origin); \
-       *tp = *(tp->prototype); \
+       bounce_template_reset(tp); \
+       return; \
     } while (0)
 
     /*
index e78f0833d97d9cc683f788023867c9bf86e76193..a530b409b68dc97f49bcdcc36854bf5eae62a9ae 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      "20051117"
+#define MAIL_RELEASE_DATE      "20051118"
 #define MAIL_VERSION_NUMBER    "2.3"
 
 #ifdef SNAPSHOT