diff --git a/postfix/HISTORY b/postfix/HISTORY index 4009c60af..65bb6baf8 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -13447,3 +13447,17 @@ Apologies for any names omitted. Bugfix: Content-Transfer-Encoding: attribute values are case insensitive. File: src/cleanup/cleanup_message.c. + +20070514 + + Bugfix: mailbox_transport(_maps) and fallback_transport(_maps) + were broken when used with the error(8) or discard(8) + transports. Cause: insufficient documentation. Files: + error/error.c, discard/discard.c. + +20070520 + + Bugfix (problem introduced Postfix 2.3): when DSN support + was introduced it broke "agressive" recipient duplicate + elimination with "enable_original_recipient = no". File: + cleanup/cleanup_out_recipient.c. diff --git a/postfix/html/error.8.html b/postfix/html/error.8.html index d66f9ead4..c14495dc2 100644 --- a/postfix/html/error.8.html +++ b/postfix/html/error.8.html @@ -17,8 +17,8 @@ ERROR(8) ERROR(8) requests from the queue manager. Each request specifies a queue file, a sender address, the reason for non-delivery (specified as the next-hop destination), and recipient - information. The reason may be prefixed with an RFC - 3463-compatible detail code. This program expects to be + information. The reason may be prefixed with an RFC + 3463-compatible detail code. This program expects to be run from the master(8) process manager. Depending on the service name in master.cf, error or diff --git a/postfix/src/cleanup/cleanup_out_recipient.c b/postfix/src/cleanup/cleanup_out_recipient.c index 476dc44b5..25ffb9052 100644 --- a/postfix/src/cleanup/cleanup_out_recipient.c +++ b/postfix/src/cleanup/cleanup_out_recipient.c @@ -127,13 +127,20 @@ void cleanup_out_recipient(CLEANUP_STATE *state, * Distinguish between different original recipient addresses that map * onto the same mailbox. The recipient will use our original recipient * message header to figure things out. + * + * Postfix 2.2 compatibility: when ignoring differences in Postfix original + * recipient information, also ignore differences in DSN attributes. We + * do, however, keep the DSN attributes of the recipient that survives + * duplicate elimination. */ #define STREQ(x, y) (strcmp((x), (y)) == 0) if ((state->flags & CLEANUP_FLAG_MAP_OK) == 0 || cleanup_virt_alias_maps == 0) { - if (been_here(state->dups, "%s\n%d\n%s\n%s", - dsn_orcpt, dsn_notify, orcpt, recip) == 0) { + if ((var_enable_orcpt ? + been_here(state->dups, "%s\n%d\n%s\n%s", + dsn_orcpt, dsn_notify, orcpt, recip) : + been_here_fixed(state->dups, recip)) == 0) { if (dsn_notify) cleanup_out_format(state, REC_TYPE_ATTR, "%s=%d", MAIL_ATTR_DSN_NOTIFY, dsn_notify); @@ -181,6 +188,11 @@ void cleanup_out_recipient(CLEANUP_STATE *state, * notifications. The queue manager will flush the trace (and bounce) * logfile, possibly after it has generated its own success or failure * notification records. + * + * Postfix 2.2 compatibility: when ignoring differences in Postfix original + * recipient information, also ignore differences in DSN attributes. We + * do, however, keep the DSN attributes of the recipient that survives + * duplicate elimination. */ else { RECIPIENT rcpt; @@ -198,8 +210,10 @@ void cleanup_out_recipient(CLEANUP_STATE *state, dsn_notify & ~DSN_NOTIFY_SUCCESS); } for (cpp = argv->argv; *cpp; cpp++) { - if (been_here(state->dups, "%s\n%d\n%s\n%s", - dsn_orcpt, dsn_notify, orcpt, *cpp) == 0) { + if ((var_enable_orcpt ? + been_here(state->dups, "%s\n%d\n%s\n%s", + dsn_orcpt, dsn_notify, orcpt, *cpp) : + been_here_fixed(state->dups, *cpp)) == 0) { if (dsn_notify) cleanup_out_format(state, REC_TYPE_ATTR, "%s=%d", MAIL_ATTR_DSN_NOTIFY, dsn_notify); diff --git a/postfix/src/discard/discard.c b/postfix/src/discard/discard.c index 17bdeceee..c0e5e6deb 100644 --- a/postfix/src/discard/discard.c +++ b/postfix/src/discard/discard.c @@ -174,13 +174,11 @@ static int deliver_message(DELIVER_REQUEST *request) (void) DSN_SIMPLE(&dsn, DSN_STATUS(dp.dsn), dp.text); for (nrcpt = 0; nrcpt < request->rcpt_list.len; nrcpt++) { rcpt = request->rcpt_list.info + nrcpt; - if (rcpt->offset >= 0) { - status = sent(BOUNCE_FLAGS(request), request->queue_id, - &request->msg_stats, rcpt, "none", &dsn); - if (status == 0 && (request->flags & DEL_REQ_FLAG_SUCCESS)) - deliver_completed(src, rcpt->offset); - result |= status; - } + status = sent(BOUNCE_FLAGS(request), request->queue_id, + &request->msg_stats, rcpt, "none", &dsn); + if (status == 0 && (request->flags & DEL_REQ_FLAG_SUCCESS)) + deliver_completed(src, rcpt->offset); + result |= status; } /* diff --git a/postfix/src/error/error.c b/postfix/src/error/error.c index 019900b2b..73777cd10 100644 --- a/postfix/src/error/error.c +++ b/postfix/src/error/error.c @@ -181,13 +181,11 @@ static int deliver_message(DELIVER_REQUEST *request, const char *def_dsn, (void) DSN_SIMPLE(&dsn, DSN_STATUS(dp.dsn), dp.text); for (nrcpt = 0; nrcpt < request->rcpt_list.len; nrcpt++) { rcpt = request->rcpt_list.info + nrcpt; - if (rcpt->offset >= 0) { - status = append(BOUNCE_FLAGS(request), request->queue_id, - &request->msg_stats, rcpt, "none", &dsn); - if (status == 0) - deliver_completed(src, rcpt->offset); - result |= status; - } + status = append(BOUNCE_FLAGS(request), request->queue_id, + &request->msg_stats, rcpt, "none", &dsn); + if (status == 0) + deliver_completed(src, rcpt->offset); + result |= status; } /* diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index c1c19242f..a46b605bc 100644 --- a/postfix/src/global/mail_version.h +++ b/postfix/src/global/mail_version.h @@ -20,8 +20,8 @@ * Patches change both the patchlevel and the release date. Snapshots have no * patchlevel; they change the release date only. */ -#define MAIL_RELEASE_DATE "20070511" -#define MAIL_VERSION_NUMBER "2.4.2-RC1" +#define MAIL_RELEASE_DATE "20070524" +#define MAIL_VERSION_NUMBER "2.4.2-RC2" #ifdef SNAPSHOT # define MAIL_VERSION_DATE "-" MAIL_RELEASE_DATE diff --git a/postfix/src/local/mailbox.c b/postfix/src/local/mailbox.c index 04cead1b9..92bd79d67 100644 --- a/postfix/src/local/mailbox.c +++ b/postfix/src/local/mailbox.c @@ -271,6 +271,7 @@ int deliver_mailbox(LOCAL_STATE state, USER_ATTR usr_attr, int *statusp) if (*var_mbox_transp_maps && transp_maps == 0) transp_maps = maps_create(VAR_MBOX_TRANSP_MAPS, var_mbox_transp_maps, DICT_FLAG_LOCK | DICT_FLAG_NO_REGSUB); + /* The -1 is a hint for the down-stream deliver_completed() function. */ if (*var_mbox_transp_maps && (map_transport = maps_find(transp_maps, state.msg_attr.user, DICT_FLAG_NONE)) != 0) { diff --git a/postfix/src/local/unknown.c b/postfix/src/local/unknown.c index cc80acfa6..068f9eed2 100644 --- a/postfix/src/local/unknown.c +++ b/postfix/src/local/unknown.c @@ -109,9 +109,11 @@ int deliver_unknown(LOCAL_STATE state, USER_ATTR usr_attr) if (*var_fbck_transp_maps && transp_maps == 0) transp_maps = maps_create(VAR_FBCK_TRANSP_MAPS, var_fbck_transp_maps, DICT_FLAG_LOCK | DICT_FLAG_NO_REGSUB); + /* The -1 is a hint for the down-stream deliver_completed() function. */ if (*var_fbck_transp_maps && (map_transport = maps_find(transp_maps, state.msg_attr.user, DICT_FLAG_NONE)) != 0) { + state.msg_attr.rcpt.offset = -1L; return (deliver_pass(MAIL_CLASS_PRIVATE, map_transport, state.request, &state.msg_attr.rcpt)); }