From: Wietse Venema Date: Mon, 14 Feb 2005 05:00:00 +0000 (-0500) Subject: postfix-2.2-20050214 X-Git-Tag: v2.2.0-RC1~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e7da522778df0c630d9f708091d23552f25b065;p=thirdparty%2Fpostfix.git postfix-2.2-20050214 --- diff --git a/postfix/HISTORY b/postfix/HISTORY index 47091f3e8..a17d540cb 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -10127,7 +10127,7 @@ Apologies for any names omitted. Workaround: AIX 5.1 getaddrinfo() can't handle a "0" service argument. Instead we specify "1". Files: util/inet_addr_host.c. -20040513 +20050113 Cleanup: now that the over-all structure is proving itself, clean up some internal APIs to increase robustness and get @@ -10138,7 +10138,7 @@ Apologies for any names omitted. This reduces time for checking the Postfix queue. Files: conf/post-install, global/mail_params.h. -20040514 +20050114 Further cleanup: eliminate duplicate IPv6 results when the mynetworks value is generated by Postfix. More documentation @@ -10193,7 +10193,7 @@ Apologies for any names omitted. Milestone: first non-non-production snapshot with TLS. -20040524 +20050124 Workaround: don't send mail to $fallback_relay if Postfix is MX host for the next-hop destination. This is, however, @@ -10268,6 +10268,11 @@ Apologies for any names omitted. command examples. Files: mantools/manlint, mantools/fixman, mantools/postconf2man. +20050205 + + Cleanup: updated the mass-deletion example in the postsuper + manual. + 20050206 Cleanup: don't count a [45]XX SMTP server greeting towards @@ -10350,7 +10355,7 @@ Apologies for any names omitted. mis-behaves when the current entry is deleted. File: tls/tls_scache.c. -20040211 +20050211 Cleanup: the "generics" feature (output address rewriting) is renamed to "generic", for consistency with "canonical" diff --git a/postfix/RELEASE_NOTES b/postfix/RELEASE_NOTES index c8af0e056..69913f62a 100644 --- a/postfix/RELEASE_NOTES +++ b/postfix/RELEASE_NOTES @@ -13,7 +13,10 @@ Major changes with snapshot Postfix-2.2-20050212 When header address rewriting is enabled, Postfix now updates a message header only when at least one address address in that header is modified. Older Postfix versions first parse and then unparse -a header so that there may be subtle changes in formatting. +a header so that there may be subtle changes in formatting, such +as the amount of whitespace between tokens, or in capitalization +of header labels such as FROM:/CC: because they are not replaced +by From:/Cc:. Major changes with snapshot Postfix-2.2-20050211 ================================================ diff --git a/postfix/html/master.5.html b/postfix/html/master.5.html index 744144ab9..18e75f83a 100644 --- a/postfix/html/master.5.html +++ b/postfix/html/master.5.html @@ -73,14 +73,16 @@ MASTER(5) MASTER(5) (and colon) may be omitted. Either host or port may be given in symbolic form (host or service name) or in numeric form (IP address - or port number). - - Examples: a service named 127.0.0.1:smtp - receives mail via the loopback interface - only; and a service named 10025 accepts con- - nections on TCP port 10025 via all inter- - faces configured with the inet_interfaces - parameter. + or port number). Host information may be + enclosed inside "[]", but this form is not + necessary. + + Examples: a service named 127.0.0.1:smtp or + ::1:smtp receives mail via the loopback + interface only; and a service named 10025 + accepts connections on TCP port 10025 via + all interfaces configured with the + inet_interfaces parameter. unix The service listens on a UNIX-domain socket and is accessible for local clients only. diff --git a/postfix/html/postconf.5.html b/postfix/html/postconf.5.html index 382ecee9d..d5c18be3d 100644 --- a/postfix/html/postconf.5.html +++ b/postfix/html/postconf.5.html @@ -2601,9 +2601,12 @@ parameter also controls delivery of mail to user@[ip.address].

-Note: you need to stop and start Postfix when this parameter changes. +Note 1: you need to stop and start Postfix when this parameter changes.

+

Note 2: address information may be enclosed inside [], +but this form is not recommended here.

+

When inet_interfaces specifies just one IPv4 and/or IPv6 address that is not a loopback address, the Postfix SMTP client will use this address as the IP source address for outbound mail. Support @@ -5626,7 +5629,7 @@ IP hosting, but can be a problem on multi-homed firewalls. See the inet_interfaces documentation for more detail.

