]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.4-20070223
authorWietse Venema <wietse@porcupine.org>
Fri, 23 Feb 2007 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:32:58 +0000 (06:32 +0000)
16 files changed:
postfix/HISTORY
postfix/html/postlog.1.html
postfix/html/sendmail.1.html
postfix/man/man1/sendmail.1
postfix/src/global/mail_task.c
postfix/src/global/mail_version.h
postfix/src/master/multi_server.c
postfix/src/master/single_server.c
postfix/src/master/trigger_server.c
postfix/src/postalias/postalias.c
postfix/src/postdrop/postdrop.c
postfix/src/postlog/postlog.c
postfix/src/postmap/postmap.c
postfix/src/postqueue/postqueue.c
postfix/src/postsuper/postsuper.c
postfix/src/sendmail/sendmail.c

index 7df5b84bbc0d15cc9a519d5a2df8e932f32019ba..8c4507f2cda716c9186244a193067a1fe4680327 100644 (file)
@@ -13286,6 +13286,16 @@ Apologies for any names omitted.
        end-of-input" warning messages when "postfix reload" was
        issued on a busy mail server. Files: util/attr_scan*c.
 
+20070223
+
+       Cleanup: syslog_name now works as documented with both
+       daemons and commands (including set-gid commands).  Files:
+       global/mail_task.c postlog/postlog.c, global/mail_version.h,
+       sendmail/sendmail.c, postsuper/postsuper.c, postalias/postalias.c,
+       postmap/postmap.c, postqueue/postqueue.c, postdrop/postdrop.c,
+       master/trigger_server.c, master/single_server.c,
+       master/multi_server.c.
+
 Wish list:
 
        Update message content length when adding/removing headers.
index 4e6182b84f80e7ca850c771e5e401b563cbb16a5..80c8518726d0d791eb1c9f4a2fee353ce834730e 100644 (file)
@@ -29,7 +29,7 @@ POSTLOG(1)                                                          POSTLOG(1)
        The following options are implemented:
 
        <b>-c</b> <i>config</i><b>_</b><i>dir</i>
-              Read the <b>main.cf</b> configuration file  in  the  named
+              Read the <a href="postconf.5.html"><b>main.cf</b></a> configuration file  in  the  named
               directory  instead  of  the  default  configuration
               directory.
 
@@ -50,18 +50,18 @@ POSTLOG(1)                                                          POSTLOG(1)
 
 <b>ENVIRONMENT</b>
        MAIL_CONFIG
-              Directory with the <b>main.cf</b> file.
+              Directory with the <a href="postconf.5.html"><b>main.cf</b></a> file.
 
 <b>CONFIGURATION PARAMETERS</b>
-       The following <b>main.cf</b> parameters are  especially  relevant
+       The following <a href="postconf.5.html"><b>main.cf</b></a> parameters are  especially  relevant
        to this program.
 
        The  text  below  provides  only  a parameter summary. See
        <a href="postconf.5.html"><b>postconf</b>(5)</a> for more details including examples.
 
        <b><a href="postconf.5.html#config_directory">config_directory</a> (see 'postconf -d' output)</b>
-              The default location of  the  Postfix  main.cf  and
-              master.cf configuration files.
+              The default location of  the  Postfix  <a href="postconf.5.html">main.cf</a>  and
+              <a href="master.5.html">master.cf</a> configuration files.
 
        <b><a href="postconf.5.html#syslog_facility">syslog_facility</a> (mail)</b>
               The syslog facility of Postfix logging.
index 527edee80f03c2ff070846940b9c60ac3a228d15..0390a1dc951ee45fe6f122428e1c56777a765183 100644 (file)
@@ -363,7 +363,7 @@ SENDMAIL(1)                                                        SENDMAIL(1)
               The maximal number of  Received:   message  headers
               that is allowed in the primary message headers.
 
