HowtoForge

iRedMail 0.7.0: Open Source Mail Server With Postfix, Dovecot, Amavisd, ClamAV, SpamAssassin, RoundCube On Ubuntu 10.04

iRedMail 0.7.0: Open Source Mail Server With Postfix, Dovecot, Amavisd, ClamAV, SpamAssassin, RoundCube On Ubuntu 10.04

Last edited 03/31/2011 

iRedMail is a shell script that lets you quickly deploy a Open Source Mail Server solution in less than 2 minutes.

iRedMail was initially published in 2007, and now iRedMail 0.6.1 also supports Ubuntu 10.04.

 

1 Requirements

To install such a system you will need the following:

 

2 Preliminary Note

In this tutorial we use:

 

3 Setting The Hostname

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

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

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

cat /etc/hosts

127.0.0.1       localhost
192.168.1.10   mail.example.com      mail

cat /etc/hostname

mail

Verify the FQDN hostname:

# hostname --fqdn
mail.example.com

 

4 Start To Install iRedMail

Update your ubuntu to the latest version:
 

#apt-get update
#apt-get upgrade

 

Download the new version of iredmail:

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


Start the iRedMail installer:

# cd iRedMail-0.7.0
# bash iRedMail.sh

Welcome page:

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

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:

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

Set the MySQL root password:

Add your first virtual domain, e.g.:

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

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

Select optional components:

Select the default language for your webmail application:

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

Finish the installation:

*************************************************************************
* iRedMail-0.6.1 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.
< Question > Restart firewall now (with SSHD port 22)? [y|N]
< INFO > Skip restart firewall.
< INFO > Installing php Net_LDAP2 ...
PHP Deprecated:  Comments starting with '#' are deprecated in /etc/php5/cli/conf.d/imap.ini on line 1 in Unknown on line 0
PHP Deprecated:  Comments starting with '#' are deprecated in /etc/php5/cli/conf.d/mcrypt.ini on line 1 in Unknown on line 0
< Question > Would you like to start postfix now? [y|N]

********************************************************************
* Congratulations, mail server setup complete. Please refer to tip
* file for more information:
*
*   - /root/iRedMail-0.6.1/./iRedMail.tips
*
* And it's sent to your mail account www@example.com.
*
* If you want to remove and re-install iRedMail, here are steps:
*   - Run script to remove main components installed by iRedMail:
*       # wget http://iredmail.googlecode.com/hg/extra/clear_iredmail.sh
*       # mv clear_iredmail.sh tools/ && cd tools/
*       # bash clear_iredmail.sh
*   - Remove iRedMail installation process status:
*       # rm -f /root/iRedMail-0.6.1/./.iRedMail.installation.status
*   - Install iRedMail like you did before.
*
* 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
*
********************************************************************

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

Update freshclam, maybe you need to restart the machine to make this work.

# freshclam

ClamAV update process started at Sun Aug 22 17:47:00 2010
main.cvd is up to date (version: 52, sigs: 704727, f-level: 44, builder: sven)
daily.cvd is up to date (version: 11609, sigs: 113386, f-level: 53, builder: ccordes)
bytecode.cvd is up to date (version: 39, sigs: 9, f-level: 53, builder: edwin)

iRedMail 0.7.0: Open Source Mail Server With Postfix, Dovecot, Amavisd, ClamAV, SpamAssassin, RoundCube On Ubuntu 10.04