From: Wietse Venema Date: Sun, 18 Sep 2011 05:00:00 +0000 (-0500) Subject: postfix-2.9-20110918 X-Git-Tag: v2.9.0-RC1~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b9c1c2eb1b73e4c47219c7d097a4c9d32d9955a5;p=thirdparty%2Fpostfix.git postfix-2.9-20110918 --- diff --git a/postfix/HISTORY b/postfix/HISTORY index b64c69144..5fdedc083 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -16943,3 +16943,33 @@ Apologies for any names omitted. that exist inside the master daemon. Files: master/master.h, master/master_avail.c, master/master_conf.c, master/master_service.c, master/master_spawn.c. + +20110911 + + Debugging: report the request size when memory allocation + fails. File util/mymalloc.c. + +20110914 + + Incompatibility: the default inet_protocols value is now + "all" instead of "ipv4", meaning use both IPv4 and IPv6. + As a compatibility workaround for sites without global IPv6 + connectivity, the commands "make upgrade" and "postfix + upgrade-configuration" append "inet_protocols = ipv4" to + main.cf when no explicit setting is present. This compatibility + workaround will be phased out in a future release. Files: + global/mail_params.h, conf/post-install, proto/postconf.proto. + + Incompatibility: the default smtp_address_preference value + is now "any" instead of "ipv6", meaning choose randomly + between IPv6 and IPv4. With this the Postfix SMTP client + will have more success delivering mail to sites that have + problematic IPv6 configurations. Files: global/mail_params.h, + proto/postconf.proto. + +20110918 + + Workaround for multiple ancient FreeBSD getsockopt() bugs + after non-blocking connect fails with 'host unreachable' + that resulted in a unreasonable memory allocation request. + File: util/vstream_tweak.c. diff --git a/postfix/RELEASE_NOTES b/postfix/RELEASE_NOTES index 3388e2885..8079b3752 100644 --- a/postfix/RELEASE_NOTES +++ b/postfix/RELEASE_NOTES @@ -14,6 +14,24 @@ specifies the release date of a stable release or snapshot release. If you upgrade from Postfix 2.7 or earlier, read RELEASE_NOTES-2.8 before proceeding. +Incompatible changes with snapshot 20110918 +=========================================== + +The following changes were made in default settings, in preparation +for general availability of IPv6: + +- The default inet_protocols value is now "all" instead of "ipv4", + meaning use both IPv4 and IPv6. As a compatibility workaround + for sites without global IPv6 connectivity, the commands "make + upgrade" and "postfix upgrade-configuration" append "inet_protocols + = ipv4" to main.cf when no explicit inet_protocols setting is + present. This workaround will be removed in a future release. + +- The default smtp_address_preference value is now "any" instead + of "ipv6", meaning choose randomly between IPv6 and IPv4. With + this the Postfix SMTP client will have more success delivering + mail to sites that have problematic IPv6 configurations. + Incompatible changes with snapshot 20110321 =========================================== diff --git a/postfix/conf/post-install b/postfix/conf/post-install index 743c69db3..15a674d73 100644 --- a/postfix/conf/post-install +++ b/postfix/conf/post-install @@ -790,6 +790,18 @@ EOF EOF } + # Postfix 2.9. + # Safety net for incompatible changes in IPv6 defaults. This + # requires that the default is "inet_protocols = ipv4" when + # IPv6 support is not compiled in. See util/sys_defs.h. + + test "`$POSTCONF -dh inet_protocols`" = "ipv4" || + test -n "`$POSTCONF -c $config_directory -nh inet_protocols`" || { + echo COMPATIBILITY: editing main.cf, setting inet_protocols=ipv4. + echo Specify inet_protocols explicitly if you want to enable IPv6. + echo In a future release IPv6 will be enabled by default. + $POSTCONF -c $config_directory inet_protocols=ipv4 || exit 1 + } } # A reminder if this is the first time Postfix is being installed. diff --git a/postfix/html/postconf.5.html b/postfix/html/postconf.5.html index 18f375a2f..9f1d76065 100644 --- a/postfix/html/postconf.5.html +++ b/postfix/html/postconf.5.html @@ -3473,7 +3473,7 @@ Examples:
inet_protocols -(default: ipv4)
+(default: all)

