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,
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.
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
======================================
</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>
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
.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
.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
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
#include "sys_defs.h"
-#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
#include <string.h>
#ifdef STRCASECMP_IN_STRINGS_H
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
#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);
}
#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);
}
/* 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;
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;
{
while (table->name) {
table->target[0] = get_mail_conf_int(table->name, table->defval,
- table->min, table->max);
+ table->min, table->max);
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++;
}
}
#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);
}
#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);
}
#include <sys_defs.h>
#include <stdlib.h>
-#include <stdio.h> /* sscanf() */
+#include <stdio.h> /* BUFSIZ */
#include <ctype.h>
/* Utility library. */
* 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;
/*
* 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
/* 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
/* 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
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);
}