====Integrating MailScannner=====
1. Edit the file /etc/postfix/main.cf and remove the # in front of the line below
header_checks = regexp:/etc/postfix/header_checks
2. Edit the file /etc/postfix/header_checks and add the line below to the bottom of the file
/^Received:/ HOLD
3. MailScanner should now be the one to start the Postfix service. Stop the Postfix service and start the Clamd and MailScanner service in that order. Use the commands below to accomplish these.
chkconfig postfix off
chkconfig clamd on
chkconfig MailScanner on
service postfix stop
service clamd start
service MailScanner start
= = = = = clean mailscanner quarantine emails as the size increase gradually by time = = =
# cd /etc/cron.daily/
# vim clean.quarantine
$disabled = 0; #uncomment
$days_to_keep = 3; # set value according to your needs
#./clean.quarantine ; #to run now by hand
= = = = = clamd may stop ,, dirty fix by periodically restarting clamd = = = = = =
[root@mx12 xinetd.d]# crontab -l
*/3 * * * * /opt/checkclam.sh
# cat /opt/checkclam.sh
#!/bin/bash
if ! pgrep clamd > /dev/null;
then
/etc/init.d/clamd restart > /dev/null;
else
echo "OK `date +%T\ %F`" >> /program.log; #'\ ' is for space use %t for tab
fi
= = = = = = = = = = = = = = = = = = = = =
Perform header checks with /etc/postfix/header_checks file :
/^Received:/ HOLD
# HEADER_CHECKS
#
/^Subject:.*Info..P..E N I_S..--..E-N-L..A R-G-E M_E..N T-___P_I L..L_S-*/ HOLD
/^Subject:.*skinny/ HOLD
/^Subject:.* / HOLD
/^Subject:.*Easy*/ HOLD
/^From:.*medch*/ HOLD
/^From: "expediti/ HOLD
/^From:.*newsfilm@ds02.01cloud.com/ HOLD
/^From:.*no-reply@answers.medchrome.com*/ HOLD
/^From:.*expediti/ HOLD
/^From:.*tejecraft.com.np*/ HOLD
[root@mx12 postfix]# cat check_sender
gmail.com REJECT
hotmail.com REJECT
yahoo.com REJECT
medch@ds02.01cloud.com REJECT
expediti@ds01.01cloud.com REJECT
info@tejecraft.com.np REJECT
newsfilm@ds02.01cloud.com REJECT
no-reply@answers.medchrome.com REJECT
info@wexnepal.com REJECT
[]#postmap check_sender
]#vim main.cf
smtpd_sender_restrictions = check_sender_access hash:/etc/postfix/check_sender
1. Edit the file /etc/postfix/main.cf and remove the # in front of the line below
header_checks = regexp:/etc/postfix/header_checks
2. Edit the file /etc/postfix/header_checks and add the line below to the bottom of the file
/^Received:/ HOLD
3. MailScanner should now be the one to start the Postfix service. Stop the Postfix service and start the Clamd and MailScanner service in that order. Use the commands below to accomplish these.
chkconfig postfix off
chkconfig clamd on
chkconfig MailScanner on
service postfix stop
service clamd start
service MailScanner start
= = = = = clean mailscanner quarantine emails as the size increase gradually by time = = =
# cd /etc/cron.daily/
# vim clean.quarantine
$disabled = 0; #uncomment
$days_to_keep = 3; # set value according to your needs
#./clean.quarantine ; #to run now by hand
= = = = = clamd may stop ,, dirty fix by periodically restarting clamd = = = = = =
[root@mx12 xinetd.d]# crontab -l
*/3 * * * * /opt/checkclam.sh
# cat /opt/checkclam.sh
#!/bin/bash
if ! pgrep clamd > /dev/null;
then
/etc/init.d/clamd restart > /dev/null;
else
echo "OK `date +%T\ %F`" >> /program.log; #'\ ' is for space use %t for tab
fi
= = = = = = = = = = = = = = = = = = = = =
Perform header checks with /etc/postfix/header_checks file :
/^Received:/ HOLD
# HEADER_CHECKS
#
/^Subject:.*Info..P..E N I_S..--..E-N-L..A R-G-E M_E..N T-___P_I L..L_S-*/ HOLD
/^Subject:.*skinny/ HOLD
/^Subject:.* / HOLD
/^Subject:.*Easy*/ HOLD
/^From:.*medch*/ HOLD
/^From: "expediti/ HOLD
/^From:.*newsfilm@ds02.01cloud.com/ HOLD
/^From:.*no-reply@answers.medchrome.com*/ HOLD
/^From:.*expediti/ HOLD
/^From:.*tejecraft.com.np*/ HOLD
[root@mx12 postfix]# cat check_sender
gmail.com REJECT
hotmail.com REJECT
yahoo.com REJECT
medch@ds02.01cloud.com REJECT
expediti@ds01.01cloud.com REJECT
info@tejecraft.com.np REJECT
newsfilm@ds02.01cloud.com REJECT
no-reply@answers.medchrome.com REJECT
info@wexnepal.com REJECT
[]#postmap check_sender
]#vim main.cf
smtpd_sender_restrictions = check_sender_access hash:/etc/postfix/check_sender
No comments:
Post a Comment