Cheap VPS & Xen Server


Residential Proxy Network - Hourly & Monthly Packages

iRedMail: Build A Full-Featured Mail Server With LDAP, Postfix, RoundCube, Dovecot, ClamAV,SpamAssassin, DKIM, SPF On CentOS 5.x


iRedMail is a shell script that lets you quickly deploy a full-featured mail solution in less than 2 minutes on CentOS 5.x and Debian (Lenny) 5.0.1 (it supports both i386 and x86_64). Its object is to make a Linux mail server installation and configuration simple and easy to use. iRedMail supports both OpenLDAP and MySQL as backends for storing virtual domains and users.This tutorial shows how to use the OpenLDAP as the backend.

The mail server components: http://code.google.com/p/iredmail/wiki/Main_Components

The discussion forum: http://www.iredmail.org/forum/

Now the newest version of iredmail start to support Debian (Lenny) 5.0.1,you can check the  install guide http://code.google.com/p/iredmail/wiki/Installation_on_Debian

Preliminary Note

In this tutorial I use:

Hostname server1.example.com
LDAP suffix: dc=example,dc=com
OpenLDAP admin account: cn=manager,dc=exmple,dc=com
Mail domain: example.com
Mail delivery (mailboxes) path: /home/vmail/domains

These settings might differ for you, so you have to replace them where appropriate.

 

Requirements

Install CentOS 5.x, I suggest to use the minimum install, make sure you don’t install Apache, PHP and MySQL. You can remove them with yum if they are installed.

Yum is working, because the installation needs to use CentOS source packages.

DNS MX record setting is no problem.

 

Installation

Download the iRedMail script:

wget http://iredmail.googlecode.com/files/iRedMail-0.7.1.tar.bz2
tar xjf iRedMail-0.7.1.tar.bz2

 

Run the script to install:

cd iRedMail-0.7.1
sh iRedMail.sh

Welcome page:

1

Mail delivery (mailboxes) path, all emails should be stored in this directory.

2

iRedMail supports both OpenLDAP and MySQL as backends to store virtual domains and users. OpenLDAP is selected.

3

LDAP suffix, normally it’s your domain name:

4

Set a password for the LDAP server admin. Admin account is defined in /etc/openldap/slapd.conf, normaily it’s: cn=Manager,dc=example,dc=com

5

Set a password for the LDAP virtual domain admin’s password. cn=vmailadmin,dc=example,dc=com is used to manage all virtual domains/users.

6

Add your first virtual domain:

7

Virtual domain administrator account for the first virtual domain. Default is ‘postmaster’.

8

Set a password for the virtual domain administrator.

9

Add the first normal user for our virtual domain. e.g.: www.

10

Set a password for the above normal user.

11

Enable SPF verification and DKIM verification/sign feature:

12

Enable the Managesieve service:

13

Enable POP3, POP3S, IMAP, IMAPS services:

14

Select webmail, RoundCube is recommended:

15

Choose the default language for webmail:

16

Optional components, recommended: select all:

17

MySQL root password:

18

Set an alias mail address for the root user:

19

Now the configuration wizard is finished; afterwards, you just need to restart the machine. You can use http://ip/mail to access the RoundCube webmail.

 

Set Up DNS Record For SPF

Please refer to http://www.openspf.org/ to set up an SPF record.

This is a simple example:

example.com. 3600 IN TXT “v=spf1 mx mx:mail.example.com -all”

 

Set Up DNS Record For DKIM

After the installation, please reboot your system, then use amavisd to help you set up the DNS record:

amavisd showkeys

; key#1, domain example.com, /var/lib/dkim/example.com.pem
dkim._domainkey.example.com.    3600 TXT (
“v=DKIM1; p=”
“MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC054b34nGjxaxAO2ru3MKtNQws”
“nrUhgHRgQzxM85RbrmJDLS+gqnEej2pW5kxyuAFPCC/kM5/s/vOngN7TmU2/TG3N”
“JpEU33WGWat/ikWZfw150fguueZHPbtcinGydfuV2rNGPJ48IuUXf+xGoCohnOdt”
“YQgaS9n7jfO8tFs+CQIDAQAB”)

You should add a ‘TXT’ type DNS record. After you added this in DNS, type this command to verify it:

amavisd testkeys

TESTING: dkim._domainkey.example.com      => pass

If it shows ‘pass’, it works.

 

Comments

comments