Cheap VPS & Xen Server

Residential Proxy Network - Hourly & Monthly Packages

iRedOS-0.6.0: Open Source Mail Server With Postfix, Dovecot, Amavisd, ClamAV, SpamAssassin, RoundCube


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

  • It supports Red Hat(R) Enterprise Linux & CentOS 5.x, Debian 5.0.x, Ubuntu 8.04/9.04, FreeBSD 7.x/8.x, it supports both i386 and x86_64.
  • Most components used in iRedMail are provided by Linux distributions officially, it means iRedMail users can get software update support for as long as for the distribution itself.
  • It supports OpenLDAP and MySQL as backends to save the virtual domains and virtual users.
  • It offers a web-based admin panel.

iRedOS is a customized CentOS 5.5 distribution, where e unnecessary packages were removed. It ships with the lastest version of iRedMail (iredmail0.6.0); it lets you install iredmail more quickly and smooth.

  • Main components used in this solution: http://code.google.com/p/iredmail/wiki/Main_Components
  • Discussion forum: http://www.iredmail.org/forum/
  • Project home page: http://code.google.com/p/iredmail/

 

1 Requirements

To install such a system you will need the following:

  • iRedOS-0.6.0-CentOS-5.5.i386.iso or iRedOS-0.6.0-CentOS-5.5.x86_64.iso, download iRedOS-0.6.0-CentOS images via HTTP/FTP

 

2 Preliminary Note

In this tutorial we use:

  • Hostname: mail.example.com
  • IP address: 192.168.1.10
  • LDAP suffix: dc=example,dc=com
  • The first virtual domain: example.com

 

3 Install The Base System And iRedMail 0.6.0

Boot from iredos. Press at the boot prompt:

iredmail_00

Choose your language:

iredmail_01

Select your keyboard layout:

iredmail_02

I’m installing CentOS 5.5 on a fresh system, so I answer Yes to the question Would you like to initialize this drive, erasing ALL DATA?

iredmail_03

Now we must select a partitioning scheme for our installation. For simplicity’s sake I select Remove all partitions on selected drives and create default layout.

iredmail_04

Answer the following question (Are you sure you want to do this?) with Yes:

iredmail_05

On to the network settings. The default setting here is to configure the network interfaces with DHCP, but we are installing a server, so static IP addresses are not a bad idea… Click on the Edit button at the top right.

iredmail_06

In the window that pops up uncheck Use dynamic IP configuration (DHCP) and Enable IPv6 support and give your network card a static IP address (in this tutorial I’m using the IP address 192.168.1.10 for demonstration purposes) and a suitable netmask (e.g. 255.255.255.0):

iredmail_07

Set the hostname manually, e.g. mail.example.com, and enter a gateway (e.g. 192.168.1.1) and one DNS servers (e.g. 4.2.2.1 ):

iredmail_08

Choose your time zone, don’t select System clock uses UTC:

iredmail_09

Give root a password:

iredmail_10

The installation begins. This will take a few minutes:

iredmail_11

Now the CentOS installation has finished, start to install iredmail; if you selected No, the system would reboot and would not install iredmail.

iredmail_12

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

iredmail_13

Choose the backend to store virtual domains and virtual users. Here we use OpenLDAP.

iredmail_14

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

iredmail_15

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

iredmail_16

Set the MySQL root password:

iredmail_17

Add your first virtual domain, e.g.:

iredmail_18

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

iredmail_19

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

iredmail_20

Select optional components:

iredmail_21

Select the default language for your webmail application:

iredmail_24

The installation is now finished, please reboot the machine:

iredmail_27

4 Test The Mail System

4.1 Webmail RoundCube

Since RoundCube 0.31, it starts to support plugins. By default, iRedMail enables the two plugins “password” and “managesieve”, so you can change the password and set up a vacation autoresponder. You can also enable the other plugins according to your needs.

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

iredmail_28

4 Test The Mail System

4.1 Webmail RoundCube

