diff --git a/postfix/HISTORY b/postfix/HISTORY index a2ff4fa23..915915c95 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -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, diff --git a/postfix/html/bounce.5.html b/postfix/html/bounce.5.html index 5101a569b..b4900f166 100644 --- a/postfix/html/bounce.5.html +++ b/postfix/html/bounce.5.html @@ -113,10 +113,12 @@ BOUNCE(5) BOUNCE(5) text. See the "TEMPLATE MESSAGE TEXT FORMAT" description below. - From: The sender address that the recipient will see. + From: The sender address in the message header of the + delivery status notification. Subject: - The subject that the recipient will see. + The subject in the message header of the delivery + status notification. Postmaster-Subject: The subject that will be used in Postmaster copies diff --git a/postfix/man/man5/bounce.5 b/postfix/man/man5/bounce.5 index 2c79479da..4bbe6463a 100644 --- a/postfix/man/man5/bounce.5 +++ b/postfix/man/man5/bounce.5 @@ -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 diff --git a/postfix/proto/bounce b/postfix/proto/bounce index bd80b7b0a..f8ffca51b 100644 --- a/postfix/proto/bounce +++ b/postfix/proto/bounce @@ -116,9 +116,11 @@ # 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 index 000000000..47d173d7f --- /dev/null +++ b/postfix/src/bounce/2template_test.in @@ -0,0 +1,136 @@ +failure_template = < + +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 = < + +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 = < + +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 = < + +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 = < 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 \ diff --git a/postfix/src/bounce/bounce_template.c b/postfix/src/bounce/bounce_template.c index 029c41a7b..90f1e8b07 100644 --- a/postfix/src/bounce/bounce_template.c +++ b/postfix/src/bounce/bounce_template.c @@ -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) /* diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index e78f0833d..a530b409b 100644 --- a/postfix/src/global/mail_version.h +++ b/postfix/src/global/mail_version.h @@ -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