-       <b><a href="postconf.5.html#queue_run_delay">queue_run_delay</a> (1000s)</b>
+       <b><a href="postconf.5.html#queue_run_delay">queue_run_delay</a> (version dependent)</b>
               The  time between <a href="QSHAPE_README.html#deferred_queue">deferred queue</a> scans by the queue
               manager.
 
index 43f34a0f38e1310064b43fdb04bed13adb5cc1bf..0b88eca36c862719c385a589a304dc468f858132 100644 (file)
@@ -308,7 +308,7 @@ The delay between attempts to fork() a child process.
 .IP "\fBhopcount_limit (50)\fR"
 The maximal number of Received:  message headers that is allowed
 in the primary message headers.
-.IP "\fBqueue_run_delay (1000s)\fR"
+.IP "\fBqueue_run_delay (version dependent)\fR"
 The time between deferred queue scans by the queue manager.
 .SH "FAST FLUSH CONTROLS"
 .na
index cb52cbd382af4656ce4a5a24dc97c4f25db78d5e..9f2fbc05919d23408b5ff1c709fe1f8f195048fb 100644 (file)
@@ -56,8 +56,10 @@ const char *mail_task(const char *argv0)
        canon_name = vstring_alloc(10);
     if ((slash = strrchr(argv0, '/')) != 0 && slash[1])
        argv0 = slash + 1;
+    /* Setenv()-ed from main.cf, or inherited from master. */
     if ((tag = safe_getenv(CONF_ENV_LOGTAG)) == 0)
-       tag = DEF_SYSLOG_NAME;
+       /* Check main.cf settings directly, in case set-gid. */
+       tag = var_syslog_name ? var_syslog_name : DEF_SYSLOG_NAME;
     vstring_sprintf(canon_name, "%s/%s", tag, argv0);
     return (vstring_str(canon_name));
 }
index 940efae0785d47a42eecadc06340106ab71349ff..f2a3db154966a2b58ae01b847d42c985305f4e15 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      "20070222"
+#define MAIL_RELEASE_DATE      "20070223"
 #define MAIL_VERSION_NUMBER    "2.4"
 
 #ifdef SNAPSHOT
index 06f58c06f461926f488af83adcfcda92f8d2b9f7..c4dbb5c7d78bc85b0d15c219fa02ef5e15444217 100644 (file)
@@ -507,6 +507,7 @@ NORETURN multi_server_main(int argc, char **argv, MULTI_SERVER_FN service,...)
     char   *oval;
     char   *generation;
     int     msg_vstream_needed = 0;
+    int     redo_syslog_init = 0;
 
     /*
      * Process environment options as early as we can.
@@ -582,9 +583,12 @@ NORETURN multi_server_main(int argc, char **argv, MULTI_SERVER_FN service,...)
            service_name = optarg;
            break;
        case 'o':
+           /* XXX Use split_nameval() */
            if ((oval = split_at(optarg, '=')) == 0)
                oval = "";
            mail_conf_update(optarg, oval);
+           if (strcmp(optarg, VAR_SYSLOG_NAME) == 0)
+               redo_syslog_init = 1;
            break;
        case 's':
            if ((socket_count = atoi(optarg)) <= 0)
@@ -619,6 +623,8 @@ NORETURN multi_server_main(int argc, char **argv, MULTI_SERVER_FN service,...)
      * Initialize generic parameters.
      */
     mail_params_init();
+    if (redo_syslog_init)
+       msg_syslog_init(mail_task(var_procname), LOG_PID, LOG_FACILITY);
 
     /*
      * Application-specific initialization.
index 62c366f04b89c031f94e904bb0172b2da1234cc0..7e67eaa570bb25841f0d4447689928a457f4fc44 100644 (file)
@@ -400,6 +400,7 @@ NORETURN single_server_main(int argc, char **argv, SINGLE_SERVER_FN service,...)
     char   *oval;
     char   *generation;
     int     msg_vstream_needed = 0;
+    int     redo_syslog_init = 0;
 
     /*
      * Process environment options as early as we can.
@@ -475,9 +476,12 @@ NORETURN single_server_main(int argc, char **argv, SINGLE_SERVER_FN service,...)
            service_name = optarg;
            break;
        case 'o':
+           /* XXX Use split_nameval() */
            if ((oval = split_at(optarg, '=')) == 0)
                oval = "";
            mail_conf_update(optarg, oval);
