EzyMailHostingAdministration

How to install SendmailAnalyzer on Zimbra mail

SendmailAnalyzer logo SendmailAnalyzer เป็นโปรแกรมวิเคราะห์ log โปรแกรมหนึ่งที่ช่วยให้ผู้ดูแลระบบสามารถตรวจสอบภาพรวมการรับส่ง email ของระบบ mail ในรูปแบบกราฟและ report โดยสามารถแสดงผลได้ในรูปแบบ รายชั่วโมง รายวัน รายเดือน และรายปี นอกจากนี้ report ของ SendmailAnalyzer ยังสามารถใช้งานร่วมกับ SpamAssassin, MailScanner, Clamav, Amavis, RBL check, J-ChkMail และอื่นๆ ตัวอย่าง report ของ SendmailAnalyzer

  1. ปริมาณการรับส่ง email รายชั่วโมง
  2. ปริมาณการรับส่ง email รายวัน
  3. ปริมาณการรับส่ง email รายเดือน
  4. ปริมาณการรับส่ง email รายปี
  5. สถานะการรับส่ง email แยกเป็น รายวัน เดือน และ ปี
  6. Top 25 Spammers Domain แยกเป็น รายวัน เดือน และ ปี
  7. Top 25 Spammers Address แยกเป็น รายวัน เดือน และ ปี
  8. Top 25 Emails Address และ server ที่มีการรับจดหมายสูงสุด แยกเป็น รายวัน เดือน และ ปี
  9. Top 25 Emails Address และ server ที่มีการส่งจดหมายสูงสุด แยกเป็น รายวัน เดือน และ ปี

การทำงานของ SendmailAnalyzer จะรวบรวมข้อมูลจาก log ตลอดเวลา ดังนั้นผู้ดูแลระบบสามารถตรวจสอบภาพรวมการรับส่ง email (inbound/outbound) ของ email, spam และ virus ได้อย่างรวดเร็ว การติดตั้ง SendmailAnalyzer เพื่อใช้งานร่วมกับ Zimbra Mail Server

  1. ติดตั้ง perl module ต่างๆ เพื่อให้รองรับการทำงานร่วใกับ SendmailAnalyzer

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

  3. เมื่อ download มาเรียบร้อยแล้ว ให้ทำการ extract file ด้วยคำสั่ง

    [root@EZMAIL ~]# tar xvzf sendmailanalyzer-8.x.tar.gz
  4. เมื่อ extract file เรียบร้อยแล้วให้เข้าไปยัง sendmailanalyzer-8.x ด้วยคำสั่ง

    [root@EZMAIL ~]# cd sendmailanalyzer-8.x
  5. ทำการ compile code เพื่อให้สามารถใช้งานร่วมกับระบบ

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

    ผลลัพธ์

    
    Checking if your kit is complete...
    Looks good
    Writing Makefile for sendmailanalyzer
    Done...
    
    Now type 'make && make install'
  6. จากนั้นให้รันคำสั่งติดตั้ง

    [root@EZMAIL sendmailanalyzer-8.x]# make && make install
  7. รันคำสั่งด้านล่างเพื่อเริ่ม generate report

    [root@EZMAIL sendmailanalyzer-8.x]# /usr/local/sendmailanalyzer/sendmailanalyzer -f 
  8. ทำการตั้ง cron เพื่อให้ระบบทำการ caching ทุกๆ 5 นาที โดยรันคำสั่งด้านล่างเพื่อเพิ่ม cron เข้าไปยังระบบ

    [root@EZMAIL ~]# crontab -e

    และให้เพิ่ม

    */5 * * * * /usr/local/sendmailanalyzer/sa_cache -a > /dev/null 2>&1
  9. แก้ไข logrotate ให้ระบบสามารถทำงานได้หลังจากที่ได้มีการ rotate log file ไปแล้ว โดยการสร้างไฟล์ /etc/logrotate.d/maillog ด้วยคำสั่ง

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

    จากนั้นใส่ config ด้านล่างเข้าไป

    
    /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. ทำการเพิ่ม uri /sareport ให้กับ apache ด้วยการแก้ไขไฟล์ /etc/httpd/conf/httpd.conf และเพิ่มข้อความด้านล่างลงไปที่บรรทัดล่างสุด

    
    Alias /sareport /usr/local/sendmailanalyzer/www
    
    <Directory /usr/local/sendmailanalyzer/www>
    	Options ExecCGI
    	AddHandler cgi-script .cgi
    	DirectoryIndex sa_report.cgi
    </Directory>
  11. ทำการ restart apache service ด้วยคำสั่ง

    [root@EZMAIL ~]# service httpd restart
  12. ตอนนี้ก็สามารถเข้าไปดู report ของ SendmailAnalyzer ได้แล้วที่

    http://ip.address/sareport

ตัวอย่าง report ของ SendmailAnalyzer SendmailAnalyzer Dashboard SendmailAnalyzer - Spamming flows

EOF.← กลับไปอ่านบทความอื่น