diff --git a/postfix/HISTORY b/postfix/HISTORY index 9794bb62d..82b4f56cc 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -7058,6 +7058,16 @@ Apologies for any names omitted. Default limit: 50 kbytes. Files: global/mime_state.c, cleanup/cleanup_message.c. +20021015 + + Bugfix: the code for missing postmaster/mailer-daemon + aliases had to be moved after the code that implements the + luser_relay feature. Files: local/alias.c, local/unknown.c. + + Weird? The LMTP client lowercased the MAIL FROM and RCPT + TO addresses. Some remnant of code that someone put in + there long ago. File: lmtp/lmtp_proto.c. + Open problems: Low: smtpd should log queue ID with reject/warn/hold/discard diff --git a/postfix/RELEASE_NOTES b/postfix/RELEASE_NOTES index 5e0fbbdd3..dae0deefc 100644 --- a/postfix/RELEASE_NOTES +++ b/postfix/RELEASE_NOTES @@ -12,6 +12,12 @@ snapshot release). Patches change the patchlevel and the release date. Snapshots change only the release date, unless they include the same bugfixes as a patch release. +Incompatible changes with Postfix snapshot 1.1.11-20021015 +========================================================== + +The Postfix LMTP client no longer lowercases email addresses in +MAIL FROM and RCPT TO commands. + Incompatible changes with Postfix snapshot 1.1.11-20021013 ========================================================== diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index cf8746606..24195af10 100644 --- a/postfix/src/global/mail_version.h +++ b/postfix/src/global/mail_version.h @@ -20,7 +20,7 @@ * Patches change the patchlevel and the release date. Snapshots change the * release date only, unless they include the same bugfix as a patch release. */ -#define MAIL_RELEASE_DATE "20021013" +#define MAIL_RELEASE_DATE "20021015" #define VAR_MAIL_VERSION "mail_version" #define DEF_MAIL_VERSION "1.1.11-" MAIL_RELEASE_DATE diff --git a/postfix/src/lmtp/lmtp_proto.c b/postfix/src/lmtp/lmtp_proto.c index b7b3ea62c..de41ac15f 100644 --- a/postfix/src/lmtp/lmtp_proto.c +++ b/postfix/src/lmtp/lmtp_proto.c @@ -307,7 +307,6 @@ static int lmtp_loop(LMTP_STATE *state, int send_state, int recv_state) #define REWRITE_ADDRESS(dst, src) do { \ if (*(src)) { \ quote_821_local(dst, src); \ - lowercase(vstring_str(dst)); \ } else { \ vstring_strcpy(dst, src); \ } \ diff --git a/postfix/src/local/Makefile.in b/postfix/src/local/Makefile.in index c5929d49f..82c704f41 100644 --- a/postfix/src/local/Makefile.in +++ b/postfix/src/local/Makefile.in @@ -74,8 +74,6 @@ alias.o: ../../include/stringops.h alias.o: ../../include/vstring.h alias.o: ../../include/mymalloc.h alias.o: ../../include/mail_params.h -alias.o: ../../include/mail_addr.h -alias.o: ../../include/sent.h alias.o: ../../include/defer.h alias.o: ../../include/bounce.h alias.o: ../../include/maps.h @@ -484,6 +482,8 @@ unknown.o: ../../include/vstream.h unknown.o: ../../include/iostuff.h unknown.o: ../../include/attr.h unknown.o: ../../include/bounce.h +unknown.o: ../../include/mail_addr.h +unknown.o: ../../include/sent.h unknown.o: local.h unknown.o: ../../include/htable.h unknown.o: ../../include/tok822.h diff --git a/postfix/src/local/alias.c b/postfix/src/local/alias.c index d761c7b5a..3145cbd40 100644 --- a/postfix/src/local/alias.c +++ b/postfix/src/local/alias.c @@ -82,8 +82,6 @@ /* Global library. */ #include -#include -#include #include #include #include @@ -303,19 +301,6 @@ int deliver_alias(LOCAL_STATE state, USER_ATTR usr_attr, } } - /* - * If no alias was found for a required reserved name, toss the message - * into the bit bucket, and issue a warning instead. - */ -#define STREQ(x,y) (strcasecmp(x,y) == 0) - - if (STREQ(name, MAIL_ADDR_MAIL_DAEMON) - || STREQ(name, MAIL_ADDR_POSTMASTER)) { - msg_warn("required alias not found: %s", name); - *statusp = sent(SENT_ATTR(state.msg_attr), "discarded"); - return (YES); - } - /* * Try delivery to a local user instead. */ diff --git a/postfix/src/local/unknown.c b/postfix/src/local/unknown.c index c24ef79f1..8904159a3 100644 --- a/postfix/src/local/unknown.c +++ b/postfix/src/local/unknown.c @@ -50,6 +50,11 @@ /* System library. */ #include +#include + +#ifdef STRCASECMP_IN_STRINGS_H +#include +#endif /* Utility library. */ @@ -64,6 +69,8 @@ #include #include #include +#include +#include /* Application-specific. */ @@ -100,27 +107,36 @@ int deliver_unknown(LOCAL_STATE state, USER_ATTR usr_attr) return (deliver_pass(MAIL_CLASS_PRIVATE, var_fallback_transport, state.request, state.msg_attr.recipient, -1L)); - /* - * Bounce the message when no luser relay is specified. - */ - if (*var_luser_relay == 0) - return (bounce_append(BOUNCE_FLAG_KEEP, BOUNCE_ATTR(state.msg_attr), - "unknown user: \"%s\"", state.msg_attr.local)); - /* * Subject the luser_relay address to $name expansion, disable * propagation of unmatched address extension, and re-inject the address - * into the delivery machinery. Donot give special treatment to "|stuff" + * into the delivery machinery. Do not give special treatment to "|stuff" * or /stuff. */ - state.msg_attr.unmatched = 0; - expand_luser = vstring_alloc(100); - local_expand(expand_luser, var_luser_relay, &state, &usr_attr, (char *) 0); - status = deliver_resolve_addr(state, usr_attr, vstring_str(expand_luser)); - vstring_free(expand_luser); + if (*var_luser_relay) { + state.msg_attr.unmatched = 0; + expand_luser = vstring_alloc(100); + local_expand(expand_luser, var_luser_relay, &state, &usr_attr, (char *) 0); + status = deliver_resolve_addr(state, usr_attr, vstring_str(expand_luser)); + vstring_free(expand_luser); + return (status); + } /* - * Done. + * If no alias was found for a required reserved name, toss the message + * into the bit bucket, and issue a warning instead. */ - return (status); +#define STREQ(x,y) (strcasecmp(x,y) == 0) + + if (STREQ(state.msg_attr.local, MAIL_ADDR_MAIL_DAEMON) + || STREQ(state.msg_attr.local, MAIL_ADDR_POSTMASTER)) { + msg_warn("required alias not found: %s", state.msg_attr.local); + return (sent(SENT_ATTR(state.msg_attr), "discarded")); + } + + /* + * Bounce the message when no luser relay is specified. + */ + return (bounce_append(BOUNCE_FLAG_KEEP, BOUNCE_ATTR(state.msg_attr), + "unknown user: \"%s\"", state.msg_attr.local)); } diff --git a/postfix/src/util/dict_ldap.c b/postfix/src/util/dict_ldap.c index e8e7683ea..8b21278d4 100644 --- a/postfix/src/util/dict_ldap.c +++ b/postfix/src/util/dict_ldap.c @@ -589,7 +589,7 @@ static void dict_ldap_get_values(DICT_LDAP *dict_ldap, LDAPMessage * res, } ldap_value_free(vals); } - if (ber != NULL) + if (ber) ber_free(ber, 0); } if (msg_verbose)