From: Wietse Venema Date: Wed, 12 Oct 2011 05:00:00 +0000 (-0500) Subject: postfix-2.9-20111012 X-Git-Tag: v2.9.0-RC1~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c4cfeea748570ae2782c0912c413418b215eec4d;p=thirdparty%2Fpostfix.git postfix-2.9-20111012 --- diff --git a/postfix/HISTORY b/postfix/HISTORY index 82b8f430e..d58dfe581 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -16958,7 +16958,7 @@ Apologies for any names omitted. 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. + util/sys_defs.h, conf/post-install, proto/postconf.proto. Incompatibility: the default smtp_address_preference value is now "any" instead of "ipv6", meaning choose randomly @@ -16988,3 +16988,19 @@ Apologies for any names omitted. responses from a before-queue content filter as text with bare instead of . Found during code maintenance. File: smtpd/smtpd_proxy.c. + +20111011 + + Cleanup: for consistency with the SMTP standard, the + smtp_line_length_limit default value was increased from 990 + characters to 998 (i.e. 1000 characters including ). + File: global/mail_params.h, proto/postconf.proto. + + Cleanup: the Postfix sendmail command now always transforms + all input lines ending in into UNIX format (lines + ending in ). This simplifies integration with third-party + mail generating applications. Specify "sendmail_fix_line_endings + = strict" to restore historical Postfix behavior (i.e. convert + all input lines ending in only if the first input + line ends in ). Files: sendmail/sendmail.c, + global/mail_params.h, proto/postconf.proto. diff --git a/postfix/RELEASE_NOTES b/postfix/RELEASE_NOTES index 8079b3752..a021021b3 100644 --- a/postfix/RELEASE_NOTES +++ b/postfix/RELEASE_NOTES @@ -14,6 +14,21 @@ 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 201110XX +=========================================== + +For consistency with the SMTP standard, the smtp_line_length_limit +default value was increased from 990 characters to 998 (i.e. 1000 +characters including ). Specify "smtp_line_length_limit = +990" to restore historical Postfix behavior. + +To simplify integration with third-party applications, the Postfix +sendmail command now always transforms all input lines ending in + into UNIX format (lines ending in ). Specify +"sendmail_fix_line_endings = strict" to restore historical Postfix +behavior (i.e. convert all input lines ending in only if +the first line ends in ). + Incompatible changes with snapshot 20110918 =========================================== diff --git a/postfix/WISHLIST b/postfix/WISHLIST index 9a0ca54ef..6e5dc38fd 100644 --- a/postfix/WISHLIST +++ b/postfix/WISHLIST @@ -6,9 +6,26 @@ Wish list: Things to do after the stable release: + TLS_README has the priorities reversed. The section about + SMTP client settings begins with an exposition about client + certificates, which almost no-one needs. Instead, the text + should first explain how to turn on opportunistic TLS. After + that, it can discuss the gory details of higher security + levels for the few people who need it. + + Investigate viability of memcached for applications + that require performance for low-security operations + such as sharing the postscreen cache. + Investigate viability of Sendmail socket maps (the moral equivalent of tcp_table(5)), and dns maps. + Check if FILTER_README has the "postsuper -r" workaround + + Bounces without <> in the plaintext section. Apparently, + some software renders the text as HTML (and therefore + does not render addresses and other text inside <> ). + Make the rules for how to use close-on-exec more explicit. Provide separate timeout control for dict_proxy client, diff --git a/postfix/html/mailq.1.html b/postfix/html/mailq.1.html index c4efe7302..b33a05965 100644 --- a/postfix/html/mailq.1.html +++ b/postfix/html/mailq.1.html @@ -321,6 +321,12 @@ SENDMAIL(1) SENDMAIL(1) summary. See postconf(5) for more details including exam- ples. +COMPATIBILITY CONTROLS + sendmail_fix_line_endings (always) + Controls how the Postfix sendmail command converts + email message line endings from <CR><LF> into UNIX + format (<LF>). + TROUBLE SHOOTING CONTROLS The DEBUG_README file gives examples of how to trouble shoot a Postfix system. @@ -343,14 +349,14 @@ SENDMAIL(1) SENDMAIL(1) ACCESS CONTROLS Available in Postfix version 2.2 and later: - authorized_flush_users (static:anyone) + authorized_flush_users (static:anyone) List of users who are authorized to flush the queue. - authorized_mailq_users (static:anyone) + authorized_mailq_users (static:anyone) List of users who are authorized to view the queue. - authorized_submit_users (static:anyone) + authorized_submit_users (static:anyone) List of users who are authorized to submit mail with the sendmail(1) command (and with the privi- leged postdrop(1) helper command). diff --git a/postfix/html/newaliases.1.html b/postfix/html/newaliases.1.html index c4efe7302..b33a05965 100644 --- a/postfix/html/newaliases.1.html +++ b/postfix/html/newaliases.1.html @@ -321,6 +321,12 @@ SENDMAIL(1) SENDMAIL(1) summary. See postconf(5) for more details including exam- ples. +COMPATIBILITY CONTROLS + sendmail_fix_line_endings (always) + Controls how the Postfix sendmail command converts + email message line endings from <CR><LF> into UNIX + format (<LF>). + TROUBLE SHOOTING CONTROLS The DEBUG_README file gives examples of how to trouble shoot a Postfix system. @@ -343,14 +349,14 @@ SENDMAIL(1) SENDMAIL(1) ACCESS CONTROLS Available in Postfix version 2.2 and later: - authorized_flush_users (static:anyone) + authorized_flush_users (static:anyone) List of users who are authorized to flush the queue. - authorized_mailq_users (static:anyone) + authorized_mailq_users (static:anyone) List of users who are authorized to view the queue. - authorized_submit_users (static:anyone) + authorized_submit_users (static:anyone) List of users who are authorized to submit mail with the sendmail(1) command (and with the privi- leged postdrop(1) helper command). diff --git a/postfix/html/postconf.5.html b/postfix/html/postconf.5.html index 8bed75e0d..5cc674218 100644 --- a/postfix/html/postconf.5.html +++ b/postfix/html/postconf.5.html @@ -8912,6 +8912,35 @@ This feature is available in Postfix 2.3 and later.

