]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-3.3-20180121
authorWietse Venema <wietse@porcupine.org>
Sun, 21 Jan 2018 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <postfix-users@dukhovni.org>
Tue, 23 Jan 2018 18:22:33 +0000 (13:22 -0500)
13 files changed:
postfix/HISTORY
postfix/conf/master.cf
postfix/html/postconf.5.html
postfix/man/man5/postconf.5
postfix/proto/postconf.proto
postfix/src/global/mail_version.h
postfix/src/local/mailbox.c
postfix/src/postconf/postconf.c
postfix/src/postconf/postconf.h
postfix/src/postconf/postconf_builtin.c
postfix/src/util/mac_expand.c
postfix/src/util/mac_expand.in
postfix/src/util/mac_expand.ref

index 23cb174f56c851843da3bc0ba9309cf4cd4feab0..05672bf41824fc33157b70932a7538d53842e30b 100644 (file)
@@ -23297,3 +23297,16 @@ Apologies for any names omitted.
        only to Postfix daemons configured in master.cf; hyperlink
        the parameter name in documentation.  Files: proto/postconf.proto,
        mantools/postlink, daemon manpages.
+
+       Cleanup: allow whitespace between $[{(], parameter name,
+       and [:?)}]. This allows making complex expressions more
+       readable with line breaks. File: util/mac_expand.c.
+
+       Cleanup: don't initialize the service_name parameter with
+       the process_name value.  Files: postconf/postconf.[hc],
+       postconf/postconf_builtin.c.
+
+20180121
+
+       Bugfix (introduced: 20180106): too many arguments for format
+       string. File: local/mailbox.c.
index b67ed5986c61b6c4d9b9849825887b550b030e0f..5a75ae576ad9ea3af6dcef7129d5b90b47663ebc 100644 (file)
@@ -53,6 +53,7 @@ proxymap  unix  -       -       n       -       -       proxymap
 proxywrite unix -       -       n       -       1       proxymap
 smtp      unix  -       -       n       -       -       smtp
 relay     unix  -       -       n       -       -       smtp
+        -o syslog_name=postfix/$service_name
 #       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
 showq     unix  n       -       n       -       -       showq
 error     unix  -       -       n       -       -       error
index 859941dd05beaef558a4f46468ef88733b8b3429..6525088b97b7ef746f66e372583bf683af960f0a 100644 (file)
@@ -10040,9 +10040,27 @@ submit mail into the Postfix queue.
 <DT><b><a name="service_name">service_name</a>
 (read-only)</b></DT><DD>
 
-<p>
-The <a href="master.5.html">master.cf</a> service name of a Postfix daemon process.
-</p>
+<p> The <a href="master.5.html">master.cf</a> service name of a Postfix daemon process. This
+can be used to distinguish the logging from different services that
+use the same program name. </p>
+
+<p> Example <a href="master.5.html">master.cf</a> entries: </p>
+
+<pre>
+# Distinguish inbound MTA logging from submission and smtps logging.
+smtp      inet  n       -       n       -       -       smtpd
+submission inet n       -       n       -       -       smtpd
+    -o <a href="postconf.5.html#syslog_name">syslog_name</a>=postfix/$<a href="postconf.5.html#service_name">service_name</a>
+smtps     inet  n       -       n       -       -       smtpd
+    -o <a href="postconf.5.html#syslog_name">syslog_name</a>=postfix/$<a href="postconf.5.html#service_name">service_name</a>
+</pre>
+
+<pre>
+# Distinguish outbound MTA logging from inbound relay logging.
+smtp      unix  -       -       n       -       -       smtp
+relay     unix  -       -       n       -       -       smtp
+    -o <a href="postconf.5.html#syslog_name">syslog_name</a>=postfix/$<a href="postconf.5.html#service_name">service_name</a>
+</pre>
 
 
 </DD>
index 6336691f653ccc2ad9160d338a6ace44b5e0a3db..6490d99f198914740084d55dcaa8390e2d1b6a22 100644 (file)
@@ -6240,7 +6240,35 @@ A Sendmail compatibility feature that specifies the location of
 the Postfix \fBsendmail\fR(1) command. This command can be used to
 submit mail into the Postfix queue.
 .SH service_name (read\-only)
-The master.cf service name of a Postfix daemon process.
+The master.cf service name of a Postfix daemon process. This
+can be used to distinguish the logging from different services that
+use the same program name.
+.PP
+Example master.cf entries:
+.PP
+.nf
+.na
+.ft C
+# Distinguish inbound MTA logging from submission and smtps logging.
+smtp      inet  n       \-       n       \-       \-       smtpd
+submission inet n       \-       n       \-       \-       smtpd
+    \-o syslog_name=postfix/$service_name
+smtps     inet  n       \-       n       \-       \-       smtpd
+    \-o syslog_name=postfix/$service_name
+.fi
+.ad
+.ft R
+.PP
+.nf
+.na
+.ft C
+# Distinguish outbound MTA logging from inbound relay logging.
+smtp      unix  \-       \-       n       \-       \-       smtp
+relay     unix  \-       \-       n       \-       \-       smtp
+    \-o syslog_name=postfix/$service_name
+.fi
+.ad
+.ft R
 .SH service_throttle_time (default: 60s)
 How long the Postfix \fBmaster\fR(8) waits before forking a server that
 appears to be malfunctioning.
index 1b1363aa53b40a59ef6ea770b13e53a6e705037e..a09abb1a59d7f67bb6fcb0b8fff81889ab77deec 100644 (file)
@@ -8133,9 +8133,27 @@ The process name of a Postfix command or daemon process.
 
 %PARAM service_name read-only
 
-<p>
-The master.cf service name of a Postfix daemon process.
-</p>
+<p> The master.cf service name of a Postfix daemon process. This
+can be used to distinguish the logging from different services that
+use the same program name. </p>
+
+<p> Example master.cf entries: </p>
+
+<pre>
+# Distinguish inbound MTA logging from submission and smtps logging.
+smtp      inet  n       -       n       -       -       smtpd
+submission inet n       -       n       -       -       smtpd
+    -o syslog_name=postfix/$service_name
+smtps     inet  n       -       n       -       -       smtpd
+    -o syslog_name=postfix/$service_name
+</pre>
+
+<pre>
+# Distinguish outbound MTA logging from inbound relay logging.
+smtp      unix  -       -       n       -       -       smtp
+relay     unix  -       -       n       -       -       smtp
+    -o syslog_name=postfix/$service_name
+</pre>
 
 %PARAM process_id read-only
 
index 6a8f2a05b38ea81e914452eafaf750c905bacf75..18b4c59b7da9d64953cf6fd8243541add405d68e 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      "20180114"
+#define MAIL_RELEASE_DATE      "20180121"
 #define MAIL_VERSION_NUMBER    "3.3"
 
 #ifdef SNAPSHOT
index 1fbbd9c77343fc23e5ae75ea793714f968e752b7..d4f01bf714bc829841a884cf0ca0f836a28d4f8a 100644 (file)
@@ -97,7 +97,7 @@ static int deliver_mailbox_file(LOCAL_STATE state, USER_ATTR usr_attr)
     int     deliver_status;
     int     copy_flags;
     VSTRING *biff;
-    off_t    end;
+    off_t   end;
     struct stat st;
     uid_t   spool_uid;
     gid_t   spool_gid;
@@ -202,8 +202,8 @@ static int deliver_mailbox_file(LOCAL_STATE state, USER_ATTR usr_attr)
            msg_warn("specify \"%s = no\" to ignore mailbox ownership mismatch",
                     VAR_STRICT_MBOX_OWNER);
        } else {
-           if ((end = vstream_fseek(mp->fp, (off_t) 0, SEEK_END)) < 0) 
-               msg_fatal("seek mailbox file %s: %m", myname, mailbox);
+           if ((end = vstream_fseek(mp->fp, (off_t) 0, SEEK_END)) < 0)
+               msg_fatal("seek mailbox file %s: %m", mailbox);
            mail_copy_status = mail_copy(COPY_ATTR(state.msg_attr), mp->fp,
                                         copy_flags, "\n", why);
        }
index 44c1d5697bd73191b32e3bed9119d8d614082ff8..9544c0a3a2ac58de3c0acc56e4afbbae05843b0d 100644 (file)
@@ -1000,8 +1000,7 @@ int     main(int argc, char **argv)
        pcf_read_parameters();
        if (override_params)
            pcf_set_parameters(override_params->argv);
