From: Wietse Venema 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).
-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.
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 allThe 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 anyThe 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