+           if (strcmp(optarg, VAR_SYSLOG_NAME) == 0)
+               redo_syslog_init = 1;
            break;
        case 's':
            if ((socket_count = atoi(optarg)) <= 0)
@@ -512,6 +516,8 @@ NORETURN single_server_main(int argc, char **argv, SINGLE_SERVER_FN service,...)
      * Initialize generic parameters.
      */
     mail_params_init();
+    if (redo_syslog_init)
+       msg_syslog_init(mail_task(var_procname), LOG_PID, LOG_FACILITY);
 
     /*
      * Application-specific initialization.
index 77c044f3d9c2be6f86ca07c8a2170d2d9d1175cb..1e0846207a04bef5a16fffdf1d8d9b1ae72f0a80 100644 (file)
@@ -407,6 +407,7 @@ NORETURN trigger_server_main(int argc, char **argv, TRIGGER_SERVER_FN service,..
     char   *oval;
     char   *generation;
     int     msg_vstream_needed = 0;
+    int     redo_syslog_init = 0;
 
     /*
      * Process environment options as early as we can.
@@ -482,9 +483,12 @@ NORETURN trigger_server_main(int argc, char **argv, TRIGGER_SERVER_FN service,..
            service_name = optarg;
            break;
        case 'o':
+           /* XXX Use split_nameval() */
            if ((oval = split_at(optarg, '=')) == 0)
                oval = "";
            mail_conf_update(optarg, oval);
+           if (strcmp(optarg, VAR_SYSLOG_NAME) == 0)
+               redo_syslog_init = 1;
            break;
        case 's':
            if ((socket_count = atoi(optarg)) <= 0)