-       pcf_register_builtin_parameters(basename(argv[0]), basename(argv[0]),
-                                       getpid());
+       pcf_register_builtin_parameters(basename(argv[0]), getpid());
        pcf_register_service_parameters();
        pcf_register_user_parameters();
        if (pcf_cmd_mode & PCF_MASTER_FLD)
@@ -1054,8 +1053,7 @@ int     main(int argc, char **argv)
            if (override_params)
                pcf_set_parameters(override_params->argv);
        }
-       pcf_register_builtin_parameters(basename(argv[0]), basename(argv[0]),
-                                       getpid());
+       pcf_register_builtin_parameters(basename(argv[0]), getpid());
 
        /*
         * Add service-dependent parameters (service names from master.cf)
index 7f391df68a12b639c1913569fe31763619763261..814e597d3d558f51c0e0b891645bcd2d0ef2683a 100644 (file)
@@ -251,7 +251,7 @@ extern NAME_CODE pcf_field_name_offset[];
  /*
   * postconf_builtin.c.
   */
-extern void pcf_register_builtin_parameters(const char *, const char *, pid_t);
+extern void pcf_register_builtin_parameters(const char *, pid_t);
 
  /*
   * postconf_service.c.
index 311c362da4bf8f61b31271cf0efead654afe4993..a673df134af08b4fb627293c0d338548859d831a 100644 (file)
@@ -6,9 +6,8 @@
 /* SYNOPSIS
 /*     #include <postconf.h>
 /*
-/*     void    pcf_register_builtin_parameters(procname, servname, pid)
+/*     void    pcf_register_builtin_parameters(procname, pid)
 /*     const char *procname;
-/*     const char *servname;
 /*     pid_t   pid;
 /* DESCRIPTION
 /*     pcf_register_builtin_parameters() initializes the global
@@ -18,8 +17,6 @@
 /*     Arguments:
 /*.IP procname
 /*     Provides the default value for the "process_name" parameter.
-/*.IP servname
-/*     Provides the default value for the "service_name" parameter.
 /*.IP pid
 /*     Provides the default value for the "process_id" parameter.
 /* DIAGNOSTICS
@@ -366,8 +363,7 @@ static const char *pcf_conv_long_parameter(void *ptr)
 
 /* pcf_register_builtin_parameters - add built-ins to the global name space */
 
