of day) to reach completion, in case a message is submitted
by a really long-running program. File: postsuper/postsuper.c.
- [initially released as part of postfix-2020XXXX-nonprod]
Cleanup: postsuper manpage indentation, word abbreviation.
Files: mantools/postlink, postsuper/postsuper.c.
+
+20200202
+
+ Cleanup: nags about strcpy()/sprintf() from naive checkers.
+ Files: global/mail_conf_int.c, global/mail_conf_long.c,
+ global/mail_conf_nint.c, global/mail_conf_time.c,
+ global/maillog_client.c, util/mymalloc.c.
+
+ Documentation: rephrased the postconf(5) manual page entry
+ for milter_default_action. File: proto/postconf.proto.
+
+ Bugfix (introduced: Postfix 2.5): Milter SMTP connect event
+ macros were evaluated before the Postfix-to-Milter connection
+ had been negotiated. Problem reported by David Bürgin.
+ Files: milter/milter.h, milter/milter.c, milter/milter8.c
Support to force-expire email messages. This introduces new
postsuper(1) command-line options to request expiration, and
-additional information in mailq command output.
+additional information in mailq(1) or postqueue(1) output.
The forced-to-expire status is stored in a queue file attribute.
An expired message is returned to the sender when the queue manager
a message if it is in the hold queue. With -e, such a message would
not be returned to the sender until it is released with -f or -H.
-In the mailq(1) default output, a forced-to-expire message is
-indicated with # after the queue name. In mailq(1) JSON output there
-is a new per-message field "forced_expire" with the value true or
-false.
+In the mailq(1) or postqueue(1) -p output, a forced-to-expire message
+is indicated with # after the queue name. In postqueue(1) JSON
+output, there is a new per-message field "forced_expire" (with
+value true or false) that shows the forced-to-expire status.
Incompatible changes with snapshot 20191109
===========================================
<DT><b><a name="milter_default_action">milter_default_action</a>
(default: tempfail)</b></DT><DD>
-<p> The default action when a Milter (mail filter) application is
-unavailable or mis-configured. Specify one of the following: </p>
+<p> The default action when a Milter (mail filter) response is
+unavailable (for example, bad Postfix configuration or Milter
+failure). Specify one of the following: </p>
<dl compact>
.PP
This feature is available in Postfix 2.3 and later.
.SH milter_default_action (default: tempfail)
-The default action when a Milter (mail filter) application is
-unavailable or mis\-configured. Specify one of the following:
+The default action when a Milter (mail filter) response is
+unavailable (for example, bad Postfix configuration or Milter
+failure). Specify one of the following:
.IP "accept"
Proceed as if the mail filter was not present.
.br
%PARAM milter_default_action tempfail
-<p> The default action when a Milter (mail filter) application is
-unavailable or mis-configured. Specify one of the following: </p>
+<p> The default action when a Milter (mail filter) response is
+unavailable (for example, bad Postfix configuration or Milter
+failure). Specify one of the following: </p>
<dl compact>
/* IBM T.J. Watson Research
/* P.O. Box 704
/* Yorktown Heights, NY 10598, USA
+/*
+/* Wietse Venema
+/* Google, Inc.
+/* 111 8th Avenue
+/* New York, NY 10011, USA
/*--*/
/* System library. */
void set_mail_conf_int(const char *name, int value)
{
+ const char myname[] = "set_mail_conf_int";
char buf[BUFSIZ]; /* yeah! crappy code! */
+#ifndef NO_SNPRINTF
+ ssize_t ret;
+
+ ret = snprintf(buf, sizeof(buf), "%d", value);
+ if (ret < 0)
+ msg_panic("%s: output error for %%d", myname);
+ if (ret >= sizeof(buf))
+ msg_panic("%s: output for %%d exceeds space %ld",
+ myname, (long) sizeof(buf));
+#else
sprintf(buf, "%d", value); /* yeah! more crappy code! */
+#endif
mail_conf_update(name, buf);
}
/* IBM T.J. Watson Research
/* P.O. Box 704
/* Yorktown Heights, NY 10598, USA
+/*
+/* Wietse Venema
+/* Google, Inc.
+/* 111 8th Avenue
+/* New York, NY 10011, USA
/*--*/
/* System library. */
void set_mail_conf_long(const char *name, long value)
{
+ const char myname[] = "set_mail_conf_long";
char buf[BUFSIZ]; /* yeah! crappy code! */
+#ifndef NO_SNPRINTF
+ ssize_t ret;
+
+ ret = snprintf(buf, sizeof(buf), "%ld", value);
+ if (ret < 0)
+ msg_panic("%s: output error for %%ld", myname);
+ if (ret >= sizeof(buf))
+ msg_panic("%s: output for %%ld exceeds space %ld",
+ myname, (long) sizeof(buf));
+#else
sprintf(buf, "%ld", value); /* yeah! more crappy code! */
+#endif
mail_conf_update(name, buf);
}
/* IBM T.J. Watson Research
/* P.O. Box 704
/* Yorktown Heights, NY 10598, USA
+/*
+/* Wietse Venema
+/* Google, Inc.
+/* 111 8th Avenue
+/* New York, NY 10011, USA
/*--*/
/* System library. */
void set_mail_conf_nint_int(const char *name, int value)
{
+ const char myname[] = "set_mail_conf_nint_int";
char buf[BUFSIZ]; /* yeah! crappy code! */
+#ifndef NO_SNPRINTF
+ ssize_t ret;
+
+ ret = snprintf(buf, sizeof(buf), "%d", value);
+ if (ret < 0)
+ msg_panic("%s: output error for %%d", myname);
+ if (ret >= sizeof(buf))
+ msg_panic("%s: output for %%d exceeds space %ld",
+ myname, (long) sizeof(buf));
+#else
sprintf(buf, "%d", value); /* yeah! more crappy code! */
+#endif
mail_conf_update(name, buf);
}
void set_mail_conf_time_int(const char *name, int value)
{
+ const char myname[] = "set_mail_conf_time_int";
char buf[BUFSIZ]; /* yeah! crappy code! */
+#ifndef NO_SNPRINTF
+ ssize_t ret;
+
+ ret = snprintf(buf, sizeof(buf), "%ds", value);
+ if (ret < 0)
+ msg_panic("%s: output error for %%ds", myname);
+ if (ret >= sizeof(buf))
+ msg_panic("%s: output for %%ds exceeds space %ld",
+ myname, (long) sizeof(buf));
+#else
sprintf(buf, "%ds", value); /* yeah! more crappy code! */
+#endif
mail_conf_update(name, buf);
}
* Patches change both the patchlevel and the release date. Snapshots have no
* patchlevel; they change the release date only.
*/
-#define MAIL_RELEASE_DATE "20200202"
+#define MAIL_RELEASE_DATE "20200203"
#define MAIL_VERSION_NUMBER "3.5"
#ifdef SNAPSHOT
* System library.
*/
#include <sys_defs.h>
+#include <stdlib.h>
#include <string.h>
/*
if (msg_verbose)
msg_info("report connect to all milters");
for (resp = 0, m = milters->milter_list; resp == 0 && m != 0; m = m->next) {
+ if (m->connect_on_demand != 0)
+ m->connect_on_demand(m);
any_macros = MILTER_MACRO_EVAL(global_macros, m, milters, conn_macros);
resp = m->conn_event(m, client_name, client_addr, client_port,
addr_family, any_macros);
struct MILTER *next; /* linkage */
struct MILTERS *parent; /* parent information */
struct MILTER_MACROS *macros; /* private macros */
+ void (*connect_on_demand) (struct MILTER *);
const char *(*conn_event) (struct MILTER *, const char *, const char *, const char *, unsigned, ARGV *);
const char *(*helo_event) (struct MILTER *, const char *, int, ARGV *);
const char *(*mail_event) (struct MILTER *, const char **, ARGV *);
#define STR_EQ(x,y) (strcmp((x), (y)) == 0)
#define STR_NE(x,y) (strcmp((x), (y)) != 0)
- /*
- * XXX Sendmail 8 libmilter closes the MTA-to-filter socket when it finds
- * out that the SMTP client has disconnected. Because of this, Postfix
- * has to open a new MTA-to-filter socket for each SMTP client.
- */
-#ifdef LIBMILTER_AUTO_DISCONNECT
- milter8_connect(milter);
-#endif
-
/*
* Report the event.
*/
/*
* Fill in the structure. Note: all strings must be copied.
+ *
+ * XXX Sendmail 8 libmilter closes the MTA-to-filter socket when it finds
+ * out that the SMTP client has disconnected. Because of this, Postfix
+ * has to open a new MTA-to-filter socket for each SMTP client.
*/
milter = (MILTER8 *) mymalloc(sizeof(*milter));
milter->m.name = mystrdup(name);
milter->m.next = 0;
milter->m.parent = parent;
milter->m.macros = 0;
+#ifdef LIBMILTER_AUTO_DISCONNECT
+ milter->m.connect_on_demand = (void (*) (struct MILTER *)) milter8_connect;
+#else
+ milter->m.connect_on_demand = 0;
+#endif
milter->m.conn_event = milter8_conn_event;
milter->m.helo_event = milter8_helo_event;
milter->m.mail_event = milter8_mail_event;
#endif
if ((len = strlen(str) + 1) > SSIZE_T_MAX)
msg_panic("mystrdup: string length >= SSIZE_T_MAX");
- return (strcpy(mymalloc(len), str));
+ return (memcpy(mymalloc(len), str, len));
}
/* mystrndup - save substring to heap */