Logwatch and Dovecot 1.x series in FC5

No Comments

Logwatch is the preferred tool in order to get summaries of the various service logs in Fedora Core 5. It needs very little customization, which mainly summarizes in overriding some of the log file locations. The only issue I have encountered so far is that it cannot parse the Dovecot log entries correctly.

This happens because of two reasons:

  1. Fedora 5 includes dovecot v1.x, which has some differences in its log output format compared to older versions,
  2. the stock logwatch package in Fedora contains a dovecot log parser that supports dovecot up to the 0.99.x version.

This issue’s resolution is rather simple.

First of all, get the updated dovecot log parser from the logwatch CVS repository. I used the latest revision, 1.4 at the moment of writing. Create a services/ directory inside the /etc/logwatch/scripts/ directory, put the updated parser in there and set its executable bit:

# chmod u+x /etc/logwatch/scripts/services/dovecot

This script will be the one to parse the Dovcecot log file instead of the default one.

Next, it is required to override a setting in the dovecot service’s configuration file. So, create a text file, named dovecot.conf, in /etc/logwatch/conf/services/ and write the following line:

*OnlyService = (imap-login|pop3-login|dovecot)

Now, test if it works:

# logwatch --service dovecot --range yesterday --detail 10 --print

This will print the dovecot report to stdout.

There are some things that you should take a note of. The logwatch Dovecot report will work only if dovecot is configured to record its log entries to the system log (syslog), which in turn moves these entries to /var/log/maillog. If you have configured Dovecot to record its log entries to a separate file, other than syslog, then it is very unlikely that the whole thing will work for any Dovecot version. This is because of the different way log entries are written to the separate log.

Logwatch and Dovecot 1.x series in FC5 by George Notaras is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Copyright © 2006 - Some Rights Reserved

George Notaras avatar

About George Notaras

George Notaras is the editor of the G-Loaded Journal, a technical blog about Free and Open-Source Software. George, among other things, is an enthusiast self-taught GNU/Linux system administrator. He has created this web site to share the IT knowledge and experience he has gained over the years with other people. George primarily uses CentOS and Fedora. He has also developed some open-source software projects in his spare time.