HowTo: iRedMail 0.8.6
Posted: 24 Feb 2014, 4:14am - Monday

This guide will cover the following:

  • Install iRedMail
  • Disable Greylisting
  • Enable Catch-All
  • Email Forwarder
Reference: HowToForge: iRedMail: Build A Full-Featured Mail Server On CentOS 6 With Postfix, Dovecot, PostgreSQL First of all, its better your server is a clean install. Download iRedmail at http://www.iredmail.org/download.html
tar -xvjf iRedMail-0.8.6.tar.bz2

cd iRedMail-0.8.6

bash iRedMail.sh
Just follow the wizard installation and after installation, do the following commands: (just some few fixes)
ln -s /etc/amavisd/amavisd.conf /etc/amavisd.conf

amavisd showkeys
Add the DKIM keys to your DNS and configure SPF too then you may test by casting the commands below; Refer to:
  1. http://code.google.com/p/iredmail/wiki/DNS_SPF
  2. http://code.google.com/p/iredmail/wiki/DNS_DKIM
amavisd testkeys
After reboot, we will now disable greylisting.
nano /etc/policyd/cluebringer.conf
Change from:
# Access Control module
[AccessControl]
enable=1

# Greylisting module
[Greylisting]
enable=1

# CheckHelo module
[CheckHelo]
enable=1

# CheckSPF module
[CheckSPF]
enable=1

# Quotas module
[Quotas]
enable=1
to:
# Access Control module
[AccessControl]
enable=1

# Greylisting module
[Greylisting]
enable=0

# CheckHelo module
[CheckHelo]
enable=1

# CheckSPF module
[CheckSPF]
enable=1

# Quotas module
[Quotas]
enable=1
Then reboot your server. (Don't know how to restart the policyd) hehehe.. Next is enable the Catch-All;
nano /etc/postfix/mysql/domain_alias_catchall_maps.cf
Change from:
query       = SELECT alias.goto FROM alias,alias_domain,domain WHERE alias_domain.alias_domain='%d' AND alias.address=CONCAT('%u', '@', alias_domain.target_domain) AND alias_domain.target_domain=domain.domain AND alias.active=1 AND alias_domain.active=1 AND domain.backupmx=0
to:
query       = SELECT alias.goto FROM alias,alias_domain,domain WHERE alias_domain.alias_domain='%d' AND (alias.address=CONCAT('%u', '@', alias_domain.target_domain) OR alias.address=CONCAT('@', alias_domain.target_domain)) AND alias_domain.target_domain=domain.domain AND alias.active=1 AND alias_domain.active=1 AND domain.backupmx=0
Save then restart postfix;
postfix stop

postfix start
Now catch-all is now enable in postfix. Next thing is add which domain to catch-all and where to go. Login to MySQL as root, use vmail database and add to the following rows to alias table.
INSERT INTO alias (address, goto, domain) VALUES ('@sample.co.nz', 'user@sample.co.nz', 'sample.co.nz');

INSERT INTO alias (address, goto, domain) VALUES ('@test.sample.co.nz', 'user@sample.co.nz', 'test.sample.co.nz');
Aside from catch all, you can setup the email forwarder too;
INSERT INTO alias (address, goto, domain) VALUES ('info@sample.co.nz', 'user@sample.co.nz', 'sample.co.nz');
All done.. its self explanatory... Hehehe... Hope this helps.   Some Reference: