Cheap VPS & Xen Server

Residential Proxy Network - Hourly & Monthly Packages

iRedMail 0.7.0: OpenSource Mail Server With Postfix, Dovecot, Amavisd, ClamAV, SpamAssassin, RoundCube (Debian Squeeze)


iRedMail is a shell script that lets you quickly deploy a full-featured mail solution in less than 2 minutes. Its object is to make a Linux mail server installation and configuration simple, painless and easy to use.

Most components used in iRedMail are provided by Linux distributions officially. It means that iRedMail users can get software update support for as long as the the distribution is supported. iRedMail supports both OpenLDAP and MySQL as backends for storing virtual domains and users. This tutorial shows how to use the OpenLDAP backend on Debian Squeeze.

What is iRedMail?

  • iRedMail is a shell script.
  • It lets you quickly deploy a full-featured mail solution in less than 2 minutes.
  • iRedMail supports both OpenLDAP and MySQL as backends for storing virtual domains and users.
  • iRedMail officially provides the iRedAdmin web panel for managing mail servers.
  • Most components used in iRedMail are provided by Linux distributions officially. It means that iRedMail users can get software update support for as long as the the distribution is supported.
  • It supports RedHat, CentOS, Debian, Ubuntu, OpenSuSE, FreeBSD on both i386 and x86_64 architectures.
  • It provides RoundCube 0.5.1 as a webmail program.

Useful links:

  • Why are users interested in iRedMail: http://www.iredmail.org/forum/topic74-why-are-you-interested-in-iredmail.html
  • Discussion forum: http://www.iredmail.org/forum/
  • Project home page: http://code.google.com/p/iredmail/

 

1 Requirements

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

To install such a system you will need the following:

  • Debian Squeeze (Debian 6.0) ISO; download Debian CD/DVD images via HTTP/FTP
  • Internet connection.

 

2 Preliminary Note

In this tutorial we use:

  • Hostname: mail.example.com
  • IP address: 192.168.1.10
  • LDAP suffix (root dn): dc=example,dc=com
  • The first virtual domain: example.com
  • iRedMail installs all packages from official apt repositories on Debian 6. On Debian 5, it installs from official apt repositories and the backports repository.

 

3 Setting The Hostname

In Debian, the hostname is set in these two files:

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

Map this hostname to ‘127.0.0.1’ (warning: list the FQDN hostname as the first item!).

Edit /etc/hosts:

127.0.0.1       localhost
127.0.1.1      mail.example.com        mail

Edit /etc/hostname:

mail

Let the hostname modification take effect at once:

# /etc/init.d/hostname.sh

Verify the FQDN hostname:

# hostname

mail

#hostname -f

mail.example.com

 

4 Install Necessary Packages

We need to have bzip2 installed for extracting iRedMail.

# apt-get install bzip2

 

5 Start iRedMail Installation

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

$ sudo su –

Download the new version of iredmail and start the installation:

# wget http://iredmail.googlecode.com/files/iRedMail-0.7.0.tar.bz2
# tar jxvf iRedMail-0.7.0.tar.bz2
# cd iRedMail-0.7.0
# bash iRedMail.sh

Welcome page:

iredmail_01

Choose the directory that will be used to store users’ mailboxes.

iredmail_02

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

iredmail_03

LDAP suffix, normally it’s your domain name, such as: dc=example,dc=com:

iredmail_04

Set password for LDAP server admin: cn=Manager,dc=example,dc=com

iredmail_05

Set the MySQL root password:

iredmail_06

Add your first virtual domain, e.g.:

iredmail_07

Set a password for the virtual domain admin: postmaster@example.com, you can log into iRedadmin and Awstats with this account.

iredmail_08

Set a password for the first normal user www@example.com for the first virtual domain:

iredmail_09

Select optional components:

iredmail_10

Select the default language for your webmail application:

iredmail_12

The configuration is now finished, we can now start the installation:

Configuration completed.

*************************************************************************
***************************** WARNING ***********************************
*************************************************************************
*                                                                       *
* Please do remember to *MOVE* configuration file after installation    *
* completed successfully.                                               *
*                                                                       *
*   * /root/iRedMail-0.7.0-beta2/config
*                                                                       *
*************************************************************************
< INFO > Continue? [Y|n]

Finish the installation:

*************************************************************************
* iRedMail-0.7.0-beta2 installation and configuration complete.
*************************************************************************

