EzyMailHostingAdministration

How to install SendmailAnalyzer on Zimbra mail

SendmailAnalyzer logo SendmailAnalyzer is a log analysis program that helps administrators examine an overview of incoming and outgoing email in graphs and reports, with hourly, daily, monthly, and yearly views. SendmailAnalyzer reports can also work with SpamAssassin, MailScanner, Clamav, Amavis, RBL check, J-ChkMail, and others. Examples of SendmailAnalyzer reports:

  1. Hourly email traffic volume
  2. Daily email traffic volume
  3. Monthly email traffic volume
  4. Yearly email traffic volume
  5. Email delivery status by day, month, and year
  6. Top 25 Spammers Domain by day, month, and year
  7. Top 25 Spammers Address by day, month, and year
  8. Top 25 Emails Address and servers receiving the most mail, by day, month, and year
  9. Top 25 Emails Address and servers sending the most mail, by day, month, and year

SendmailAnalyzer continuously gathers data from logs, allowing administrators to quickly review inbound/outbound email, spam, and virus traffic. Installing SendmailAnalyzer for use with Zimbra Mail Server

  1. Install the perl modules needed to support SendmailAnalyzer.

    [root@EZMAIL ~]# yum install perl-GD perl-GDGraph perl-GDGraph3d perl-GDTextUtil perl-GD
  2. Download SendmailAnalyzer from http://sourceforge.net/projects/sa-report/

  3. Once the download is complete, extract the file with this command:

    [root@EZMAIL ~]# tar xvzf sendmailanalyzer-8.x.tar.gz
  4. After extracting the file, enter sendmailanalyzer-8.x with this command:

    [root@EZMAIL ~]# cd sendmailanalyzer-8.x
  5. Compile the code for use on the system.

    
    [root@EZMAIL sendmailanalyzer-8.x]# perl Makefile.PL

    Output:

    
    Checking if your kit is complete...
    Looks good
    Writing Makefile for sendmailanalyzer
    Done...
    
    Now type 'make && make install'
  6. Then run the installation command:

    [root@EZMAIL sendmailanalyzer-8.x]# make && make install
  7. Run the command below to begin generating reports:

    [root@EZMAIL sendmailanalyzer-8.x]# /usr/local/sendmailanalyzer/sendmailanalyzer -f 
  8. Set up cron to cache data every 5 minutes. Run the following command to add a cron entry to the system:

    [root@EZMAIL ~]# crontab -e

    Add:

    */5 * * * * /usr/local/sendmailanalyzer/sa_cache -a > /dev/null 2>&1
  9. Configure logrotate so the system continues working after log files have been rotated. Create /etc/logrotate.d/maillog with this command:

    [root@EZMAIL ~]#  vi /etc/logrotate.d/maillog

    Then insert the following configuration:

    
    /var/log/maillog {
    	weekly
    	rotate 20
    	compress
    	delaycompress
    	sharedscripts
    	postrotate
    		/bin/kill -HUP `cat /var/run/syslogd.pid 2>/dev/null` 2>/dev/null || true
    		/usr/local/sendmailanalyzer restart >/dev/null 2>&1 || true
    	endscript
    }
  10. Add the /sareport URI to apache by editing /etc/httpd/conf/httpd.conf and appending the following text at the end:

    
    Alias /sareport /usr/local/sendmailanalyzer/www
    
    <Directory /usr/local/sendmailanalyzer/www>
    	Options ExecCGI
    	AddHandler cgi-script .cgi
    	DirectoryIndex sa_report.cgi
    </Directory>
  11. Restart the apache service with this command:

    [root@EZMAIL ~]# service httpd restart
  12. You can now view SendmailAnalyzer reports at:

    http://ip.address/sareport

Example SendmailAnalyzer reports: SendmailAnalyzer Dashboard SendmailAnalyzer - Spamming flows

EOF.← Back to articles