On 2014-01-19 7:55 AM, Neil Bothwick <[email protected]> wrote:
On Sun, 19 Jan 2014 07:22:30 -0500, Tanstaafl wrote:

I use plus addressing extensively (for mail filtering mostly), but for
the life of me cannot figure out how to get cron emails to have a
different MAILFROM other than just 'root'.

I'd like for each job to have a different MAILFROM... ie:

rkhunter cronjob should be from [email protected], etc...

Anyone know how to do this? I can't believe it isn't possible...

cron mails are sent from the user running the cron job, but some programs
have an option to set the address for any mails they send (not their
stdout that goes through cron). rkhunter is one of these.

Yes, and I have set it, but it doesn't change the MAILFROM.

Here is what I have in /etc/cron.daily/rkhunter:

# Set this to 'yes' if you wish the output to be mailed to you
SEND_EMAIL=yes

# NOTE: the following EMAIL_* variables are only relevant if you set the
# SEND_EMAIL variable to 'yes'
EMAIL_SUBJECT="${HOSTNAME}: rkhunter output"
EMAIL_SENDER="[email protected]"
EMAIL_RECIPIENT="[email protected]"
EMAIL_CMD="|mail -s \"${EMAIL_SUBJECT}\" ${EMAIL_RECIPIENT}"

I get the email, but it says it is from 'root'.

I also tried commenting out entirely the EMAIL_CMD line, but then I don't get the email at all.

So, am I missing something?

Reply via email to