]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.8-20101210
authorWietse Venema <wietse@porcupine.org>
Fri, 10 Dec 2010 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:36:48 +0000 (06:36 +0000)
18 files changed:
postfix/HISTORY
postfix/RELEASE_NOTES
postfix/html/postconf.5.html
postfix/html/postscreen.8.html
postfix/man/man5/postconf.5
postfix/man/man8/postscreen.8
postfix/proto/postconf.proto
postfix/src/global/cfg_parser.c
postfix/src/global/conv_time.c
postfix/src/global/mail_conf_int.c
postfix/src/global/mail_conf_long.c
postfix/src/global/mail_conf_nint.c
postfix/src/global/mail_conf_time.c
postfix/src/global/mail_params.h
postfix/src/global/mail_version.h
postfix/src/postscreen/postscreen.c
postfix/src/postscreen/postscreen_send.c
postfix/src/postscreen/postscreen_state.c

index f4a568d66a635b82c8f8f9358f76eeca529368cb..b7461ec9db156d5c062501f572d3feaad10ae63a 100644 (file)
@@ -16220,7 +16220,7 @@ Apologies for any names omitted.
        ignore the excess recipients and deliver the message.  File:
        cleanup/cleanup_map1n.c.
 
-20101204
+20101205
 
        Cleanup: sache_clnt_create() had an unnecessary data
        dependency on the non-library var_scache_service variable,
@@ -16236,5 +16236,17 @@ Apologies for any names omitted.
 
 20101206
 
-       postscreen hung up due to incorrect output error test. File:
-       postscreen/postscreen_send.c.
+       Bugfix (introduced 20101205): postscreen hung up due to
+       incorrect output error test. File: postscreen/postscreen_send.c.
+
+20101207
+
+       Cleanup: the undisclosed_recipients_header default value
+       is now the empty string. The Internet mail RFCs have supported
+       messages without recipient header for almost 10 years now.
+       File: global/mail_params.h.
+
+       Cleanup: use strtol() instead of sscanf() for consistent
+       handling of out-of-range numbers. Files: global/cfg_parser.c,
+       global/conv_time.c, global/mail_conf_int.c,
+       global/mail_conf_long.c, global/mail_conf_nint.c.
index defa8bcd9398da92023e84a3216f4342ceab3e3a..506400c7909a4ff2d238ab70a4c7eeba44721a32 100644 (file)
@@ -33,6 +33,21 @@ This is supported only when the default value is stress-dependent
 postscreen parameters always evaluate as if the stress value is 
 equal to the empty string.
 
+Incompatibility with snapshot 20101206
+======================================
+
+Postfix by default no longer adds a "To: undisclosed-recipients:;"
+header when no recipient specified in the message header.  The
+Internet mail RFCs have supported messages without recipient header
+for almost 10 years now. 
+
+For backwards compatibility, specify:
+
+/etc/postfix/main.cf
+   To: undisclosed-recipients:;
+
+Note: both the ":" and ";" are required.
+
 Incompatibility with snapshot 20101202
 ======================================
 
index eb150139670a738088c9b16284e8f9b13dbcd96f..447473d1a09e3726cd09cce25b8b0d42e3a98a1f 100644 (file)
@@ -15224,12 +15224,21 @@ The default time unit is s (seconds).
 </DD>
 
 <DT><b><a name="undisclosed_recipients_header">undisclosed_recipients_header</a>
-(default: To: undisclosed-recipients:;)</b></DT><DD>
+(default: see "postconf -d" output)</b></DT><DD>
 
 <p>
 Message header that the Postfix <a href="cleanup.8.html">cleanup(8)</a> server inserts when a
-message contains no To: or Cc: message header. With Postfix 2.4
-and later, specify an empty value to disable this feature.  </p>
+message contains no To: or Cc: message header. With Postfix 2.8
+and later, the default value is empty. With Postfix 2.4-2.7,
+specify an empty value to disable this feature.  </p>
+
+<p> Example: </p>
+
+<pre>
+# Default value before Postfix 2.8.
+# Note: the ":" and ";" are both required.
+<a href="postconf.5.html#undisclosed_recipients_header">undisclosed_recipients_header</a> = To: undisclosed-recipients:;
+</pre>
 
 
 </DD>
