Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Oct 2009 05:08:44 -0600 (MDT)
From:      "Peter" <fbsdq@peterk.org>
To:        "Kelly Martin" <kellymartin@gmail.com>
Cc:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   RE: changing cron's From: address in emails
Message-ID:  <8b76dbb87253b769509a46ef66b2f01f.squirrel@webmail.pknet.net>

next in thread | raw e-mail | index | archive | help
iH,
  Would this do it?

server:$pwd
/usr/src/usr.sbin/cron
server:$grep -Ri "Cron Daemon" *
cron/do_command.c:                              fprintf(mail, "From: %s
(Cron Daemon)\n", usernm);

Recompile cron?

]Peter[


****************************************************************
Greetings, here's a simple question for the FreeBSD gurus out there. I
have several servers running cron scripts daily for me, and they all
send me e-mail with their output. Regardless of which server it is,
each of these e-mails have the From: address looking exactly the same.
They all say they are from the "Cron Daemon". Fine, but I'd like to
know more clearly which server the cron output is from.

How can I change the From: address of these emails to "Myserver Cron
Daemon" instead? I know cron runs as the user, so it's not immediately
obvious to me how to change the From: field. Already the subject line
says something like "Cron <root@Myserver> ..." but this doesn't stand
out enough for my tired eyes.

thanks,
Kelly






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8b76dbb87253b769509a46ef66b2f01f.squirrel>