From 66d35350ea78b7da8edee82344c7b1d982409a3d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Marchal?= Date: Tue, 17 Aug 2010 09:00:22 +0000 Subject: [PATCH] Remove the quotes around the MailUtility command to allow the user to call a script or to add more options to the command. The description of the mail_utility configuration option has been amended accordingly. --- email.c | 2 +- sarg.conf | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/email.c b/email.c index 4392e64..43514a5 100644 --- a/email.c +++ b/email.c @@ -258,7 +258,7 @@ int geramail(const char *dirname, int debug, const char *outdir, const char *ema while(fgets(warea,sizeof(warea),fp_top3)!=NULL) fputs(warea,stdout); } else { - snprintf(warea,sizeof(warea),"\"%s\" -s \"SARG %s, %s\" \"%s\" <\"%s\"",MailUtility,_("Report"),asctime(local),email,top3); + snprintf(warea,sizeof(warea),"%s -s \"SARG %s, %s\" \"%s\" <\"%s\"",MailUtility,_("Report"),asctime(local),email,top3); cstatus=system(warea); if (!WIFEXITED(cstatus) || WEXITSTATUS(cstatus)) { debuga(_("command return status %d\n"),WEXITSTATUS(cstatus)); diff --git a/sarg.conf b/sarg.conf index e9bce01..0c05e41 100644 --- a/sarg.conf +++ b/sarg.conf @@ -224,8 +224,19 @@ # #use_comma no -# TAG: mail_utility mail|mailx -# Mail command to use to send reports via SMTP +# TAG: mail_utility +# Mail command to use to send reports via SMTP. Sarg calls it like this: +# mail_utility -s "SARG report, date" "output_email" <"mail_content" +# +# Therefore, it is possible to add more arguments to the command by specifying them +# here. +# +# If you need too, you can use a shell script to process the content of /dev/stdin +# (/dev/stdin is the mail_content passed by sarg to the script) and call whatever +# command you like. It is not limited to mailing the report via SMTP. +# +# Don't forget to quote the command if necessary (i.e. if the path contains +# characters that must be quoted). # #mail_utility mailx -- 2.47.2