aboutsummaryrefslogtreecommitdiff
path: root/src/pies.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2009-10-13 16:53:42 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2009-10-13 16:53:42 +0300
commitc60e857d7f35128b077eac4a30a5900925bb38e8 (patch)
treec9bae66b94b2cfbd7b8869abf1b1dbe34bcf51e9 /src/pies.c
parent8a4ba77068e5d7f6eab2cc1c1c10f31dcbccf7a6 (diff)
downloadpies-c60e857d7f35128b077eac4a30a5900925bb38e8.tar.gz
pies-c60e857d7f35128b077eac4a30a5900925bb38e8.tar.bz2
Bugfixes.
* README: Update. * configure.ac: Change bug-reporting address. * doc/pies.texi: Minor fixes. * src/pies.c: New configuration statements: mailer-program and mailer-command-line. (mailer_program, mailer_command_line) (mailer_argc, mailer_argv): New globals. * src/pies.h (mailer_program, mailer_command_line) (mailer_argc, mailer_argv): New globals. * src/progman.c (destroy_prog): Bugfix: update master program when destroying a retranslator. (send_msg): Several bugfixes. Use mailer_argc, mailer_argv instead of hardcoding sendmail command line. Remove invalid recipient addresses from the resulting command line.
Diffstat (limited to 'src/pies.c')
-rw-r--r--src/pies.c46
1 files changed, 45 insertions, 1 deletions
diff --git a/src/pies.c b/src/pies.c
index 87ddad3..3fcc529 100644
--- a/src/pies.c
+++ b/src/pies.c
@@ -36,6 +36,11 @@ unsigned long shutdown_timeout = 5;
pies_acl_t pies_acl;
limits_record_t pies_limits;
int force_option;
+char *mailer_program = "/usr/sbin/sendmail";
+char *mailer_command_line = "/usr/sbin/sendmail -oi -t";
+int mailer_argc;
+char **mailer_argv;
+
/* Logging */
@@ -1164,6 +1169,18 @@ struct grecs_keyword pies_keywords[] = {
grecs_type_string, &meta1_queue_dir, 0,
NULL,
},
+ {"mailer-program",
+ NULL,
+ N_("Full path to the mailer binary."),
+ grecs_type_string, &mailer_program, 0,
+ NULL
+ },
+ {"mailer-command-line",
+ NULL,
+ N_("Mailer command line (without recipient addresses)."),
+ grecs_type_string, &mailer_command_line, 0,
+ NULL
+ },
{NULL}
};
@@ -1258,6 +1275,7 @@ parse_opt (int key, char *arg, struct argp_state *state)
switch (key)
{
case 't':
+ log_to_stderr = 1;
lint_mode = 1;
break;
@@ -1274,6 +1292,7 @@ parse_opt (int key, char *arg, struct argp_state *state)
exit (0);
case OPT_FOREGROUND:
+ log_to_stderr = 1;
foreground = 1;
break;
@@ -1670,6 +1689,28 @@ remove_pidfile (char *name)
logmsg (LOG_ERR, _("cannot unlink pidfile `%s': %s"),
name, strerror (errno));
}
+
+
+static void
+set_mailer_argcv ()
+{
+ int i;
+ struct wordsplit ws;
+
+ if (wordsplit (mailer_command_line, &ws, WRDSF_DEFFLAGS))
+ {
+ logmsg (LOG_CRIT, _("cannot parse mailer command line: %s"),
+ strerror (errno));
+ exit (EX_CONFIG);
+ }
+ mailer_argc = ws.ws_wordc;
+ mailer_argv = xcalloc (mailer_argc + 1, sizeof (mailer_argv[0]));
+ for (i = 0; i < mailer_argc; i++)
+ mailer_argv[i] = xstrdup (ws.ws_wordv[i]);
+ mailer_argv[i] = NULL;
+ wordsplit_free (&ws);
+}
+
const char version_etc_copyright[] =
/* Do *not* mark this string for translation. %s is a copyright
@@ -1716,7 +1757,8 @@ main (int argc, char **argv)
mf_proctitle_init (argc, argv, environ);
/* Set default logging */
- log_setup (!stderr_closed_p ());
+ log_to_stderr = !stderr_closed_p ();
+ log_setup (log_to_stderr);
config_init ();
argp_program_version_hook = version;
if (argp_parse (&argp, argc, argv, 0, &index, NULL))
@@ -1728,6 +1770,8 @@ main (int argc, char **argv)
if (grecs_parse (conffile))
exit (EX_CONFIG);
+ set_mailer_argcv ();
+
if (lint_mode)
{
progman_build_depmap ();

Return to:

Send suggestions and report system problems to the System administrator.