Sunday, January 12, 2014

How to install iRedMail on Debian 7 (Wheezy)

What iRedMail is?
----------------------

            >> A ZERO COST, fully fledged, full-featured mail server solution.
           All used packages are free and open source, provided by the Linux/BSD     distribution venders you trust.
           
           >> An open source project, released under GPLv2, hosted on BitBucket.

What iRedMail does?
-----------------------------
        >> Install and configure mail server related BINARY packages automatically from the official software
           repositories provided by Linux/BSD distribution venders.

What Opensource Software are Used in iRedMail ?
-----------------------------------------------------------------


            >> Postfix: SMTP service

        >> Dovecot: POP3/POP3S, IMAP/IMAPS, Managesieve service

        >> Apache: Web server

        >> MySQL/PostgreSQL: Storing application data and/or mail accounts

        >> OpenLDAP: Storing mail accounts

        >> Policyd: Postfix policy server

        >> Amavisd: An interface between Postfix and SpamAssassin, ClamAV. Used for spam and virus scanning.
   
        >> Roundcube: Webmail

            >> Awstats: Apache and Postfix log analyzer

            >> Fail2ban: scans log files (e.g. /var/log/maillog) and bans IPs that show the malicious signs
             -- too many password failures, seeking for exploits, etc.


========================================
--------------------------------------------------------
iRedMail Installation and Configuration:
-------------------------------------------------------
========================================



Please check your host record is Ok...
--------------------------------------------------
    # vim /etc/hosts

===========================================================
127.0.0.1       localhost
127.0.1.1       mx.mithu.com    mx
172.16.0.7      mx.mithu.com    mx

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
===========================================================



Check your debian squeeze source list is Ok...
---------------------------------------------------------
   
    # vim /etc/apt/sources.list

===========================================================
deb http://http.debian.net/debian wheezy main
deb-src http://http.debian.net/debian wheezy main

deb http://security.debian.org/ wheezy/updates main
deb-src http://security.debian.org/ wheezy/updates main
===========================================================


Dont forget to update & upgrade:
----------------------------------------
    # apt-get update
    # apt-get upgrade


You may need to Install the package 'bzip2' so that you can uncompress iRedMail installer.

    # sudo apt-get install bzip2


Download the latest iRedMail Package:(Supposed to be in /root directory)
------------------------------------------------------------------------------------------
    # wget https://bitbucket.org/zhb/iredmail/downloads/iRedMail-0.8.6.tar.bz2
    # cd /root/
    # tar xjf iRedMail-0.8.6.tar.bz2

=============================
Now Start iRedMail installer:
=============================

    # cd /root/iRedMail-0.8.6/
    # bash iRedMail.sh



Screens that will during installation:
--------------------------------------------

    ~ Welcom and thanks for use >> Click Yes
    ~ Specify location to store all mailboxes. Default is /var/vmail/
    ~ Choose backend used to store mail accounts. Please choose the one which you're familiar with. [I prefer MySql]
    ~ Set password of MySQL root user. MySQL is used to store data of other applications, e.g. Roundcube webmail, Policyd, Amavisd-new.
    ~ Add your first mail domain name : mithu.com [Don't be confused...Give only the domain not fqdn]
    ~ Set password of admin account of your first mail domain. [Give your desired pass $**********$ ]
    ~ Choose optional components : [Select All and press Next...]
    ~ Setup will ask for iptables config and restart the firewall ...[ Type { Y } and press enter ]


configure Mail clients (Microsoft Outlook):
====================================
User Inforamtion ~
          >> Your Name: Mehedi Hasan
          >> Email Address : mithu@imehedi.com

Server Information ~
          >> Account Type: IMAp
          >> Incomming Mail Server: 116.193.170.5
          >> Outgoing Mail Server (SMTP): 116.193.170.5


Logon Information ~
          >> User Name: mithu@imehedi.com {need [user@FullDomain] because iRedMail supports multiple virtual domains }
          >> Password:  $*********$.

Go to More Settings ~
            >> Go to Outgoing Server Tab >> Tick Mark [V] on My Outgoing Server (SMTP) requires authentication >> Select Log On using (Radio Button)
                =>> User Name: mithu@imehedi.com
                =>> Password:  $*********$.
                =>> Tick Mark [V] on Remember Password


                >> Go to Advanced Tab
                =>> Incomming Server (IMAP): 143
                =>> Use the type of encrypted connection: Choose TLS
                =>> Outgoing Server (SMTP): 25
                =>> Use the type of encrypted connection: Choose TLS


Trouble Shooting:
===============
Problem 1. Recipient address rejected: Greylisting in effect, please come back later.
-------------

Solution:  This is the way to disable Greylisting effect in iRedMail:

    # vim  /etc/cluebringer/cluebringer.conf

==========================
Change

# Greylisting module
[Greylisting]
enable=1

to

# Greylisting module
[Greylisting]
enable=0
===========================

Now the restart the serviec to take effect:
    # /etc/init.d/postfix-cluebringer restart



Problem 2. Helo command rejected: need fully-qualified hostname.
------------


Solution: 
This type  of error will appear when we try to send message from various mail clients like Outlook, thunderbird etc. To solve this problem:

Go to More Settings ~
            >> Go to Outgoing Server Tab >> Tick Mark [V] on My Outgoing Server (SMTP) requires authentication >> Select Log On using (Radio Button)
                =>> User Name: mithu@imehedi.com
                =>> Password:  $*********$.
                =>> Tick Mark [V] on Remember Password

2 comments: