0

We have several nearly identical servers with a fairly classic server-NN naming convention, each running cron jobs that we like to monitor via email. There are is a group of users, who receive the email messages from these cron jobs and they all come from:

From: "(Cron Daemon)" <user-x@server-NN.brandle.net>

where user-x is invariant but server-NN changes with each server. I'd like for the emails to come from:

From: "Cron Server-NN" <user-x@server-NN.brandle.net>

I've tried setting the 'full-name' for 'user-x' but that had no effect. There has to be a way to handle this more cleanly.

shodanshok
  • 44,038
  • 6
  • 98
  • 162
Chip Roberson
  • 111
  • 1
  • 4

1 Answers1

1

Most recent versions of cronie can use the MAIFROM variable to set the envelope sender address. This obviously requires that your distribution uses cronie to provide cron.

On distribution non supporting MAILFROM, you can use a shell script to obtain the required behavior. In this case, it will be the shell script that sends the email, rather than cron itself.

For more information, please read here and here.

shodanshok
  • 44,038
  • 6
  • 98
  • 162