Note 2: address information may be enclosed inside [], -but this form is not recommended.

+but this form is not recommended here.

@@ -5659,7 +5662,7 @@ IP hosting, but can be a problem on multi-homed firewalls. See the inet_interfaces documentation for more detail.

Note 2: address information may be enclosed inside [], -but this form is not recommended.

+but this form is not recommended here.

diff --git a/postfix/html/postsuper.1.html b/postfix/html/postsuper.1.html index 6eca13e04..c99a3dd34 100644 --- a/postfix/html/postsuper.1.html +++ b/postfix/html/postsuper.1.html @@ -48,7 +48,7 @@ POSTSUPER(1) POSTSUPER(1) mailq | tail +2 | awk 'BEGIN { RS = "" } # $7=sender, $8=recipient1, $9=recipient2 { if ($8 == "user@example.com" && $9 == "") - print $1 } + print $1 } ' | tr -d '*!' | postsuper -d - Specify -d ALL to remove all messages; for example, diff --git a/postfix/man/man1/postsuper.1 b/postfix/man/man1/postsuper.1 index 0790904e5..710287b84 100644 --- a/postfix/man/man1/postsuper.1 +++ b/postfix/man/man1/postsuper.1 @@ -47,7 +47,7 @@ mailq | tail +2 | awk \'BEGIN { RS = "" } # $7=sender, $8=recipient1, $9=recipient2 .ti +4 { if ($8 == "user@example.com" && $9 == "") -.ti +6 +.ti +10 print $1 } .br \' | tr -d '*!' | postsuper -d - diff --git a/postfix/man/man5/master.5 b/postfix/man/man5/master.5 index e046e8909..832b7a535 100644 --- a/postfix/man/man5/master.5 +++ b/postfix/man/man5/master.5 @@ -69,8 +69,11 @@ the host and port on which new connections should be accepted. The host part (and colon) may be omitted. Either host or port may be given in symbolic form (host or service name) or in numeric form (IP address or port number). +Host information may be enclosed inside "[]", but this form +is not necessary. .sp -Examples: a service named \fB127.0.0.1:smtp\fR receives +Examples: a service named \fB127.0.0.1:smtp\fR or \fB::1:smtp\fR +receives mail via the loopback interface only; and a service named \fB10025\fR accepts connections on TCP port 10025 via all interfaces configured with the \fBinet_interfaces\fR diff --git a/postfix/man/man5/postconf.5 b/postfix/man/man5/postconf.5 index 73e5ec985..481ba0e1f 100644 --- a/postfix/man/man5/postconf.5 +++ b/postfix/man/man5/postconf.5 @@ -1333,7 +1333,10 @@ interfaces (default), and "loopback-only" to receive mail on loopback network interfaces only (Postfix 2.2 and later). The parameter also controls delivery of mail to user@[ip.address]. .PP -Note: you need to stop and start Postfix when this parameter changes. +Note 1: you need to stop and start Postfix when this parameter changes. +.PP +Note 2: address information may be enclosed inside [], +but this form is not recommended here. .PP When inet_interfaces specifies just one IPv4 and/or IPv6 address that is not a loopback address, the Postfix SMTP client will use @@ -3086,7 +3089,7 @@ IP hosting, but can be a problem on multi-homed firewalls. See the inet_interfaces documentation for more detail. .PP Note 2: address information may be enclosed inside [], -but this form is not recommended. +but this form is not recommended here. .SH smtp_bind_address6 (default: empty) An optional numerical network address that the SMTP client should bind to when making an IPv6 connection. @@ -3113,7 +3116,7 @@ IP hosting, but can be a problem on multi-homed firewalls. See the inet_interfaces documentation for more detail. .PP Note 2: address information may be enclosed inside [], -but this form is not recommended. +but this form is not recommended here. .SH smtp_connect_timeout (default: 30s) The SMTP client time limit for completing a TCP connection, or zero (use the operating system built-in time limit). diff --git a/postfix/proto/master b/postfix/proto/master index bc037dfa9..255ae7254 100644 --- a/postfix/proto/master +++ b/postfix/proto/master @@ -63,8 +63,11 @@ # accepted. The host part (and colon) may be omitted. Either # host or port may be given in symbolic form (host or service # name) or in numeric form (IP address or port number). +# Host information may be enclosed inside "[]", but this form +# is not necessary. # .sp -# Examples: a service named \fB127.0.0.1:smtp\fR receives +# Examples: a service named \fB127.0.0.1:smtp\fR or \fB::1:smtp\fR +# receives # mail via the loopback interface only; and a service named # \fB10025\fR accepts connections on TCP port 10025 via # all interfaces configured with the \fBinet_interfaces\fR diff --git a/postfix/proto/postconf.proto b/postfix/proto/postconf.proto index 430ba604c..f6caa1039 100644 --- a/postfix/proto/postconf.proto +++ b/postfix/proto/postconf.proto @@ -1585,9 +1585,12 @@ parameter also controls delivery of mail to user@[ip.address].