index f7d22359d96515aae322aad0936eb7bf7f9621e1..0e11c16c684563bdca820d052ada1dcad619e141 100644 (file)
@@ -55,12 +55,12 @@ POSTSCREEN(8)                                                    POSTSCREEN(8)
        Problems and transactions are logged to <b>syslogd</b>(8).
 
 <b>BUGS</b>
-       The <a href="postscreen.8.html"><b>postscreen</b>(8)</a> built-in SMTP protocol engine  does  not
-       announce  support for STARTTLS, AUTH, XCLIENT or XFORWARD.
-       Support for STARTTLS and AUTH may be added in the  future.
-       In  the  mean  time,  if  you  need to make these services
-       available on port 25, then  do  not  enable  the  optional
-       "after 220 server greeting" tests.
+       The <a href="postscreen.8.html"><b>postscreen</b>(8)</a> built-in SMTP protocol engine  currently
+       does  not  announce support for STARTTLS, AUTH, XCLIENT or
+       XFORWARD.  Support for STARTTLS and AUTH may be  added  in
+       the  future.   In the mean time, if you need to make these
+       services available on port 25,  then  do  not  enable  the
+       optional "after 220 server greeting" tests.
 
        The  optional  "after  220  server greeting" tests involve
        <a href="postscreen.8.html"><b>postscreen</b>(8)</a>'s built-in SMTP protocol engine. When  these
index f46bab9d292bad2a8c6c9e9f64dae057edf94932..3e7023f9e2f22805987a6da0441e9f3fd5fc5ff8 100644 (file)
@@ -9656,10 +9656,23 @@ load.
 .PP
 Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
 The default time unit is s (seconds).
-.SH undisclosed_recipients_header (default: To: undisclosed-recipients:;)
+.SH undisclosed_recipients_header (default: see "postconf -d" output)
 Message header that the Postfix \fBcleanup\fR(8) server inserts when a
-message contains no To: or Cc: message header. With Postfix 2.4
-and later, specify an empty value to disable this feature.
+message contains no To: or Cc: message header. With Postfix 2.8
+and later, the default value is empty. With Postfix 2.4-2.7,
+specify an empty value to disable this feature.
+.PP
+Example:
+.PP
+.nf
+.na
+.ft C
+# Default value before Postfix 2.8.
+# Note: the ":" and ";" are both required.
+undisclosed_recipients_header = To: undisclosed-recipients:;
+.fi
+.ad
+.ft R
 .SH unknown_address_reject_code (default: 450)
 The numerical Postfix SMTP server response code when a sender or
 recipient address is rejected by the reject_unknown_sender_domain
index b4cebec67cfc6618484f408f1e57433223b9782c..7ff72096d4c7ec3885672149fe85b7be487be5a0 100644 (file)
@@ -60,8 +60,9 @@ Problems and transactions are logged to \fBsyslogd\fR(8).
 .SH BUGS
 .ad
 .fi
-The \fBpostscreen\fR(8) built-in SMTP protocol engine does
-not announce support for STARTTLS, AUTH, XCLIENT or XFORWARD.
+The \fBpostscreen\fR(8) built-in SMTP protocol engine
+currently does not announce support for STARTTLS, AUTH,
+XCLIENT or XFORWARD.
 Support for STARTTLS and AUTH may be added in the future.
 In the mean time, if you need to make these services available
 on port 25, then do not enable the optional "after 220
index 5e2b9f216c87be05c519b8e065a6225b87c3b205..cb9fe1bf4c135b64734fd7c40e2c40a29859c86d 100644 (file)
@@ -8150,12 +8150,21 @@ delivery is requested with "<b>sendmail -v</b>".
 This feature is available in Postfix 2.1 and later.
 </p>
 
-%PARAM undisclosed_recipients_header To: undisclosed-recipients:;
+%PARAM undisclosed_recipients_header see "postconf -d" output
 
 <p>
 Message header that the Postfix cleanup(8) server inserts when a
