From a4f3d9cc74deef75f34c28a99f1863df588d7b4b Mon Sep 17 00:00:00 2001 From: rpaulo Date: Thu, 5 Jan 2006 02:14:08 +0000 Subject: [PATCH] postfix-2.2.8 --- gnu/dist/postfix/src/postqueue/postqueue.c | 3 +- gnu/dist/postfix/src/scache/scache.c | 4 ++- gnu/dist/postfix/src/smtp/smtp_chat.c | 33 ++++++++++++++++------ gnu/dist/postfix/src/smtp/smtp_proto.c | 18 ++++++------ gnu/dist/postfix/src/util/dict_regexp.c | 11 +++++++- gnu/dist/postfix/src/util/inet_util.c | 2 +- gnu/dist/postfix/src/util/inet_util.h | 2 +- 7 files changed, 50 insertions(+), 23 deletions(-) diff --git a/gnu/dist/postfix/src/postqueue/postqueue.c b/gnu/dist/postfix/src/postqueue/postqueue.c index 805ce9e2fd2a..f13a25a3ac8d 100644 --- a/gnu/dist/postfix/src/postqueue/postqueue.c +++ b/gnu/dist/postfix/src/postqueue/postqueue.c @@ -1,4 +1,4 @@ -/* $NetBSD: postqueue.c,v 1.1.1.7 2005/08/18 21:08:20 rpaulo Exp $ */ +/* $NetBSD: postqueue.c,v 1.1.1.8 2006/01/05 02:14:08 rpaulo Exp $ */ /*++ /* NAME @@ -453,6 +453,7 @@ int main(int argc, char **argv) * Further initialization... */ mail_conf_read(); + mail_dict_init(); /* proxy, sql, ldap */ get_mail_conf_str_table(str_table); /* diff --git a/gnu/dist/postfix/src/scache/scache.c b/gnu/dist/postfix/src/scache/scache.c index 9c2602c4f1e5..644b8b17373c 100644 --- a/gnu/dist/postfix/src/scache/scache.c +++ b/gnu/dist/postfix/src/scache/scache.c @@ -1,4 +1,4 @@ -/* $NetBSD: scache.c,v 1.1.1.1 2005/08/18 21:11:11 rpaulo Exp $ */ +/* $NetBSD: scache.c,v 1.1.1.2 2006/01/05 02:14:39 rpaulo Exp $ */ /*++ /* NAME @@ -424,6 +424,7 @@ static void scache_service(VSTREAM *client_stream, char *unused_service, * dedicated to the scache service. All connection-management stuff is * handled by the common code in multi_server.c. */ +do { if (attr_scan(client_stream, ATTR_FLAG_MORE | ATTR_FLAG_STRICT, ATTR_TYPE_STR, MAIL_ATTR_REQ, scache_request, @@ -444,6 +445,7 @@ static void scache_service(VSTREAM *client_stream, char *unused_service, ATTR_TYPE_END); } } +} while (vstream_peek(client_stream) > 0); vstream_fflush(client_stream); } diff --git a/gnu/dist/postfix/src/smtp/smtp_chat.c b/gnu/dist/postfix/src/smtp/smtp_chat.c index 0e30478c3e04..4e6bcb84f94d 100644 --- a/gnu/dist/postfix/src/smtp/smtp_chat.c +++ b/gnu/dist/postfix/src/smtp/smtp_chat.c @@ -1,4 +1,4 @@ -/* $NetBSD: smtp_chat.c,v 1.1.1.8 2005/12/01 21:45:57 rpaulo Exp $ */ +/* $NetBSD: smtp_chat.c,v 1.1.1.9 2006/01/05 02:14:54 rpaulo Exp $ */ /*++ /* NAME @@ -249,18 +249,33 @@ SMTP_RESP *smtp_chat_resp(SMTP_SESSION *session) } /* - * XXX Do not ignore garbage when ESMTP command pipelining is turned - * on. After sending ".QUIT", Postfix might recognize - * the server's 2XX QUIT reply as a 2XX END-OF-DATA reply after - * garbage, causing mail to be lost. Instead, make a long jump so - * that all recipients of multi-recipient mail get consistent - * treatment. + * XXX Do not simply ignore garbage in the server reply when ESMTP + * command pipelining is turned on. For example, after sending + * ".QUIT" and receiving garbage followed by a + * legitimate 2XX reply, Postfix recognizes the server's QUIT reply + * as the END-OF-DATA reply after garbage, causing mail to be lost. + * + * Without the ability to store per-domain status information in queue + * files, automatic workarounds are problematic. Automatically + * deferring the delivery creates "no delivery" or "repeated + * delivery" problems, and automatically turning off pipelining for + * "old" mail affects deliveries to sites with correct pipelining + * implementations. + * + * So we leave the decision with the administrator, but we don't force + * them to take action, like we would with automatic deferral. If + * loss of mail is not acceptable then they can turn off pipelining + * for specific sites, or they can turn off pipelining globally when + * they find that there are just too many broken sites. */ session->error_mask |= MAIL_ERROR_PROTOCOL; if (session->features & SMTP_FEATURE_PIPELINING) { - msg_warn("non-SMTP response from %s: %s", + msg_warn("non-SMTP response from %s: %.100s", session->namaddr, STR(session->buffer)); - vstream_longjmp(session->stream, SMTP_ERR_PROTO); + if (var_helpful_warnings) + msg_warn("to prevent loss of mail, turn off command pipelining " + "for %s with the %s parameter", session->addr, + VAR_SMTP_EHLO_DIS_MAPS); } } if (three_digs != 0) diff --git a/gnu/dist/postfix/src/smtp/smtp_proto.c b/gnu/dist/postfix/src/smtp/smtp_proto.c index 808c60d57cac..a0f645b35003 100644 --- a/gnu/dist/postfix/src/smtp/smtp_proto.c +++ b/gnu/dist/postfix/src/smtp/smtp_proto.c @@ -1,4 +1,4 @@ -/* $NetBSD: smtp_proto.c,v 1.1.1.9 2005/08/18 21:08:55 rpaulo Exp $ */ +/* $NetBSD: smtp_proto.c,v 1.1.1.10 2006/01/05 02:15:02 rpaulo Exp $ */ /*++ /* NAME @@ -254,20 +254,20 @@ int smtp_helo(SMTP_STATE *state, NOCLOBBER int misc_flags) #endif + /* + * Prepare for disaster. + */ + smtp_timeout_setup(state->session->stream, var_smtp_helo_tmout); + if ((except = vstream_setjmp(state->session->stream)) != 0) + return (smtp_stream_except(state, except, + "performing the initial protocol handshake")); + /* * If not recursing after STARTTLS, examine the server greeting banner * and decide if we are going to send EHLO as the next command. */ if ((misc_flags & SMTP_MISC_FLAG_IN_STARTTLS) == 0) { - /* - * Prepare for disaster. - */ - smtp_timeout_setup(state->session->stream, var_smtp_helo_tmout); - if ((except = vstream_setjmp(state->session->stream)) != 0) - return (smtp_stream_except(state, except, - "receiving the initial SMTP greeting")); - /* * Read and parse the server's SMTP greeting banner. */ diff --git a/gnu/dist/postfix/src/util/dict_regexp.c b/gnu/dist/postfix/src/util/dict_regexp.c index 61f374e56165..433ca3982813 100644 --- a/gnu/dist/postfix/src/util/dict_regexp.c +++ b/gnu/dist/postfix/src/util/dict_regexp.c @@ -1,4 +1,4 @@ -/* $NetBSD: dict_regexp.c,v 1.1.1.7 2005/08/18 21:10:15 rpaulo Exp $ */ +/* $NetBSD: dict_regexp.c,v 1.1.1.8 2006/01/05 02:17:15 rpaulo Exp $ */ /*++ /* NAME @@ -259,9 +259,18 @@ static const char *dict_regexp_lookup(DICT *dict, const char *lookup_string) /* * Skip $number substitutions when the replacement text contains * no $number strings (as learned during the pre-scan). + * + * XXX This is incorrect. Replacement text without $number + * expressions may still require $$ -> $ replacement. Fixing this + * requires that we save the result after pre-scanning the + * replacement text. This change is too invasive for a stable + * release. Since this optimization does not exist in the PCRE + * module, we forego it here too. */ +#if 0 if (match_rule->max_sub == 0) return (match_rule->replacement); +#endif /* * Perform $number substitutions on the replacement text. We diff --git a/gnu/dist/postfix/src/util/inet_util.c b/gnu/dist/postfix/src/util/inet_util.c index 2e85a29ef98a..8718c7db0efc 100644 --- a/gnu/dist/postfix/src/util/inet_util.c +++ b/gnu/dist/postfix/src/util/inet_util.c @@ -1,4 +1,4 @@ -/* $NetBSD: inet_util.c,v 1.1.1.4 2005/12/01 21:47:49 rpaulo Exp $ */ +/* $NetBSD: inet_util.c,v 1.1.1.5 2006/01/05 02:17:36 rpaulo Exp $ */ /*++ /* NAME diff --git a/gnu/dist/postfix/src/util/inet_util.h b/gnu/dist/postfix/src/util/inet_util.h index 340897dcb79c..94f5eeabd6ce 100644 --- a/gnu/dist/postfix/src/util/inet_util.h +++ b/gnu/dist/postfix/src/util/inet_util.h @@ -1,4 +1,4 @@ -/* $NetBSD: inet_util.h,v 1.1.1.4 2005/12/01 21:47:49 rpaulo Exp $ */ +/* $NetBSD: inet_util.h,v 1.1.1.5 2006/01/05 02:17:39 rpaulo Exp $ */ #ifndef _INET_UTIL_H_INCLUDED_ #define _INET_UTIL_H_INCLUDED_