-Note: you need to stop and start Postfix when this parameter changes. +Note 1: you need to stop and start Postfix when this parameter changes.

+

Note 2: address information may be enclosed inside [], +but this form is not recommended here.

+

When inet_interfaces specifies just one IPv4 and/or IPv6 address that is not a loopback address, the Postfix SMTP client will use this address as the IP source address for outbound mail. Support @@ -3381,7 +3384,7 @@ IP hosting, but can be a problem on multi-homed firewalls. See the inet_interfaces documentation for more detail.

Note 2: address information may be enclosed inside [], -but this form is not recommended.

+but this form is not recommended here.

%PARAM smtp_bind_address6 @@ -3410,7 +3413,7 @@ IP hosting, but can be a problem on multi-homed firewalls. See the inet_interfaces documentation for more detail.

Note 2: address information may be enclosed inside [], -but this form is not recommended.

+but this form is not recommended here.

%PARAM smtp_connection_cache_time_limit 2s diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index 623eaac40..7303514ee 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. */ -#define MAIL_RELEASE_DATE "20050212" +#define MAIL_RELEASE_DATE "20050214" #define MAIL_VERSION_NUMBER "2.2" #define VAR_MAIL_VERSION "mail_version" diff --git a/postfix/src/master/master.c b/postfix/src/master/master.c index 8e498555f..111be648f 100644 --- a/postfix/src/master/master.c +++ b/postfix/src/master/master.c @@ -289,7 +289,7 @@ int main(int argc, char **argv) * all MTA processes cleanly. Give up if we can't separate from our * parent process. We're not supposed to blow away the parent. */ - if (setsid() == -1) + if (debug_me == 0 && setsid() == -1) msg_fatal("unable to set session and process group ID: %m"); /* diff --git a/postfix/src/master/master_ent.c b/postfix/src/master/master_ent.c index ea6d60b81..bff76d0eb 100644 --- a/postfix/src/master/master_ent.c +++ b/postfix/src/master/master_ent.c @@ -225,8 +225,8 @@ MASTER_SERV *get_master_ent() MASTER_SERV *serv; char *cp; char *name; - char *host; - char *port; + char *host = 0; + char *port = 0; char *transport; int private; int unprivileged; /* passed on to child */ @@ -323,7 +323,6 @@ MASTER_SERV *get_master_ent() serv->listen_fd_count = MASTER_INET_ADDRLIST(serv)->used; } MASTER_INET_PORT(serv) = mystrdup(port); - myfree(atmp); } else if (STR_SAME(transport, MASTER_XPORT_NAME_UNIX)) { serv->type = MASTER_SERV_TYPE_UNIX; serv->listen_fd_count = 1; @@ -349,9 +348,39 @@ MASTER_SERV *get_master_ent() * attributes such as privacy. */ if (serv->type == MASTER_SERV_TYPE_INET) { + MAI_HOSTADDR_STR host_addr; + MAI_SERVPORT_STR serv_port; + struct addrinfo *res0; + if (private) fatal_with_context("inet service cannot be private"); - serv->name = mystrdup(name); +#ifdef SNAPSHOT + if (*host == 0) + host = 0; + /* Canonicalize numeric host and numeric or symbolic service. */ + if (hostaddr_to_sockaddr(host, port, 0, &res0) == 0) { + SOCKADDR_TO_HOSTADDR(res0->ai_addr, res0->ai_addrlen, + host ? &host_addr : (MAI_HOSTADDR_STR *) 0, + &serv_port, 0); + serv->name = (host ? concatenate("[", host_addr.buf, "]:", + serv_port.buf, (char *) 0) : + mystrdup(serv_port.buf)); + freeaddrinfo(res0); + } + /* Canonicalize numeric or symbolic service. */ + else if (hostaddr_to_sockaddr((char *) 0, port, 0, &res0) == 0) { + SOCKADDR_TO_HOSTADDR(res0->ai_addr, res0->ai_addrlen, + (MAI_HOSTADDR_STR *) 0, &serv_port, 0); + serv->name = (host ? concatenate("[", host, "]:", + serv_port.buf, (char *) 0) : + mystrdup(serv_port.buf)); + freeaddrinfo(res0); + } + /* Bad service name? */ + else +#endif + serv->name = mystrdup(name); + myfree(atmp); } else if (serv->type == MASTER_SERV_TYPE_UNIX) { serv->name = mail_pathname(private ? MAIL_CLASS_PRIVATE : MAIL_CLASS_PUBLIC, name); diff --git a/postfix/src/postsuper/postsuper.c b/postfix/src/postsuper/postsuper.c index eba72e685..633e0a42a 100644 --- a/postfix/src/postsuper/postsuper.c +++ b/postfix/src/postsuper/postsuper.c @@ -41,7 +41,7 @@ /* # $7=sender, $8=recipient1, $9=recipient2 /* .ti +4 /* { if ($8 == "user@example.com" && $9 == "") -/* .ti +6 +/* .ti +10 /* print $1 } /* .br /* \' | tr -d '*!' | postsuper -d - diff --git a/postfix/src/smtp/smtp_proto.c b/postfix/src/smtp/smtp_proto.c index 3f87513df..b95e7aa27 100644 --- a/postfix/src/smtp/smtp_proto.c +++ b/postfix/src/smtp/smtp_proto.c @@ -32,11 +32,11 @@ /* /* smtp_rset() sends a single RSET command and waits for the /* response. In case of no response, or negative response, it -/* turns off caching for the current session. +/* turns off connection caching. /* /* smtp_quit() sends a single QUIT command and waits for the -/* response if configured to do so. It always turns off caching -/* for the current session. +/* response if configured to do so. It always turns off connection +/* caching. /* DIAGNOSTICS /* smtp_helo(), smtp_xfer(), smtp_rset() and smtp_quit() return /* 0 in case of success, -1 in case of failure. For smtp_xfer(), @@ -757,7 +757,7 @@ static void smtp_header_rewrite(void *context, int header_class, addr_list = tok822_grep(tree, TOK822_ADDR); for (tpp = addr_list; *tpp; tpp++) did_rewrite |= smtp_map11_tree(tpp[0], smtp_generic_maps, - smtp_ext_prop_mask & EXT_PROP_GENERIC); + smtp_ext_prop_mask & EXT_PROP_GENERIC); if (did_rewrite) { vstring_sprintf(buf, "%s: ", header_info->name); tok822_externalize(buf, tree, TOK822_STR_HEAD); @@ -780,6 +780,8 @@ static void smtp_header_rewrite(void *context, int header_class, * possible (without rearranging the order of addresses). Prepending * white space to the beginning of lines is delegated to the output * routine. + * + * Code derived from cleanup_fold_header(). */ for (line = start = vstring_str(buf); line != 0; line = next_line) { end_line = line + strcspn(line, "\n"); @@ -798,6 +800,8 @@ static void smtp_header_rewrite(void *context, int header_class, * rewriting machinery. Just like smtp_header_out(), this code destroys * the header. We could try to avoid clobbering it, but we're not going * to use the data any further. + * + * Code derived from cleanup_out_header(). */ for (line = start = vstring_str(buf); line != 0; line = next_line) { next_line = split_at(line, '\n'); diff --git a/postfix/src/smtpd/smtpd_check.c b/postfix/src/smtpd/smtpd_check.c index 1b7543701..786df955e 100644 --- a/postfix/src/smtpd/smtpd_check.c +++ b/postfix/src/smtpd/smtpd_check.c @@ -3208,6 +3208,7 @@ static int generic_checks(SMTPD_STATE *state, ARGV *restrictions, DEFER_IF_REJECT2(state, MAIL_ERROR_POLICY, "450 <%s>: %s rejected: defer_if_reject requested", reply_name, reply_class); +#ifdef SNAPSHOT } else if (strcasecmp(name, SLEEP) == 0) { if (cpp[1] == 0 || alldig(cpp[1]) == 0) { msg_warn("restriction %s must be followed by number", SLEEP); @@ -3215,6 +3216,7 @@ static int generic_checks(SMTPD_STATE *state, ARGV *restrictions, MAIL_ERROR_SOFTWARE, "451 Server configuration error")); } else sleep(atoi(*++cpp)); +#endif } /*