-message contains no To: or Cc: message header. With Postfix 2.4
-and later, specify an empty value to disable this feature.  </p>
+message contains no To: or Cc: message header. With Postfix 2.8
+and later, the default value is empty. With Postfix 2.4-2.7,
+specify an empty value to disable this feature.  </p>
+
+<p> Example: </p>
+
+<pre>
+# Default value before Postfix 2.8.
+# Note: the ":" and ";" are both required.
+undisclosed_recipients_header = To: undisclosed-recipients:;
+</pre>
 
 %PARAM unknown_relay_recipient_reject_code 550
 
index 525294889f4203076a991e4299269995229fab29..5495c2994c9dd728ab9f572b7a1064d97dc46490 100644 (file)
@@ -82,7 +82,8 @@
 
 #include "sys_defs.h"
 
-#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
 #include <string.h>
 
 #ifdef STRCASECMP_IN_STRINGS_H
@@ -146,11 +147,14 @@ static int get_dict_int(const struct CFG_PARSER *parser,
                             const char *name, int defval, int min, int max)
 {
     const char *strval;
+    char   *end;
     int     intval;
-    char    junk;
+    long    longval;
 
     if ((strval = (char *) dict_lookup(parser->name, name)) != 0) {
-       if (sscanf(strval, "%d%c", &intval, &junk) != 1)
+       errno = 0;
+       intval = longval = strtol(strval, &end, 10);
+       if (*strval == 0 || *end != 0 || errno == ERANGE || longval != intval)
            msg_fatal("%s: bad numerical configuration: %s = %s",
                      parser->name, name, strval);
     } else
index cbd8050e392bc03347934c91c9be2d0fe1eb744c..4c0c8c506367f919c6145074f3e01a5661814c34 100644 (file)
@@ -41,7 +41,8 @@
 
 #include <sys_defs.h>
 #include <limits.h>                    /* INT_MAX */
-#include <stdio.h>                     /* sscanf() */
+#include <stdlib.h>
+#include <errno.h>
 
 /* Utility library. */
 
 
 int     conv_time(const char *strval, int *timval, int def_unit)
 {
-    char    unit;
-    char    junk;
+    char   *end;
     int     intval;
+    long    longval;
 
-    switch (sscanf(strval, "%d%c%c", &intval, &unit, &junk)) {
-    case 1:
-       unit = def_unit;
-       /* FALLTHROUGH */
-    case 2:
-       if (intval < 0)
+    errno = 0;
+    intval = longval = strtol(strval, &end, 10);
+    if (*strval == 0 || errno == ERANGE || longval != intval || intval < 0
+       || (*end != 0 && end[1] != 0))
+       return (0);
+
+    switch (*end ? *end : def_unit) {
+    case 'w':
+       if (intval < INT_MAX / WEEK) {
+           *timval = intval * WEEK;
+           return (1);
+       } else {
+           return (0);
+       }
+    case 'd':
+       if (intval < INT_MAX / DAY) {
+           *timval = intval * DAY;
+           return (1);
+       } else {
            return (0);
-       switch (unit) {
-       case 'w':
-           if (intval < INT_MAX / WEEK) {
-               *timval = intval * WEEK;
-               return (1);
-           } else {
-               return (0);
-           }
-       case 'd':
-           if (intval < INT_MAX / DAY) {
-               *timval = intval * DAY;
-               return (1);
-           } else {
-               return (0);
-           }
-       case 'h':
-           if (intval < INT_MAX / HOUR) {
-               *timval = intval * HOUR;
-               return (1);
-           } else {
-               return (0);
-           }
-       case 'm':
-           if (intval < INT_MAX / MINUTE) {
-               *timval = intval * MINUTE;
-               return (1);
-           } else {
-               return (0);
-           }
-       case 's':
-           *timval = intval;
+       }
+    case 'h':
+       if (intval < INT_MAX / HOUR) {
+           *timval = intval * HOUR;
            return (1);
+       } else {
+           return (0);
+       }
+    case 'm':
+       if (intval < INT_MAX / MINUTE) {
+           *timval = intval * MINUTE;
+           return (1);
+       } else {
+           return (0);
        }
+    case 's':
+       *timval = intval;
+       return (1);
     }
     return (0);
 }
index 1c2dcba43985a29abe8c0e4f99e758c4139b7cd5..7e944a43617d94dcbba21dd1afdcc362fc496a1d 100644 (file)
@@ -79,7 +79,8 @@
 
 #include <sys_defs.h>
 #include <stdlib.h>
-#include <stdio.h>                     /* sscanf() */
+#include <stdio.h>                     /* BUFSIZ */
+#include <errno.h>
 
 /* Utility library. */
 
 static int convert_mail_conf_int(const char *name, int *intval)
 {
     const char *strval;
-    char    junk;
+    char   *end;
+    long    longval;
 
     if ((strval = mail_conf_lookup_eval(name)) != 0) {
-       if (sscanf(strval, "%d%c", intval, &junk) != 1)
+       errno = 0;
+       *intval = longval = strtol(strval, &end, 10);
+       if (*strval == 0 || *end != 0 || errno == ERANGE || longval != *intval)
            msg_fatal("bad numerical configuration: %s = %s", name, strval);
        return (1);
     }
@@ -132,7 +136,7 @@ int     get_mail_conf_int(const char *name, int defval, int min, int max)
 /* get_mail_conf_int2 - evaluate integer-valued configuration variable */
 
 int     get_mail_conf_int2(const char *name1, const char *name2, int defval,
-                               int min, int max)
+                                  int min, int max)
 {
     int     intval;
     char   *name;
@@ -150,7 +154,7 @@ int     get_mail_conf_int2(const char *name1, const char *name2, int defval,
 typedef int (*stupid_indent_int) (void);
 
 int     get_mail_conf_int_fn(const char *name, stupid_indent_int defval,
-                                 int min, int max)
+                                    int min, int max)
 {
     int     intval;
 
@@ -176,7 +180,7 @@ void    get_mail_conf_int_table(const CONFIG_INT_TABLE *table)
 {
     while (table->name) {
        table->target[0] = get_mail_conf_int(table->name, table->defval,
-                                         table->min, table->max);
+                                            table->min, table->max);
        table++;
     }
 }
@@ -187,7 +191,7 @@ void    get_mail_conf_int_fn_table(const CONFIG_INT_FN_TABLE *table)
 {
     while (table->name) {
        table->target[0] = get_mail_conf_int_fn(table->name, table->defval,
-                                            table->min, table->max);
+                                               table->min, table->max);
        table++;
     }
 }
index e9feaa3ad927f598f5b06c84fc61ee66588366e7..96d2e0d0f262933f99257140fcb951733a032a03 100644 (file)
@@ -79,7 +79,8 @@
 
 #include <sys_defs.h>
 #include <stdlib.h>
-#include <stdio.h>                     /* sscanf() */
+#include <stdio.h>                     /* BUFSIZ */
+#include <errno.h>
 
 /* Utility library. */
 
 static int convert_mail_conf_long(const char *name, long *longval)
 {
     const char *strval;
-    char    junk;
+    char   *end;
 
     if ((strval = mail_conf_lookup_eval(name)) != 0) {
-       if (sscanf(strval, "%ld%c", longval, &junk) != 1)
+       errno = 0;
+       *longval = strtol(strval, &end, 10);
+       if (*strval == 0 || *end != 0 || errno == ERANGE)
            msg_fatal("bad numerical configuration: %s = %s", name, strval);
        return (1);
     }
index 0a2c50ab6475f7a593fc315b70419ccb33be33bc..a14f417847ca92a4662be1e22e8931957bc6a8a9 100644 (file)
@@ -84,7 +84,8 @@
 
 #include <sys_defs.h>
 #include <stdlib.h>
-#include <stdio.h>                     /* sscanf() */
+#include <stdio.h>                     /* BUFSIZ */
+#include <errno.h>
 
 /* Utility library. */
 
 static int convert_mail_conf_nint(const char *name, int *intval)
 {
     const char *strval;
-    char    junk;
+    char   *end;
+    long    longval;
 
     if ((strval = mail_conf_lookup_eval(name)) != 0) {
-       if (sscanf(strval, "%d%c", intval, &junk) != 1)
+       errno = 0;
+       *intval = longval = strtol(strval, &end, 10);
+       if (*strval == 0 || *end != 0 || errno == ERANGE || longval != *intval)
            msg_fatal("bad numerical configuration: %s = %s", name, strval);
        return (1);
     }
index 64523e9da04fc95522090b023610037df8130149..a8fa72f3e3a94514cfeb36cdbb89ce314838557f 100644 (file)
@@ -75,7 +75,7 @@
 
 #include <sys_defs.h>
 #include <stdlib.h>
-#include <stdio.h>                     /* sscanf() */
+#include <stdio.h>                     /* BUFSIZ */
 #include <ctype.h>
 
 /* Utility library. */
index 09b4a7d58081e5b191050c822b4755e8638ac281..c88067ebd569e80900dfe35f029fab634c51d1b1 100644 (file)
@@ -338,7 +338,7 @@ extern char *var_always_bcc;
   * MTAs routinely strip Bcc: headers from message headers.
   */
 #define VAR_RCPT_WITHELD       "undisclosed_recipients_header"
-#define DEF_RCPT_WITHELD       "To: undisclosed-recipients:;"
+#define DEF_RCPT_WITHELD       ""
 extern char *var_rcpt_witheld;
 
  /*
index 8398072a6f6f89561e0313ecff0c993c646eba3f..24aa548efe24f616e570904517485d6a720e6594 100644 (file)
@@ -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      "20101206"
+#define MAIL_RELEASE_DATE      "20101210"
 #define MAIL_VERSION_NUMBER    "2.8"
 
 #ifdef SNAPSHOT
index 88d513343279631f46192b87d3c11a23d1d17a82..958e57f8f12b2bbf9a3fd7ee66f70629c6bd61b6 100644 (file)
@@ -46,8 +46,9 @@
 /* DIAGNOSTICS
 /*     Problems and transactions are logged to \fBsyslogd\fR(8).
 /* BUGS
-/*     The \fBpostscreen\fR(8) built-in SMTP protocol engine does
-/*     not announce support for STARTTLS, AUTH, XCLIENT or XFORWARD.
+/*     The \fBpostscreen\fR(8) built-in SMTP protocol engine
+/*     currently does not announce support for STARTTLS, AUTH,
+/*     XCLIENT or XFORWARD.
 /*     Support for STARTTLS and AUTH may be added in the future.
 /*     In the mean time, if you need to make these services available
 /*     on port 25, then do not enable the optional "after 220
index 4a7b24e317188690869ae8a492081f19aeca22a7..0974537b065f00161a801a4d6c9a243492876fb7 100644 (file)
@@ -21,8 +21,7 @@
 /*     ps_send_reply() sends the specified text to the specified
 /*     remote SMTP client.  In case of an immediate error, it logs
 /*     a warning (except EPIPE) with the client address and port,
-/*     and returns -1 (including EPIPE). Otherwise, the result
-/*     value is the number of bytes sent.
+/*     and returns a non-zero result (all errors including EPIPE).
 /*
 /*     PS_SEND_REPLY() is a convenience wrapper for ps_send_reply().
 /*     It is an unsafe macro that evaluates its arguments multiple
index 729800494380fd2e62c17b1f31c3e683f29772ab..9e092d80052dcee59c967e745e7fdc71c19479e9 100644 (file)
@@ -180,7 +180,7 @@ PS_STATE *ps_new_session_state(VSTREAM *stream,
     if ((ht = htable_locate(ps_client_concurrency, addr)) == 0)
        ht = htable_enter(ps_client_concurrency, addr, (char *) 0);
     ht->value += 1;
-    state->client_concurrency = (int) ht->value;
+    state->client_concurrency = CAST_CHAR_PTR_TO_INT(ht->value);
 
     return (state);
 }