diff --git a/postfix/HISTORY b/postfix/HISTORY index de58eebe7..0984941cc 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -8189,8 +8189,8 @@ Apologies for any names omitted. of mail probes, so it will no longer block for in_flow_delay seconds when mail arrives faster than it is delivered. Still need to make mail_stream_finish() asynchronous in - order to avoid blocking for trigger_timeout seconds when the - queue manager is overwhelmed. Files: global/post_mail.c, + order to avoid blocking for trigger_timeout seconds when + the queue manager is overwhelmed. Files: global/post_mail.c, verify/verify.c. Bugfix: removed extraneous sleep() after the last attempt @@ -8201,6 +8201,22 @@ Apologies for any names omitted. Bugfix: the stricter postdrop input filter broke "sendmail -bs". Found by Lutz Jaenicke. File: smtpd/smtpd.c. +20030618 + + After "postfix reload", the master daemon now warns when + inet_interfaces has changed, and ignores the change, instead + of passing incorrect information to the smtp server. File: + master/master_ent.c. + +20030620 + + Bugfix: after the last change to postdrop, postcat no longer + recognized maildrop files as valid. File: postcat/postcat.c. + + Bugfix: after moving "sendmail -t" address extraction to + sendmail, "-t" broke multi-line recipient headers. Victor + Duchovni, Morgan Stanley. File: sendmail/sendmail.c. + Open problems: Low: smtp-source may block when sending large test messages. diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index bedf937ed..7cd711ca6 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 "20030611" +#define MAIL_RELEASE_DATE "20030621" #define VAR_MAIL_VERSION "mail_version" #define DEF_MAIL_VERSION "2.0.12-" MAIL_RELEASE_DATE diff --git a/postfix/src/master/master_ent.c b/postfix/src/master/master_ent.c index cccaa8ea1..11ff16cc9 100644 --- a/postfix/src/master/master_ent.c +++ b/postfix/src/master/master_ent.c @@ -234,10 +234,26 @@ MASTER_SERV *get_master_ent() int n; char *bufp; char *atmp; + static char *saved_interfaces = 0; if (master_fp == 0) msg_panic("get_master_ent: config file not open"); + /* + * XXX We cannot change the inet_interfaces setting for a running master + * process. Listening sockets are inherited by child processes so that + * closing and reopening those sockets in the master does not work. + * + * Another problem is that library routines still cache results that are + * based on the old inet_interfaces setting. It is too much trouble to + * recompute everything. + * + * In order to keep our data structures consistent we ignore changes in + * inet_interfaces settings, and issue a warning instead. + */ + if (saved_interfaces == 0) + saved_interfaces = mystrdup(var_inet_interfaces); + /* * Skip blank lines and comment lines. */ @@ -274,6 +290,12 @@ MASTER_SERV *get_master_ent() transport = get_str_ent(&bufp, "transport type", (char *) 0); if (STR_SAME(transport, MASTER_XPORT_NAME_INET)) { + if (!STR_SAME(saved_interfaces, var_inet_interfaces)) { + msg_warn("service %s: ignoring %s change", + name, VAR_INET_INTERFACES); + msg_warn("to change %s, stop and start Postfix", + VAR_INET_INTERFACES); + } serv->type = MASTER_SERV_TYPE_INET; atmp = inet_parse(name, &host, &port); if (*host) { @@ -284,7 +306,7 @@ MASTER_SERV *get_master_ent() inet_addr_host(MASTER_INET_ADDRLIST(serv), host); inet_addr_list_uniq(MASTER_INET_ADDRLIST(serv)); serv->listen_fd_count = MASTER_INET_ADDRLIST(serv)->used; - } else if (strcasecmp(var_inet_interfaces, DEF_INET_INTERFACES) == 0) { + } else if (strcasecmp(saved_interfaces, DEF_INET_INTERFACES) == 0) { MASTER_INET_ADDRLIST(serv) = 0; /* wild-card */ serv->listen_fd_count = 1; } else { diff --git a/postfix/src/postcat/postcat.c b/postfix/src/postcat/postcat.c index 4f6c6c482..3e19547b5 100644 --- a/postfix/src/postcat/postcat.c +++ b/postfix/src/postcat/postcat.c @@ -57,6 +57,7 @@ #include #include #include +#include /* Utility library. */ @@ -97,7 +98,7 @@ static void postcat(VSTREAM *fp, VSTRING *buffer) * See if this is a plausible file. */ if ((ch = VSTREAM_GETC(fp)) != VSTREAM_EOF) { - if (ch != REC_TYPE_TIME && ch != REC_TYPE_SIZE) { + if (!strchr(REC_TYPE_POST_ENVELOPE, ch)) { msg_warn("%s: input is not a valid queue file", VSTREAM_PATH(fp)); return; } diff --git a/postfix/src/sendmail/sendmail.c b/postfix/src/sendmail/sendmail.c index 6b9ec6262..a59957c01 100644 --- a/postfix/src/sendmail/sendmail.c +++ b/postfix/src/sendmail/sendmail.c @@ -398,24 +398,14 @@ static void output_header(void *context, int header_class, char *line; char *next_line; - /* - * Pipe the unmodified message header through the header line folding - * routine. - */ - for (line = start = STR(buf); line; line = next_line) { - next_line = split_at(line, '\n'); - output_text(context, REC_TYPE_NORM, line, next_line ? - next_line - line - 1 : strlen(line), offset); - } - /* * Parse the header line, and save copies of recipient addresses in the * appropriate place. */ if (header_class == MIME_HDR_PRIMARY && header_info - && header_info->flags & HDR_OPT_RECIP - && header_info->flags & HDR_OPT_EXTRACT + && (header_info->flags & HDR_OPT_RECIP) + && (header_info->flags & HDR_OPT_EXTRACT) && (state->resent == 0 || (header_info->flags & HDR_OPT_RR))) { if (header_info->flags & HDR_OPT_RR) { rcpt = state->resent_recip; @@ -432,6 +422,16 @@ static void output_header(void *context, int header_class, myfree((char *) addr_list); tok822_free_tree(tree); } + + /* + * Pipe the unmodified message header through the header line folding + * routine. + */ + for (line = start = STR(buf); line; line = next_line) { + next_line = split_at(line, '\n'); + output_text(context, REC_TYPE_NORM, line, next_line ? + next_line - line - 1 : strlen(line), offset); + } } /* enqueue - post one message */ diff --git a/postfix/src/smtpd/smtpd.c b/postfix/src/smtpd/smtpd.c index 797e6d2cc..054817acc 100644 --- a/postfix/src/smtpd/smtpd.c +++ b/postfix/src/smtpd/smtpd.c @@ -720,7 +720,8 @@ static char *extract_addr(SMTPD_STATE *state, SMTPD_TOKEN *arg, * Report trouble. Log a warning only if we are going to sleep+reject so * that attackers can't flood our logfiles. */ - if ((arg->strval[0] == 0 && !allow_empty_addr) || arg->strval[0] == '@') { + if ((arg->strval[0] == 0 && !allow_empty_addr) + || (strict_rfc821 && arg->strval[0] == '@')) { msg_warn("Illegal address syntax from %s in %s command: %s", state->namaddr, state->where, STR(arg->vstrval)); err = "501 Bad address syntax";