< Question > Would you like to use firewall rules shipped within iRedMail now?
< Question > File: /etc/default/iptables, with SSHD port: 22. [Y|n]
< INFO > Copy firewall sample rules: /etc/default/iptables.
insserv: warning: script 'K01iredapd' missing LSB tags and overrides
insserv: warning: script 'iredapd' missing LSB tags and overrides
< Question > Restart firewall now (with SSHD port 22)? [y|N]
< Question > Would you like to start postfix now? [y|N]
********************************************************************
* URLs of your web applications:
*
* - Webmail: http://mail.example.com/mail/ or httpS://mail.example.com/mail/
*   + Account: www@example.com, Password: iredmail
*
* - iRedAdmin: httpS://mail.example.com/iredadmin/
*   + Account: postmaster@example.com, Password: iredmail
*
* - phpMyAdmin: httpS://mail.example.com/phpmyadmin/
*   + Accounts:
*       - Name: vmailadmin, Password: are9NuhLoAuqFl3FvMZbO81ulUHEjs
*       - Name: root, Password: iredmail
*
* - phpLDAPadmin: httpS://mail.example.com/phpldapadmin/
*   + Account:
*       - Name (manage mail accounts only): cn=vmailadmin,dc=example,dc=com, Password: XvHGEnriTEsKc1oO4ruKqKjjR4DVgC
*       - Name (site-wide manager): cn=Manager,dc=example,dc=com, Password: iredmail
*
* - Awstats:
*   + URLs:
*       - httpS://mail.example.com/awstats/awstats.pl?config=web
*       - httpS://mail.example.com/awstats/awstats.pl?config=smtp
*   + Account: postmaster@example.com, Password: iredmail
*

********************************************************************
* Congratulations, mail server setup complete. Please refer to tip
* file for more information:
*
*   - /root/iRedMail-0.7.0-beta2/iRedMail.tips
*
* And it's sent to your mail account www@example.com.
*
* Please reboot your system to enable mail related services or start them
* manually without reboot:
*
*   # for i in rsyslog  apache2 postfix mysql slapd postfix-policyd dovecot amavis clamav-daemon clamav-freshclam cron iredapd iptables; do /etc/init.d/${i} restart; done
*
********************************************************************

root@mail:~/iRedMail-0.7.0-beta2#

Restart all the related services:

# for i in rsyslog apache2 postfix mysql slapd postfix-policyd dovecot amavis clamav-daemon clamav-freshclam cron iredapd iptables; do /etc/init.d/${i} restart; done

6 Test The Mail System

6.1 Webmail RoundCube

By default, iRedMail only enables two RoundCube plugins: “password” and “managesieve”, so that you can change passwords, create filters, and set up vacation.

Log into the RoundCube, use the first user www@example.com:

iredmail_16

The account has received two emails, read them carefully.
Note: because www@exmaple.com is a root alias, it receives system emails.

iredmail_17

Setting up a vacation autoresponder:

iredmail_17_1

 

6.2 iRedAdmin

iRedAdmin Open Source Edition is a web-based iRedMail admin panel, it allows you to add, remove and edit domains, users and domain admin accounts. If you need more features, please consider purchasing the Pro edition iRedAdmin-Pro.

You can also manage all the features of iRedAdmin-Pro with phpLDAPadmin and phpMyAdmin.

Log into iRedAdmin: postmaster@example.com

iredmail_18

Dashboard:

iredmail_19

Mail Domains:

iredmail_24

Mail Users:

iredmail_25

Mail Admin:

iredmail_26

Create new mail user:

iredmail_27

Select language:

iredmail_28

6.3 phpLDAPAdmin

Log into phpLDAPAdmin: cn=manager,dc=example,dc=com

iredmail_20

Manage the mail account:

iredmail_21

 

6.4 Awstats

Log into Awstats: postmaster@example.com

iredmail_22

Check the statistics:

iredmail_23

7 Important Things You Should Know After Installation

  • Read file ‘iRedMail-x.y.z/iRedMail.tips’ first, iRedmail.tips example it contains:
    • User password and related sensitive information.
    • Location of mail server related software configuration files and other important information.
  • Set Up DNS record for SPF
  • Set Up DNS record for DKIM
  • Enable signing disclaimer on outgoing mails

8 Access Webmail And Other Web-Based Programs

After the 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
Roundcube 0.50 http://your_server/mail/ (or /webmail, /roundcube) YES YES Recommand webmail
iRedAdmin https://your_server/iredadmin NO YES Only Ldap Backend
phpMyAdmin https://your_server/phpmyadmin/ (or /mysql) NO YES
phpLDAPAdmin https://your_server/ldap/ (or /phpldapadmin) NO YES Only LDAP Backend
Awstats https://your_server/awstats/awstats.pl NO YES

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

iRedAdmin, phpMyAdmin, phpLDAPAdmin and Awstats use https by default.

 

Comments

comments