The Internet protocols Postfix will attempt to use when making or accepting connections. Specify one or more of "ipv4" @@ -3481,6 +3481,13 @@ or "ipv6", separated by whitespace or commas. The form "all" is equivalent to "ipv4, ipv6" or "ipv4", depending on whether the operating system implements IPv6.

+

With Postfix 2.8 and earlier the default is "ipv4". For backwards +compatibility with these releases, the Postfix 2.9 and later upgrade +procedure appends an explicit "inet_protocols = ipv4" setting to +main.cf when no explicit setting is present. This compatibility +workaround will be phased out as IPv6 deployment becomes more common. +

+

This feature is available in Postfix 2.2 and later.

Note: you MUST stop and start Postfix after changing this @@ -3494,7 +3501,7 @@ IPv6 and IPv4, and each will accept only connections for the corresponding protocol.

When IPv4 support is enabled via the inet_protocols parameter, -Postfix will to DNS type A record lookups, and will convert +Postfix will do DNS type A record lookups, and will convert IPv4-in-IPv6 client IP addresses (::ffff:1.2.3.4) to their original IPv4 form (1.2.3.4). The latter is needed on hosts that pre-date IPV6_V6ONLY support (RFC 3493).

@@ -3511,8 +3518,8 @@ Examples:

-inet_protocols = ipv4 (DEFAULT)
-inet_protocols = all
+inet_protocols = ipv4
+inet_protocols = all (DEFAULT)
 inet_protocols = ipv6
 inet_protocols = ipv4, ipv6
 
@@ -8979,12 +8986,13 @@ This feature is available in Postfix 2.0 and later.
smtp_address_preference -(default: ipv6)
+(default: any)

The address type ("ipv6", "ipv4" or "any") that the Postfix SMTP client will try first, when a destination has IPv6 and IPv4 addresses with equal MX preference. This feature has no effect -unless the inet_protocols setting enables both IPv4 and IPv6.

+unless the inet_protocols setting enables both IPv4 and IPv6. +With Postfix 2.8 the default is "ipv6".

This feature is available in Postfix 2.8 and later.

diff --git a/postfix/man/man5/postconf.5 b/postfix/man/man5/postconf.5 index b1b33649f..7ab27437c 100644 --- a/postfix/man/man5/postconf.5 +++ b/postfix/man/man5/postconf.5 @@ -1964,13 +1964,19 @@ inet_interfaces = 192.168.1.2, 127.0.0.1 .fi .ad .ft R -.SH inet_protocols (default: ipv4) +.SH inet_protocols (default: all) The Internet protocols Postfix will attempt to use when making or accepting connections. Specify one or more of "ipv4" or "ipv6", separated by whitespace or commas. The form "all" is equivalent to "ipv4, ipv6" or "ipv4", depending on whether the operating system implements IPv6. .PP +With Postfix 2.8 and earlier the default is "ipv4". For backwards +compatibility with these releases, the Postfix 2.9 and later upgrade +procedure appends an explicit "inet_protocols = ipv4" setting to +main.cf when no explicit setting is present. This compatibility +workaround will be phased out as IPv6 deployment becomes more common. +.PP This feature is available in Postfix 2.2 and later. .PP Note: you MUST stop and start Postfix after changing this @@ -1984,7 +1990,7 @@ IPv6 and IPv4, and each will accept only connections for the corresponding protocol. .PP When IPv4 support is enabled via the inet_protocols parameter, -Postfix will to DNS type A record lookups, and will convert +Postfix will do DNS type A record lookups, and will convert IPv4-in-IPv6 client IP addresses (::ffff:1.2.3.4) to their original IPv4 form (1.2.3.4). The latter is needed on hosts that pre-date IPV6_V6ONLY support (RFC 3493). @@ -2001,8 +2007,8 @@ Examples: .nf .na .ft C -inet_protocols = ipv4 (DEFAULT) -inet_protocols = all +inet_protocols = ipv4 +inet_protocols = all (DEFAULT) inet_protocols = ipv6 inet_protocols = ipv4, ipv6 .fi @@ -5213,11 +5219,12 @@ The name of the \fBshowq\fR(8) service. This service produces mail queue status reports. .PP This feature is available in Postfix 2.0 and later. -.SH smtp_address_preference (default: ipv6) +.SH smtp_address_preference (default: any) The address type ("ipv6", "ipv4" or "any") that the Postfix SMTP client will try first, when a destination has IPv6 and IPv4 addresses with equal MX preference. This feature has no effect unless the inet_protocols setting enables both IPv4 and IPv6. +With Postfix 2.8 the default is "ipv6". .PP This feature is available in Postfix 2.8 and later. .SH smtp_always_send_ehlo (default: yes) diff --git a/postfix/proto/postconf.proto b/postfix/proto/postconf.proto index 56b36223a..f5f405d9f 100644 --- a/postfix/proto/postconf.proto +++ b/postfix/proto/postconf.proto @@ -1900,7 +1900,7 @@ inet_interfaces = 127.0.0.1, [::1] (Postfix version 2.2 and later) inet_interfaces = 192.168.1.2, 127.0.0.1 -%PARAM inet_protocols ipv4 +%PARAM inet_protocols all

