On Sun, 19 Jan 2014 08:25:16 -0500, Tanstaafl wrote: > > 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="myhost+rkhun...@example.com" > > EMAIL_RECIPIENT="myuser+rkhunter-rep...@example.com" > > EMAIL_CMD="|mail -s \"${EMAIL_SUBJECT}\" ${EMAIL_RECIPIENT}" > > I get the email, but it says it is from 'root'.
I was wrong about rkhunter, it does not support changing the From: header, EMAIL_SENDER is ignored. I worked round this by adding a custom header ot the mails and filtering on that. EMAIL_CMD="|Mail -s \"${EMAIL_SUBJECT}\" -a \"X-Rootkit-Hunter: cron report\" ${EMAIL_RECIPIENT}" -- Neil Bothwick Drive not ready: (R)etry (G)o to Impulse (C)all Engineering
signature.asc
Description: PGP signature