Since RoundCube 0.31, it starts to support plugins. By default, iRedMail enables the two plugins “password” and “managesieve”, so you can change the password and set up a vacation autoresponder. You can also enable the other plugins according to your needs.

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

iredmail_28

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

iredmail_29

Setting up a vacation autoresponder:

iredmail_30_1

4.2 iRedAdmin Open Source Edition

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, you can check the full-featured edition.

Log into iRedAdmin: postmaster@example.com

iredmail_30

Dashboard:

iredmail_32

Mail Users:

iredmail_33

Mail Admin:

iredmail_34

Create new mail user:

iredmail_35

Select language:

iredmail_36

Manage the mail account:

iredmail_38

4.4 Awstats

Log into Awstats: postmaster@example.com

iredmail_39

Check the statistics:

iredmail_40

5 Important Things You Should Know After Installation

  • Read the file /root/iRedMail/iRedMail.tips 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

 

6 FAQ

6.1 Why do I receive my email with a delay?

iRedMail provides greylisting features with Policyd (v1.8.x), Greylisting is effective because many mass e-mail tools utilized by spammers are not set up to handle temporary failures (or any failures for that matter) so the Spam is never received. This feature can reduce e-mail traffic up to 50%, but would cause the first time receive email delay. You can enable or disable the greylisting.

On RHEL/CentOS, config file is /etc/postfix-policyd.conf:

#   1=on  0=off 
GREYLISTING=1

Restart Policyd and reload Postfix.

6.2 How to upgrade iRedMail to the newest version?

You can use YUM to update the packages. There’s an official iRedMail Upgrade Tutorial.

 

6.3 How to enable disclaimers for outgoing mails?

Find the below lines in /etc/amavisd.conf:

# ------------ Disclaimer Setting ---------------
# Uncomment this line to enable singing disclaimer in outgoing mails.
#$defang_maps_by_ccat{+CC_CATCHALL} = [ 'disclaimer' ];

Uncomment the line and restart amavis/amavisd service, then you get it. Don’t forget to read @disclaimer_options_bysender_maps in /etc/amavisd.conf for disclaimer content settings.

 

6.4 How to batch create users?

You must modify the script create_mail_user_OpenLDAP.sh first, change ldap suffix, bind dn and bind password.

# cd /path/to/iRedMail-x.y.z/tools/
# sh create_mail_user_OpenLDAP.sh domain.ltd user01 user02 user03

 

6.5 Anti-Virus & Anti-Spam – how to turn them on or off?

iRedMail uses Amavisd-new as interface between MTA and MDA, it will invoke SpamAssassin for anti-spam and ClamAV for anti-virus. You can turn them on or off in /etc/amavisd.conf.

# @bypass_virus_checks_maps = (1);  # controls running of anti-virus code
# @bypass_spam_checks_maps  = (1);  # controls running of anti-spam code
# $bypass_decode_parts = 1;         # controls running of decoders&dearchivers

Default settings are both enabled, you can uncomment them to bypass (turn off) them. Value ‘1’ means disabled.

 

6.6 How to create your own SSL key?

If you want to create your own SSL key, you can download:

# wget http://iredmail.googlecode.com/hg/iRedMail/tools/generate_ssl_keys.sh

Edit the related info in the script:

# SSL key.
export SSL_CERT_FILE="${ROOTDIR}/certs/iRedMail_CA.pem"
export SSL_KEY_FILE="${ROOTDIR}/private/iRedMail.key"
export TLS_COUNTRY='CN'
export TLS_STATE='GuangDong'
export TLS_CITY='ShenZhen'
export TLS_COMPANY="${HOSTNAME}"
export TLS_DEPARTMENT='IT'
export TLS_HOSTNAME="${HOSTNAME}"
export TLS_ADMIN="root@${HOSTNAME}"

Run the script:

# bash generate_ssl_keys.sh

SSL keys were generated:
– /root/certs/iRedMail_CA.pem
– /root/private/iRedMail.key

Back up the old ssl_key, and copy the new key to:

/etc/pki/tls/certs/iRedMail_CA.pem
/etc/pki/tls/private/iRedMail.key

 

 

Comments

comments