+ + +
sendmail_fix_line_endings +(default: always)
+ +

Controls how the Postfix sendmail command converts email message +line endings from <CR><LF> into UNIX format (<LF>). +

+ +
+ +
always
Always convert message lines ending +in <CR><LF>. This setting is the default with Postfix +2.9 and later.
+ +
strict
Convert message lines ending in +<CR><LF> only if the first input line ends in +<CR><LF>. This setting is backwards-compatible with +Postfix 2.8 and earlier.
+ +
never
Never convert message lines ending in +<CR><LF>. This setting exists for completeness only. +
+ +
+ +

This feature is available in Postfix 2.9 and later.

+ +
sendmail_path @@ -9615,18 +9644,21 @@ This feature is available in Postfix 2.1 and later.
smtp_line_length_limit -(default: 990)
+(default: 998)

The maximal length of message header and body lines that Postfix -will send via SMTP. Longer lines are broken by inserting -"<CR><LF><SPACE>". This minimizes the damage to -MIME formatted mail. +will send via SMTP. This limit does not include the <CR><LF> +at the end of each line. Longer lines are broken by inserting +"<CR><LF><SPACE>", to minimize the damage to MIME +formatted mail.

-By default, the line length is limited to 990 characters, because -some server implementations cannot receive mail with long lines. +The Postfix limit of 998 characters not including <CR><LF> +is consistent with the SMTP limit of 1000 characters including +<CR><LF>. The Postfix limit was 990 with Postfix 2.8 +and earlier.

