Friday, August 20, 2010

Config Mail Gateway LINUX less than 5 minutes (Anti-spam, Mail Anti-virus,Greylisting).


As previous document I intro to you Iredmail as mail server in linux with full-featured (/Postfix/Dovecot/Amavisd/ClamAV/SpamAssassin/RoundCube/iRedAdmin/
postfixadmin).But With this document I will intro iredmail as mail gateway(because By default iredmail config /Amavisd/ClamAV/SpamAssassin/greylisting for anti spam and mail anti-virus).

II/Install Iredmail

Install iredmail as normal But only choose phpmyadmin(for managed greylisting easier) and Awstats

III/Remove some services not use

Because we setup iredmail as Mail gateway so We not use some services:dovecot,pysieved

IV/Change some config

1/Edit /etc/postfix/

mydestination =
local_recipient_maps =
local_transport =error:local mail delivery disabled

relay_recipient_maps = hash:/etc/postfix/relay_recipients

relay_domains =

transport_maps = hash:/etc/postfix/transport

comments all line with mysql_* or ldap_*

2/ edit /etc/postfix/

comment line

#local unix - n n - - local

3/edit /etc/postfix/transport smtp: #with mail server backend as exchange...)

4/create /etc/postfix/relay_recipients OK OK OK OK OK

5/hashing Databases

postmap /etc/postfix/transport
postmap /etc/postfix/relay_recipients

V/Populating relay_recipients from Active Directory

Note that this script requires perl and Net::LDAP(you need install perl-ldap by yum). However, this does NOT have to be on your email gateway.

Edit the script so that values below are correct:
$VALID = "/etc/postfix/relay_recipients";

If You have any problem script perl please send mail to will edit for you

VI/Create Bash shell automatic update relay_recipients from Active directory

create bash shell /opt/ with info:

cd /etc/postfix ; ./ && /usr/sbin/postmap relay_recipients
/usr/sbin/postfix reload

use crontab run as your schedule

Beside you can use iredmail for multi domain(can get relay_recipients from Multi Active directory).


No comments:

Post a Comment