Cheap VPS & Xen Server

Residential Proxy Network - Hourly & Monthly Packages

iRedMail: Mail Server With LDAP, Postfix, RoundCube, Dovecot, ClamAV, SpamAssassin, Amavisd (Debian 5.0.1)

iRedMail is a shell script that lets you quickly deploy a full-featured mail solution in less than 2 minutes. Since iRedMail 0.5, it supports Debian 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 OpenLDAP as the backend.

Now iRedmail provides two webmail program, RoundCube and SquirrelMail, and both support the MySQL and OpenLDAP backends and can change the password.

  • Main components used in this solution:
  • Discussion forum:
  • Project home page:


1 Requirements

It is strongly recommended that you use the ‘netinst’ version to install a minimal Debian system, and then deploy mail service via iRedMail solution. e.g.:

To install such a system you will need the following:

  • debian-501-amd64-netinst.iso or debian-501-i386-netinst.iso , download Debian CD/DVD images via HTTP/FTP
  • Internet connection.


2 Preliminary Note

In this tutorial we use:

  • Hostname
  • IP address
  • LDAP suffix (root dn) dc=example,dc=com
  • The first virtual domain:



4 Setting hostname

In Debian (Lenny), hostname is set in these two files:

* /etc/hostname: hostname setting
* /etc/hosts: hostname <=> IP address mapping

Map this hostname to ‘’ (Warning: List the FQDN hostname as first item.)

# vi /etc/hosts

#       localhost
#        mail mail localhost localhost.localdomain

# vi /etc/hostname


Verify the FQDN hostname:

# hostname –fqdn

5 Start iRedMail Installation

Switch to root user, we must execute further commands as root user without sudo.

$ sudo su –

Download the new version of iRedMail:

# wget
# tar jxvf iRedMail-0.7.0.tar.bz2

Start the iRedMail installer:

# cd iRedMail-0.7.0
# bash

Welcome page:


All emails should be stored in this directory:


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


LDAP suffix, normally it’s your domain name, such as: dc=example,dc=com
iRedMail will put all virtual domains/users in ‘o=domains,dc=example,dc=com’, it’s called ‘LDAP base dn’: o=domains,dc=example,dc=com.


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


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


Set a password for the MySQL root user:


Add your first virtual domain, e.g.:


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


Set a password for the virtual domain administrator:


Add the first normal user for our virtual domain. e.g.: www. The full email address will be


Set a password for above normal user:


Enable the SPF verify and DKIM verify/sign feature:


Select optional components, you can choose RoundCube or SquirrelMail as webmail programs.
An Awstat user account has been integrated in LDAP, so you need to use the username: For details, read the file iRedMail-x.y.z/


Select webmail’s default language:


Set an alias mail address for the root user:


Finish the configuration and start to install the software:


After the installation has finished, reboot the machine:


7 Important Things You Should Know After Installation

  • Read file iRedMail-x.y.z/ first, it contains:
    • User password and related sensitive information.
    • Location of mail serve related software configuration files and other important information.
  • Setup DNS record for SPF
  • Setup DNS record for DKIM
  • iRedMail Admin Guide

8 Access webmail and other web-based programs

After installation is complete, you can access web-based programs if you’ve chosen to install them:

Component URL Access via HTTP Access via HTTPS Comment
RoundCubeMail-0.2.1 http://your_server/mail/ (or /webmail, /roundcube) YES YES Recommand webmail
SquirrelMail-1.4.19 http://your_server/squirrelmail/ (or /squirrel) YES YES webmail
PostfixAdmin- https://your_server/postfixadmin/ No YES Only Mysql Backend
phpMyAdmin- https://your_server/phpmyadmin/ (or /mysql) NO YES
phpLDAPadmin- https://your_server/ldap/ (or /phpldapadmin) NO YES Only LDAP Backend
Awstats-6.9 https://your_server/awstats/ (or / NO YES

Note: Replace your_server with your server hostname or IP address.