diff --git a/postfix/html/sendmail.1.html b/postfix/html/sendmail.1.html index c4efe7302..b33a05965 100644 --- a/postfix/html/sendmail.1.html +++ b/postfix/html/sendmail.1.html @@ -321,6 +321,12 @@ SENDMAIL(1) SENDMAIL(1) summary. See postconf(5) for more details including exam- ples. +COMPATIBILITY CONTROLS + sendmail_fix_line_endings (always) + Controls how the Postfix sendmail command converts + email message line endings from <CR><LF> into UNIX + format (<LF>). + TROUBLE SHOOTING CONTROLS The DEBUG_README file gives examples of how to trouble shoot a Postfix system. @@ -343,14 +349,14 @@ SENDMAIL(1) SENDMAIL(1) ACCESS CONTROLS Available in Postfix version 2.2 and later: - authorized_flush_users (static:anyone) + authorized_flush_users (static:anyone) List of users who are authorized to flush the queue. - authorized_mailq_users (static:anyone) + authorized_mailq_users (static:anyone) List of users who are authorized to view the queue. - authorized_submit_users (static:anyone) + authorized_submit_users (static:anyone) List of users who are authorized to submit mail with the sendmail(1) command (and with the privi- leged postdrop(1) helper command). diff --git a/postfix/man/man1/sendmail.1 b/postfix/man/man1/sendmail.1 index b7abb31a0..fba4317b9 100644 --- a/postfix/man/man1/sendmail.1 +++ b/postfix/man/man1/sendmail.1 @@ -274,6 +274,14 @@ The following \fBmain.cf\fR parameters are especially relevant to this program. The text below provides only a parameter summary. See \fBpostconf\fR(5) for more details including examples. +.SH "COMPATIBILITY CONTROLS" +.na +.nf +.ad +.fi +.IP "\fBsendmail_fix_line_endings (always)\fR" +Controls how the Postfix sendmail command converts email message +line endings from into UNIX format (). .SH "TROUBLE SHOOTING CONTROLS" .na .nf diff --git a/postfix/man/man5/postconf.5 b/postfix/man/man5/postconf.5 index 98f6fd6bc..a81c2b0e0 100644 --- a/postfix/man/man5/postconf.5 +++ b/postfix/man/man5/postconf.5 @@ -5194,6 +5194,23 @@ For safety reasons, this feature does not allow $number substitutions in regular expression maps. .PP This feature is available in Postfix 2.3 and later. +.SH sendmail_fix_line_endings (default: always) +Controls how the Postfix sendmail command converts email message +line endings from into UNIX format (). +.IP "\fBalways\fR" +Always convert message lines ending +in . This setting is the default with Postfix +2.9 and later. +.IP "\fBstrict\fR" +Convert message lines ending in + only if the first input line ends in +. This setting is backwards-compatible with +Postfix 2.8 and earlier. +.IP "\fBnever\fR" +Never convert message lines ending in +. This setting exists for completeness only. +.PP +This feature is available in Postfix 2.9 and later. .SH sendmail_path (default: see "postconf -d" output) A Sendmail compatibility feature that specifies the location of the Postfix \fBsendmail\fR(1) command. This command can be used to @@ -5599,14 +5616,17 @@ mechanism). Use the native service for hosts not found in the DNS. .PP This feature is available in Postfix 2.1 and later. -.SH smtp_line_length_limit (default: 990) +.SH smtp_line_length_limit (default: 998) The maximal length of message header and body lines that Postfix -will send via SMTP. Longer lines are broken by inserting -"". This minimizes the damage to -MIME formatted mail. -.PP -By default, the line length is limited to 990 characters, because -some server implementations cannot receive mail with long lines. +will send via SMTP. This limit does not include the +at the end of each line. Longer lines are broken by inserting +"", to minimize the damage to MIME +formatted mail. +.PP +The Postfix limit of 998 characters not including +is consistent with the SMTP limit of 1000 characters including +. The Postfix limit was 990 with Postfix 2.8 +and earlier. .SH smtp_mail_timeout (default: 300s) The SMTP client time limit for sending the MAIL FROM command, and for receiving the server response. diff --git a/postfix/proto/postconf.proto b/postfix/proto/postconf.proto index 4abb04d87..f1e25d383 100644 --- a/postfix/proto/postconf.proto +++ b/postfix/proto/postconf.proto @@ -4130,18 +4130,21 @@ mechanism).
This feature is available in Postfix 2.1 and later.

