Thursday, October 15, 2015

Logwatch + MailGun

I really like the way Logwatch works but I hate when I can't properly send mail due to reverse DNS restrictions, based on this post [1] I came with the idea of leveraging the power of MailGun in order to send Logwatch email notifications and it went successfuly.

In the logwatch main configuration file (/etc/logwatch/conf/logwatch.conf) on Debian, change the following:

  1. comment out the sendmail line

  2. # mailer = "/usr/sbin/sendmail -t"

  3. add a line to use our custom mailgun mailer script


  4. mailer = "/usr/local/sbin/mailgun"

After changing the values, you can run a test with the following command line

/etc/cron.daily/00logwatch

The mailgun shell script can be (literally) checked out here [2].


  1. http://blog.thinkingcapstudios.net/2012/07/installing-lemonstand-on-ubuntu-part-2/
  2. https://gist.github.com/tonejito/1a50b4d8b181393ebf77


--
    = ^ . ^ =