[illumos-Developer] webrev: 374 cron should send more useful mail
Joshua M. Clulow
josh at sysmgr.org
Mon Oct 25 18:32:42 PDT 2010
On Tue, Oct 26, 2010 at 9:51 AM, Joshua M. Clulow <josh at sysmgr.org> wrote:
> X-Cron-User: leftwing
> X-Cron-Host: thor
> X-Cron-Job-Name: command OR at job number
> X-Cron-Job-Type: cron OR at
New webrev: http://cr.illumos.org/view/bf1fep9g/
New headers are in -- diff from previous webrev:
diff -r 198eec481a5b -r b06baa179835 usr/src/cmd/cron/cron.c
--- a/usr/src/cmd/cron/cron.c Tue Oct 26 04:09:26 2010 -0700
+++ b/usr/src/cmd/cron/cron.c Mon Oct 25 14:27:16 2010 -0700
@@ -2755,13 +2755,7 @@
if (mailpipe == NULL)
exit(127);
(void) fprintf(mailpipe, "To: %s\n", p->name);
+ (void) fprintf(mailpipe, "X-Mailer: cron (%s %s)\n", name.sysname,
+ name.release);
+ (void) fprintf(mailpipe, "X-Cron-User: %s\n", p->name);
+ (void) fprintf(mailpipe, "X-Cron-Host: %s\n", name.nodename);
+ (void) fprintf(mailpipe, "X-Cron-Job-Name: %s\n", pr->jobname);
if (pr->jobtype == CRONEVENT) {
+ (void) fprintf(mailpipe, "X-Cron-Job-Type: cron\n");
if (pr->subject != NULL) {
(void) fprintf(mailpipe, "Subject: %s\n\n",
pr->subject);
@@ -2776,7 +2770,6 @@
(void) fprintf(mailpipe, "%s\n\n", pr->jobname);
}
} else {
+ (void) fprintf(mailpipe, "X-Cron-Job-Type: at\n");
(void) fprintf(mailpipe, "Subject: Output from \"at\" job\n\n");
(void) fprintf(mailpipe, "Your \"at\" job on %s\n",
name.nodename);
--
Joshua M. Clulow
UNIX Admin/Developer
http://blog.sysmgr.org
More information about the Developer
mailing list