The Internet protocols Postfix will attempt to use when making or accepting connections. Specify one or more of "ipv4" @@ -1908,6 +1908,13 @@ or "ipv6", separated by whitespace or commas. The form "all" is equivalent to "ipv4, ipv6" or "ipv4", depending on whether the operating system implements IPv6.

+

With Postfix 2.8 and earlier the default is "ipv4". For backwards +compatibility with these releases, the Postfix 2.9 and later upgrade +procedure appends an explicit "inet_protocols = ipv4" setting to +main.cf when no explicit setting is present. This compatibility +workaround will be phased out as IPv6 deployment becomes more common. +

+

This feature is available in Postfix 2.2 and later.

Note: you MUST stop and start Postfix after changing this @@ -1921,7 +1928,7 @@ IPv6 and IPv4, and each will accept only connections for the corresponding protocol.

When IPv4 support is enabled via the inet_protocols parameter, -Postfix will to DNS type A record lookups, and will convert +Postfix will do DNS type A record lookups, and will convert IPv4-in-IPv6 client IP addresses (::ffff:1.2.3.4) to their original IPv4 form (1.2.3.4). The latter is needed on hosts that pre-date IPV6_V6ONLY support (RFC 3493).

@@ -1938,8 +1945,8 @@ Examples:

-inet_protocols = ipv4 (DEFAULT)
-inet_protocols = all
+inet_protocols = ipv4
+inet_protocols = all (DEFAULT)
 inet_protocols = ipv6
 inet_protocols = ipv4, ipv6
 
@@ -13138,12 +13145,13 @@ destination with each content_filter value or FILTER action.

This feature is available in Postfix 2.7 and later.

-%PARAM smtp_address_preference ipv6 +%PARAM smtp_address_preference any

The address type ("ipv6", "ipv4" or "any") that the Postfix SMTP client will try first, when a destination has IPv6 and IPv4 addresses with equal MX preference. This feature has no effect -unless the inet_protocols setting enables both IPv4 and IPv6.

+unless the inet_protocols setting enables both IPv4 and IPv6. +With Postfix 2.8 the default is "ipv6".

This feature is available in Postfix 2.8 and later.

