1 |
On 2014-01-19 7:55 AM, Neil Bothwick <neil@××××××××××.uk> wrote: |
2 |
> On Sun, 19 Jan 2014 07:22:30 -0500, Tanstaafl wrote: |
3 |
> |
4 |
>> I use plus addressing extensively (for mail filtering mostly), but for |
5 |
>> the life of me cannot figure out how to get cron emails to have a |
6 |
>> different MAILFROM other than just 'root'. |
7 |
>> |
8 |
>> I'd like for each job to have a different MAILFROM... ie: |
9 |
>> |
10 |
>> rkhunter cronjob should be from host+rkhunter@×××××××.com, etc... |
11 |
>> |
12 |
>> Anyone know how to do this? I can't believe it isn't possible... |
13 |
> |
14 |
> cron mails are sent from the user running the cron job, but some programs |
15 |
> have an option to set the address for any mails they send (not their |
16 |
> stdout that goes through cron). rkhunter is one of these. |
17 |
|
18 |
Yes, and I have set it, but it doesn't change the MAILFROM. |
19 |
|
20 |
Here is what I have in /etc/cron.daily/rkhunter: |
21 |
|
22 |
> # Set this to 'yes' if you wish the output to be mailed to you |
23 |
> SEND_EMAIL=yes |
24 |
> |
25 |
> # NOTE: the following EMAIL_* variables are only relevant if you set the |
26 |
> # SEND_EMAIL variable to 'yes' |
27 |
> EMAIL_SUBJECT="${HOSTNAME}: rkhunter output" |
28 |
> EMAIL_SENDER="myhost+rkhunter@×××××××.com" |
29 |
> EMAIL_RECIPIENT="myuser+rkhunter-report@×××××××.com" |
30 |
> EMAIL_CMD="|mail -s \"${EMAIL_SUBJECT}\" ${EMAIL_RECIPIENT}" |
31 |
|
32 |
I get the email, but it says it is from 'root'. |
33 |
|
34 |
I also tried commenting out entirely the EMAIL_CMD line, but then I |
35 |
don't get the email at all. |
36 |
|
37 |
So, am I missing something? |