-void    pcf_register_builtin_parameters(const char *procname,
-                                           const char *servname, pid_t pid)
+void    pcf_register_builtin_parameters(const char *procname, pid_t pid)
 {
     const char *myname = "pcf_register_builtin_parameters";
     const CONFIG_TIME_TABLE *ctt;
@@ -450,7 +446,7 @@ void    pcf_register_builtin_parameters(const char *procname,
     PCF_PARAM_TABLE_ENTER(pcf_param_table, pcf_adhoc_procname.name,
                          PCF_PARAM_FLAG_BUILTIN | PCF_PARAM_FLAG_READONLY,
                      (void *) &pcf_adhoc_procname, pcf_conv_str_parameter);
-    pcf_adhoc_servname.defval = mystrdup(servname);
+    pcf_adhoc_servname.defval = mystrdup("");
     PCF_PARAM_TABLE_ENTER(pcf_param_table, pcf_adhoc_servname.name,
                          PCF_PARAM_FLAG_BUILTIN | PCF_PARAM_FLAG_READONLY,
                      (void *) &pcf_adhoc_servname, pcf_conv_str_parameter);
index 8d02f32d98d366ee4c5d309b0d23b7f45b065a50..8ba0071bc57a0d21dfac1f7464a2914ad7dabd15 100644 (file)
@@ -472,21 +472,26 @@ static int mac_expand_callback(int type, VSTRING *buf, void *ptr)
         * Named parameter.
         */
        else {
+           char   *start;
 
            /*
             * Look for the ? or : operator. In case of a syntax error,
             * return without doing damage, and issue a warning instead.
             */
+           start = (cp += strspn(cp, MAC_EXP_WHITESPACE));
            for ( /* void */ ; /* void */ ; cp++) {
-               if ((ch = *cp) == 0) {
+               if ((ch = cp[tmp_len = strspn(cp, MAC_EXP_WHITESPACE)]) == 0) {
+                   *cp = 0;
                    lookup_mode = MAC_EXP_MODE_USE;
                    break;
                }
                if (ch == '?' || ch == ':') {
                    *cp++ = 0;
+                   cp += tmp_len;
                    lookup_mode = MAC_EXP_MODE_TEST;
                    break;
                }
+               ch = *cp;
                if (!ISALNUM(ch) && ch != '_') {
                    MAC_EXP_ERR_RETURN(mc, "attribute name syntax error at: "
                                       "\"...%.*s>>>%.20s\"",
@@ -499,7 +504,7 @@ static int mac_expand_callback(int type, VSTRING *buf, void *ptr)
             * Look up the named parameter. Todo: allow the lookup function
             * to specify if the result is safe for $name expanson.
             */
-           lookup = mc->lookup(vstring_str(buf), lookup_mode, mc->context);
+           lookup = mc->lookup(start, lookup_mode, mc->context);
        }
 
        /*
index 29f78f20fce757f3ccbc32901b0c3007adfa7b93..dbc583c0f808efac3824e98f0035b98e894e44c4 100644 (file)
@@ -1,7 +1,12 @@
 name1 = name1-value
 
+$name1
 $(name1
-$(name )
+$(name1)
+$( name1)
+$(name1 )
+$(na me1)
+${na me1}
 ${${name1} != {}?name 1 defined, |$name1|$name2|}
 ${ ${name1} != {}?name 1 defined, |$name1|$name2|}
 ${ ${name1} ?name 1 defined, |$name1|$name2|}
index 973dc50ba5a55a245dfe8c6fcc4f89a04c168441..9ffcb410fa408effdf37555fefe956f9e476f75c 100644 (file)
@@ -1,19 +1,30 @@
 << name1 = name1-value
 << 
+<< $name1
+stat=0 result=name1-value
 << $(name1
 unknown: warning: truncated macro reference: "$(name1"
 stat=1 result=
-<< $(name )
-unknown: warning: attribute name syntax error at: "...name>>> "
+<< $(name1)
+stat=0 result=name1-value
+<< $( name1)
+stat=0 result=name1-value
+<< $(name1 )
+stat=0 result=name1-value
+<< $(na me1)
+unknown: warning: attribute name syntax error at: "...na>>> me1"
+stat=1 result=
+<< ${na me1}
+unknown: warning: attribute name syntax error at: "...na>>> me1"
 stat=1 result=
 << ${${name1} != {}?name 1 defined, |$name1|$name2|}
 unknown: warning: attribute name syntax error at: "...>>>${name1} != {}?name "
 stat=1 result=
 << ${ ${name1} != {}?name 1 defined, |$name1|$name2|}
-unknown: warning: attribute name syntax error at: "...>>> ${name1} != {}?name"
+unknown: warning: attribute name syntax error at: "... >>>${name1} != {}?name "
 stat=1 result=
 << ${ ${name1} ?name 1 defined, |$name1|$name2|}
-unknown: warning: attribute name syntax error at: "...>>> ${name1} ?name 1 de"
+unknown: warning: attribute name syntax error at: "... >>>${name1} ?name 1 def"
 stat=1 result=
 << ${{$name1} ? {name 1 defined, |$name1|$name2|} : {name 1 undefined, |$name1|$name2|} }
 unknown: warning: "==" or "!="" or "<"" or "<="" or ">="" or ">" expected at: "...$name1}>>>? {name 1 defined, |"
@@ -51,16 +62,13 @@ stat=1 result=
 unknown: warning: "==" or "!="" or "<"" or "<="" or ">="" or ">" expected at: "...text}>>>= {}"
 stat=1 result=
 << ${{${ name1}} == {}}
-unknown: warning: attribute name syntax error at: "...>>> name1"
-stat=1 result=
+stat=0 result=
 << ${name1?{${ name1}}:{${name2}}}
-unknown: warning: attribute name syntax error at: "...>>> name1"
-stat=1 result=
+stat=0 result=name1-value
 << ${name2?{${ name1}}:{${name2}}}
 stat=2 result=
 << ${name2?{${name1}}:{${ name2}}}
-unknown: warning: attribute name syntax error at: "...>>> name2"
-stat=1 result=
+stat=2 result=
 << ${name2:{${name1}}:{${name2}}}
 unknown: warning: unexpected input at: "...${name1}}>>>:{${name2}}"
 stat=1 result=name1-value