csf autoupdate and From/To fields in email
Posted: 09 Nov 2015, 08:15
Hello,
I discover the csf autoupdate function (AUTO_UPDATES = "1" in csf.conf). But I have few questions :
1) The update is triggered daily with /etc/cron.d/csf_update.
I only receive update report mail when there is an update, this is good. But how does this works?
The cron daemon only sends update mail when there is a real update? It could not know this, so
what is the trick?
2) Is there a way to set both From: and To: fields of the csf update mail ?
Currently it uses From: "(Cron Daemon) <root@hostname>" and To: <root@hostname>
where hostname is the server hostname.
I am thinking about changing csf_update file as following:
Would it work?
Thank you.
I discover the csf autoupdate function (AUTO_UPDATES = "1" in csf.conf). But I have few questions :
1) The update is triggered daily with /etc/cron.d/csf_update.
I only receive update report mail when there is an update, this is good. But how does this works?
The cron daemon only sends update mail when there is a real update? It could not know this, so
what is the trick?
2) Is there a way to set both From: and To: fields of the csf update mail ?
Currently it uses From: "(Cron Daemon) <root@hostname>" and To: <root@hostname>
where hostname is the server hostname.
I am thinking about changing csf_update file as following:
Code: Select all
MAILTO=""
SHELL=/bin/sh
HOSTNAME="server_hostname"
11 5 * * * root /usr/sbin/csf -u 2>&1 | mail -r from_email@example.com -s "csf update for $HOSTNAME" to_email@example.com
Thank you.