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.
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.
<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.
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.
.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
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));
}
* 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
char *oval;
char *generation;
int msg_vstream_needed = 0;
+ int redo_syslog_init = 0;
/*
* Process environment options as early as we can.
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)
* Initialize generic parameters.
*/
mail_params_init();
+ if (redo_syslog_init)
+ msg_syslog_init(mail_task(var_procname), LOG_PID, LOG_FACILITY);
/*
* Application-specific initialization.
char *oval;
char *generation;
int msg_vstream_needed = 0;
+ int redo_syslog_init = 0;
/*
* Process environment options as early as we can.
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)
* Initialize generic parameters.
*/
mail_params_init();
+ if (redo_syslog_init)
+ msg_syslog_init(mail_task(var_procname), LOG_PID, LOG_FACILITY);
/*
* Application-specific initialization.
char *oval;
char *generation;
int msg_vstream_needed = 0;
+ int redo_syslog_init = 0;
/*
* Process environment options as early as we can.
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)
* Initialize generic parameters.
*/
mail_params_init();
+ if (redo_syslog_init)
+ msg_syslog_init(mail_task(var_procname), LOG_PID, LOG_FACILITY);
/*
* Application-specific initialization.
}
}
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();
/*
* 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);
/*
if (isatty(STDERR_FILENO))
msg_vstream_init(tag, VSTREAM_ERR);
msg_syslog_init(tag, LOG_PID, LOG_FACILITY);
+ tag = 0;
/*
* Parse switches.
}
}
- /*
- * 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.
}
}
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();
/*
* 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);
* 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);
/* .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
}
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))