MIMEDefang installation


Step 1

[root@local ~]# yum install mimedefang

Install mimedefang via yum.




Step 2

[root@local ~]# vi /etc/mail/sendmail.mc

INPUT_MAIL_FILTER(`mimedefang', `S=unix:/var/spool/MIMEDefang/mimedefang.sock, F=T, T=S:1m;R:1m')dnl
define(`ConfINPUT_MAIL_FILTERS', `mimedefang')dnl

[root@local ~]# m4 sendmail.mc > sendmail.cf

Edit the sendmail config file to call mimedefang during sendmail processing.
If it is exist clamav-milter in 'INPUT_MAIL_FILTER', comment it, we dont need clamav-milter in mimedefang



Step 3

[root@local ~]# vi /usr/bin/mimedefang.pl

$Features{'Virus:CLAMD'} = ('/usr/sbin/clamd' ne '/bin/false' ? '/usr/sbin/clamd' : 0);
$ClamdSock = "/tmp/clamd.socket";

Edit the mimedefang pl file to call clamd during mimedefang processing.
P.S. Remember install the new version of clamav first (clamav,clamd,clamav-devel,clamav-db)


Step 4

[root@local ~]# vi /etc/mail/mimedefang-filter

if ($hits >= $req) { action_change_header("X-Spam-Score", "$hits ($score) $names"); md_graphdefang_log('spam', $hits, $RelayAddr); # rewrite subject action_change_header("Subject", "[SPAM] $Subject");

Edit mimedefang filter config file to set subject [SPAM] in header for spamassassin which is called by mimedefang



Step 5

[root@local ~]# chkconfig mimedefang on
[root@local ~]# /etc/init.d/mimedefang start
[root@local ~]# /etc/init.d/sendmail restart

To start mimedefang program, check the status in /var/log/maillog

P.S. If you use mimedefang for sendmail scan agent, it will help to call clamd and spamassassin during in mimedefang processing. Therefore, you need to stop clamav-milter and spamassassin (/etc/procmailrc) that avoid the duplicate service processing.


Server is hosted by Alanstudio
Linux Operating System

Recommend screen resolution 1024 x 768 / IE / FireFox
Alan Studio © 2007 by Alan Cheung Hin Lun. All rights reserved.