-%PARAM smtp_line_length_limit 990 +%PARAM smtp_line_length_limit 998

The maximal length of message header and body lines that Postfix -will send via SMTP. Longer lines are broken by inserting -"<CR><LF><SPACE>". This minimizes the damage to -MIME formatted mail. +will send via SMTP. This limit does not include the <CR><LF> +at the end of each line. Longer lines are broken by inserting +"<CR><LF><SPACE>", to minimize the damage to MIME +formatted mail.

-By default, the line length is limited to 990 characters, because -some server implementations cannot receive mail with long lines. +The Postfix limit of 998 characters not including <CR><LF> +is consistent with the SMTP limit of 1000 characters including +<CR><LF>. The Postfix limit was 990 with Postfix 2.8 +and earlier.

%PARAM smtp_mail_timeout 300s @@ -14204,3 +14207,28 @@ are required to convert long queue file names into short names:

name changes.

This feature is available in Postfix 2.9 and later.

+ +%PARAM sendmail_fix_line_endings always + +

Controls how the Postfix sendmail command converts email message +line endings from <CR><LF> into UNIX format (<LF>). +

+ +
+ +
always
Always convert message lines ending +in <CR><LF>. This setting is the default with Postfix +2.9 and later.
+ +
strict
Convert message lines ending in +<CR><LF> only if the first input line ends in +<CR><LF>. This setting is backwards-compatible with +Postfix 2.8 and earlier.
+ +
never
Never convert message lines ending in +<CR><LF>. This setting exists for completeness only. +
+ +
+ +

This feature is available in Postfix 2.9 and later.