diff --git a/postfix/src/cleanup/cleanup_message.c b/postfix/src/cleanup/cleanup_message.c index 08f694ad2..6e2b85a04 100644 --- a/postfix/src/cleanup/cleanup_message.c +++ b/postfix/src/cleanup/cleanup_message.c @@ -821,6 +821,8 @@ static void cleanup_message_headerbody(CLEANUP_STATE *state, int type, /* * Strip unwanted characters. Don't overwrite the input. * + * XXX Possible space+time optimization: use a bitset. + * * XXX Possible optimization: simplify the loop when the "strip" set * contains only one character. * diff --git a/postfix/src/global/mail_params.h b/postfix/src/global/mail_params.h index ebd3c2c7b..f181a65d9 100644 --- a/postfix/src/global/mail_params.h +++ b/postfix/src/global/mail_params.h @@ -3148,7 +3148,7 @@ extern char *var_smtp_body_chks; #define VAR_SMTP_ADDR_PREF "smtp_address_preference" #ifdef HAS_IPV6 -#define DEF_SMTP_ADDR_PREF INET_PROTO_NAME_IPV6 +#define DEF_SMTP_ADDR_PREF INET_PROTO_NAME_ANY #else #define DEF_SMTP_ADDR_PREF INET_PROTO_NAME_IPV4 #endif diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index f737cc081..0bedcb733 100644 --- a/postfix/src/global/mail_version.h +++ b/postfix/src/global/mail_version.h @@ -20,7 +20,7 @@ * Patches change both the patchlevel and the release date. Snapshots have no * patchlevel; they change the release date only. */ -#define MAIL_RELEASE_DATE "20110907" +#define MAIL_RELEASE_DATE "20110918" #define MAIL_VERSION_NUMBER "2.9" #ifdef SNAPSHOT diff --git a/postfix/src/util/mymalloc.c b/postfix/src/util/mymalloc.c index 16df5cc54..be55d0e13 100644 --- a/postfix/src/util/mymalloc.c +++ b/postfix/src/util/mymalloc.c @@ -158,7 +158,8 @@ char *mymalloc(ssize_t len) len += MYMALLOC_FUZZ; #endif if ((real_ptr = (MBLOCK *) malloc(SPACE_FOR(len))) == 0) - msg_fatal("mymalloc: insufficient memory: %m"); + msg_fatal("mymalloc: insufficient memory for %ld bytes: %m", + (long) len); CHECK_OUT_PTR(ptr, real_ptr, len); memset(ptr, FILLER, len); return (ptr); @@ -188,7 +189,8 @@ char *myrealloc(char *ptr, ssize_t len) #endif CHECK_IN_PTR(ptr, real_ptr, old_len, "myrealloc"); if ((real_ptr = (MBLOCK *) realloc((char *) real_ptr, SPACE_FOR(len))) == 0) - msg_fatal("myrealloc: insufficient memory: %m"); + msg_fatal("myrealloc: insufficient memory for %ld bytes: %m", + (long) len); CHECK_OUT_PTR(ptr, real_ptr, len); if (len > old_len) memset(ptr + old_len, FILLER, len - old_len); diff --git a/postfix/src/util/sys_defs.h b/postfix/src/util/sys_defs.h index 757e56c69..764f3c10b 100644 --- a/postfix/src/util/sys_defs.h +++ b/postfix/src/util/sys_defs.h @@ -1337,10 +1337,15 @@ extern int inet_pton(int, const char *, void *); #endif /* - * Defaults for all systems. + * The Postfix 2.9 post-install workaround assumes that the inet_protocols + * default value is "ipv4" when Postfix is compiled without IPv6 support. */ #ifndef DEF_INET_PROTOCOLS -#define DEF_INET_PROTOCOLS "ipv4" +#ifdef HAS_IPV6 +#define DEF_INET_PROTOCOLS INET_PROTO_NAME_ALL +#else +#define DEF_INET_PROTOCOLS INET_PROTO_NAME_IPV4 +#endif #endif /* diff --git a/postfix/src/util/vstream_tweak.c b/postfix/src/util/vstream_tweak.c index 83340d237..166ffc0c8 100644 --- a/postfix/src/util/vstream_tweak.c +++ b/postfix/src/util/vstream_tweak.c @@ -86,7 +86,7 @@ int vstream_tweak_sock(VSTREAM *fp) int vstream_tweak_tcp(VSTREAM *fp) { const char *myname = "vstream_tweak_tcp"; - int mss; + int mss = 0; SOCKOPT_SIZE mss_len = sizeof(mss); int err; @@ -99,6 +99,11 @@ int vstream_tweak_tcp(VSTREAM *fp) * Instead we ask the kernel what the current MSS is, and take appropriate * action. Linux <= 2.2 getsockopt(TCP_MAXSEG) always returns zero (or * whatever value was stored last with setsockopt()). + * + * Some ancient FreeBSD kernels don't report 'host unreachable' errors with + * getsockopt(SO_ERROR), and then treat getsockopt(TCP_MAXSEG) as a NOOP, + * leaving the mss parameter value unchanged. To work around these two + * getsockopt() bugs we set mss = 0, which is a harmless value. */ if ((err = getsockopt(vstream_fileno(fp), IPPROTO_TCP, TCP_MAXSEG, (char *) &mss, &mss_len)) < 0