Deploying Amavisd-logwatch

I was looking for way to make my SPAM filtering more effective and came across this great tool from Mike Cappella called amavisd-logwatch.

On his web site, it says he doesn’t like waiting for package maintainers, so its just a tarball. Since my installs are Debian based, I created a deb for it. My .deb creating skills are not perfect, but it works. The deb was built on sid and is available here.

Download the Debian package and install it:

mail:~# dpkg -i amavis-logwatch_1.49.09-1.1_i386.deb
Selecting previously deselected package amavis-logwatch.
(Reading database ... 37342 files and directories currently installed.)
Unpacking amavis-logwatch (from amavis-logwatch_1.49.09-1.1_i386.deb) ...
Setting up amavis-logwatch (1.49.09-1.1) ...
Processing triggers for man-db ...

Leaving the defaults are safe in the config file. The one thing that does need to be changed is the additional cron script that I added to the installer. It will email the output of the script when cron.daily runs. If you do not want this to happen, then just delete the file /etc/cron.daily/amavis-logwatch. To have the script run, you have to edit it and change the defaults to reasonable defaults (like proper From, To, and CC email addresses). Also make sure to change the /var/log/mail.log file if that isn’t the location of your mail log.

$SUMMARY=`/usr/bin/amavis-logwatch --detail 5 -f /etc/amavis-logwatch.conf /var/log/mail.log`;
# Set the email header fun
$FROM = "\"Postmaster\" <postmaster \>";
$TO = "\"To\" <to \>";
$CC = "\"CC\" <cc \>";

Once you have made those changes, you will receive a nightly report with your amavisd-new log information.

Posted in Mail, SPAM. Tags: , , . 4 Comments »
  • Pingback: Deploying Amavisd-logwatch | The Linux Blog

  • Pingback: More Efficient SPAM Fighting with Amavisd-logwatch | Eric's Tech Blog

  • Thomas Bullinger

    Slightly changed cron job:


    # Get todays date
    $DATE=`date +”%Y-%b-%d”`;
    chomp ($DATE);

    # Get the hostname
    $HOST=`hostname -f`;
    chomp ($HOST);
    $DOMAIN=`hostname -d`;
    chomp ($DOMAIN);

    # Set the email header fun
    $FROM = '”Postmaster” <root@' . “$DOMAIN>”;
    $TO = “$FROM”;
    $CC = '';
    $SUBJECT = “Amavis-logwatch Mail Report ($HOST on $DATE)”;

    $SUMMARY=`/usr/bin/amavis-logwatch –detail 5 -f /etc/amavis-logwatch.conf /var/log/mail.log`;
    #die “From: $FROMnTo: $TOnCC: $CCnSubject: $SUBJECTn”;

    # Send the email
    open(MAILPIPE, “| /usr/sbin/sendmail -t”);

    print MAILPIPE “From: $FROMnTo: $TOnCC: $CCnSubject: $SUBJECTnn”,



  • sporternaehrung

    What actually captcha code?, pls provide me captcha code codes or plugin, Thanks in advance.