diff --git a/postfix/src/global/mail_params.h b/postfix/src/global/mail_params.h index f181a65d9..ff2be2ebf 100644 --- a/postfix/src/global/mail_params.h +++ b/postfix/src/global/mail_params.h @@ -1080,9 +1080,9 @@ extern char *var_smtp_helo_name; extern bool var_smtp_rand_addr; #define VAR_SMTP_LINE_LIMIT "smtp_line_length_limit" -#define DEF_SMTP_LINE_LIMIT 990 +#define DEF_SMTP_LINE_LIMIT 998 #define VAR_LMTP_LINE_LIMIT "lmtp_line_length_limit" -#define DEF_LMTP_LINE_LIMIT 990 +#define DEF_LMTP_LINE_LIMIT 998 extern int var_smtp_line_limit; #define VAR_SMTP_PIX_THRESH "smtp_pix_workaround_threshold_time" @@ -3595,6 +3595,17 @@ extern bool var_smtpd_rec_deadline; #define DEF_LMTP_REC_DEADLINE 0 extern bool var_smtp_rec_deadline; + /* + * Postfix sendmail command compatibility features. + */ +#define SM_FIX_EOL_STRICT "strict" +#define SM_FIX_EOL_NEVER "never" +#define SM_FIX_EOL_ALWAYS "always" + +#define VAR_SM_FIX_EOL "sendmail_fix_line_endings" +#define DEF_SM_FIX_EOL SM_FIX_EOL_ALWAYS +extern char *var_sm_fix_eol; + /* LICENSE /* .ad /* .fi diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index e4ace936f..a59d32504 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 "20110930" +#define MAIL_RELEASE_DATE "20111012" #define MAIL_VERSION_NUMBER "2.9" #ifdef SNAPSHOT diff --git a/postfix/src/sendmail/Makefile.in b/postfix/src/sendmail/Makefile.in index 262b9b8f8..805a3f4c8 100644 --- a/postfix/src/sendmail/Makefile.in +++ b/postfix/src/sendmail/Makefile.in @@ -83,6 +83,7 @@ sendmail.o: ../../include/msg_stats.h sendmail.o: ../../include/msg_syslog.h sendmail.o: ../../include/msg_vstream.h sendmail.o: ../../include/mymalloc.h +sendmail.o: ../../include/name_code.h sendmail.o: ../../include/rec_streamlf.h sendmail.o: ../../include/rec_type.h sendmail.o: ../../include/recipient_list.h diff --git a/postfix/src/sendmail/sendmail.c b/postfix/src/sendmail/sendmail.c index 14bd673d7..99059633e 100644 --- a/postfix/src/sendmail/sendmail.c +++ b/postfix/src/sendmail/sendmail.c @@ -260,6 +260,12 @@ /* this program. /* The text below provides only a parameter summary. See /* \fBpostconf\fR(5) for more details including examples. +/* COMPATIBILITY CONTROLS +/* .ad +/* .fi +/* .IP "\fBsendmail_fix_line_endings (always)\fR" +/* Controls how the Postfix sendmail command converts email message +/* line endings from into UNIX format (). /* TROUBLE SHOOTING CONTROLS /* .ad /* .fi @@ -429,6 +435,7 @@ #include #include #include +#include /* Global library. */ @@ -494,12 +501,14 @@ typedef struct SM_STATE { } SM_STATE; /* - * Mail submission ACL + * Mail submission ACL, line-end fixing. */ char *var_submit_acl; +char *var_sm_fix_eol; static const CONFIG_STR_TABLE str_table[] = { VAR_SUBMIT_ACL, DEF_SUBMIT_ACL, &var_submit_acl, 0, 0, + VAR_SM_FIX_EOL, DEF_SM_FIX_EOL, &var_sm_fix_eol, 1, 0, 0, }; @@ -603,7 +612,7 @@ static void enqueue(const int flags, const char *encoding, TOK822 *tp; int rcpt_count = 0; enum { - STRIP_CR_DUNNO, STRIP_CR_DO, STRIP_CR_DONT + STRIP_CR_DUNNO, STRIP_CR_DO, STRIP_CR_DONT, STRIP_CR_ERROR } strip_cr; MAIL_STREAM *handle; VSTRING *postdrop_command; @@ -617,6 +626,12 @@ static void enqueue(const int flags, const char *encoding, const char *errstr; int addr_count; int level; + static NAME_CODE sm_fix_eol_table[] = { + SM_FIX_EOL_ALWAYS, STRIP_CR_DO, + SM_FIX_EOL_STRICT, STRIP_CR_DUNNO, + SM_FIX_EOL_NEVER, STRIP_CR_DONT, + 0, STRIP_CR_ERROR, + }; /* * Access control is enforced in the postdrop command. The code here @@ -791,7 +806,11 @@ static void enqueue(const int flags, const char *encoding, * Process header/body lines. */ skip_from_ = 1; - strip_cr = STRIP_CR_DUNNO; + strip_cr = name_code(sm_fix_eol_table, NAME_CODE_FLAG_STRICT_CASE, + var_sm_fix_eol); + if (strip_cr == STRIP_CR_ERROR) + msg_fatal_status(EX_USAGE, + "invalid %s value: %s", VAR_SM_FIX_EOL, var_sm_fix_eol); for (prev_type = 0; (type = rec_streamlf_get(VSTREAM_IN, buf, var_line_limit)) != REC_TYPE_EOF; prev_type = type) { if (strip_cr == STRIP_CR_DUNNO && type == REC_TYPE_NORM) { @@ -809,7 +828,7 @@ static void enqueue(const int flags, const char *encoding, skip_from_ = 0; } if (strip_cr == STRIP_CR_DO && type == REC_TYPE_NORM) - if (VSTRING_LEN(buf) > 0 && vstring_end(buf)[-1] == '\r') + while (VSTRING_LEN(buf) > 0 && vstring_end(buf)[-1] == '\r') vstring_truncate(buf, VSTRING_LEN(buf) - 1); if ((flags & SM_FLAG_AEOF) && prev_type != REC_TYPE_CONT && VSTRING_LEN(buf) == 1 && *STR(buf) == '.')