How to Disable LogWatch Email Reports in CentOS/RHEL/Fedora?

Updated on September 2, 2017

I have been using LogWatch on my CentOS box to monitor Kernel errors, mailbox usage, disk usage, refused SSH connections, HTTP errors, sudo usage etc…(checkout this tutorial to Configure LogWatch). I have also configured it to generate daily reports and mail it to my personal gmail id. I have been receiving LogWatch emails properly for almost two years, but suddenly I saw Gmail reporting LogWatch emails as “Be careful with this message. It contains content that’s generally used to steal personal information“. I’m really not sure what part of the email would have triggered this warning, but it did not sound good. So I decided to turn Off LogWatch emails to protect my email-id’s reputation. Well, I’ll debug this problem later, but for now I’m just going to disable LogWatch emails.

Logwatch email reports

The below script runs LogWatch daily via Cron:

$ls- l /etc/cron.daily/0logwatch

The LogWatch Configuration file is here:

$ls -l /usr/share/logwatch/default.conf/logwatch.conf

Note: The location of the configuration file might be different on your machine.

To disable email reports :

$ vim /usr/share/logwatch/default.conf/logwatch.conf

Lookout for ‘ MailTo‘  attribute and set value as ‘root‘. Here, I have removed the email address and set it to send mails to ‘root‘ account.

Also change ‘MailFrom‘ attribute to ‘root‘.

We have disabled reports by email, but you can save LogWatch output in a file by setting the below attribute.

$ Save = /tmp/logwatch

Note: Set ‘Save‘ attribute to your desired location.

Test LogWatch by executing the below command:

$ logwatch

You’ll not receive any mail, but the output will be saved to a file mentioned above.

Was this article helpful?

Related Articles

Leave a Comment