@@ -519,6 +523,8 @@ NORETURN trigger_server_main(int argc, char **argv, TRIGGER_SERVER_FN service,..
      * Initialize generic parameters.
      */
     mail_params_init();
+    if (redo_syslog_init)
+       msg_syslog_init(mail_task(var_procname), LOG_PID, LOG_FACILITY);
 
     /*
      * Application-specific initialization.
index e50cebdd0f7961bdee95a89b3ca2162a00ec46f2..3a6e5683a8ed5150b156905f1f70069753008de6 100644 (file)
@@ -705,6 +705,8 @@ int     main(int argc, char **argv)
        }
     }
     mail_conf_read();
+    if (strcmp(var_syslog_name, DEF_SYSLOG_NAME) != 0)
+       msg_syslog_init(mail_task(argv[0]), LOG_PID, LOG_FACILITY);
     mail_dict_init();
 
     /*
index aa064c8287ad25851e4c1fa244155df8cd599cda..3bd19c8a4be5b0629932b1c58c57f027d9f3281c 100644 (file)
@@ -286,6 +286,8 @@ int     main(int argc, char **argv)
      * perform some sanity checks on the input.
      */
     mail_conf_read();
+    if (strcmp(var_syslog_name, DEF_SYSLOG_NAME) != 0)
+       msg_syslog_init(mail_task("postdrop"), LOG_PID, LOG_FACILITY);
     get_mail_conf_str_table(str_table);
 
     /*
index da1cbd04e52ef56df30fd16fa6414947d57222c5..ef6d37ea16c9ebdfad4e9f8614f70bd879f79f8f 100644 (file)
@@ -197,6 +197,7 @@ int     main(int argc, char **argv)
     if (isatty(STDERR_FILENO))
        msg_vstream_init(tag, VSTREAM_ERR);
     msg_syslog_init(tag, LOG_PID, LOG_FACILITY);
+    tag = 0;
 
     /*
      * Parse switches.
@@ -225,19 +226,27 @@ int     main(int argc, char **argv)
        }
     }
 
-    /*
-     * Re-initialize the logging, this time with the user-specified tag and
-     * severity level.
-     */
-    if (isatty(STDERR_FILENO))
-       msg_vstream_init(tag, VSTREAM_ERR);
-    msg_syslog_init(tag, log_flags, LOG_FACILITY);
-
     /*
      * Process the main.cf file. This overrides any logging facility that was
      * specified with msg_syslog_init();
      */
     mail_conf_read();
+    if (tag == 0 && strcmp(var_syslog_name, DEF_SYSLOG_NAME) != 0) {
+       if ((slash = strrchr(argv[0], '/')) != 0 && slash[1])
+           tag = mail_task(slash + 1);
+       else
+           tag = mail_task(argv[0]);
+    }
+
+    /*
+     * Re-initialize the logging, this time with the tag specified in main.cf
+     * or on the command line.
+     */
+    if (tag != 0) {
+       if (isatty(STDERR_FILENO))
+           msg_vstream_init(tag, VSTREAM_ERR);
+       msg_syslog_init(tag, LOG_PID, LOG_FACILITY);
+    }
 
     /*
      * Log the command line or log lines from standard input.
index e8ba1469513301dacfabeee3b9272c2caefa321e..d2f15684ad36191e3a0788e5f893dbed51f4843b 100644 (file)
@@ -650,6 +650,8 @@ int     main(int argc, char **argv)
        }
     }
     mail_conf_read();
+    if (strcmp(var_syslog_name, DEF_SYSLOG_NAME) != 0)
+       msg_syslog_init(mail_task(argv[0]), LOG_PID, LOG_FACILITY);
     mail_dict_init();
 
     /*
index c26f4a3fcc090d89c269d8a352fbdf37ffd3343a..8013277bef4465b2dfdc09c36874d6f6a0f15107 100644 (file)
@@ -519,6 +519,8 @@ int     main(int argc, char **argv)
      * Further initialization...
      */
     mail_conf_read();
+    if (strcmp(var_syslog_name, DEF_SYSLOG_NAME) != 0)
+       msg_syslog_init(mail_task("postqueue"), LOG_PID, LOG_FACILITY);
     mail_dict_init();                          /* proxy, sql, ldap */
     get_mail_conf_str_table(str_table);
 
index 2f9622d9092e0a07119d796f7e2c1e941a5274e6..a8bcedde824f058e36b7bd9401f287130680ea96 100644 (file)
@@ -1138,6 +1138,8 @@ int     main(int argc, char **argv)
      * configuration directory location.
      */
     mail_conf_read();
+    if (strcmp(var_syslog_name, DEF_SYSLOG_NAME) != 0)
+       msg_syslog_init(mail_task(argv[0]), LOG_PID, LOG_FACILITY);
     if (chdir(var_queue_dir))
        msg_fatal("chdir %s: %m", var_queue_dir);
 
index 6e2d284e7eb16c20869f6ce0918665f61d07c8bf..242896e2477ae14f53a468a29ca6ebc0cd5c9833 100644 (file)
 /* .IP "\fBhopcount_limit (50)\fR"
 /*     The maximal number of Received:  message headers that is allowed
 /*     in the primary message headers.
-/* .IP "\fBqueue_run_delay (1000s)\fR"
+/* .IP "\fBqueue_run_delay (version dependent)\fR"
 /*     The time between deferred queue scans by the queue manager.
 /* FAST FLUSH CONTROLS
 /* .ad
@@ -1008,6 +1008,8 @@ int     main(int argc, char **argv)
     }
     optind = saved_optind;
     mail_conf_read();
+    if (strcmp(var_syslog_name, DEF_SYSLOG_NAME) != 0)
+        msg_syslog_init(mail_task("sendmail"), LOG_PID, LOG_FACILITY);
     get_mail_conf_str_table(str_table);
 
     if (chdir(var_queue_dir))