How to install iredmail with mysql in Ubuntu 12.04 LTS

How to install iredmail with mysql in Ubuntu 12.04 LTS

Introduction: iredmail is a mail server software which basically uses the Postfix(MTA). You can create virtual user and virtual domain in iredmail server from its admin panel.

It has both free and paid version. For more detail visit http://www.iredmail.org/

In this tutorial we will learn to install iredmail (free version) in Ubuntu 12.04 LTS with mysql authentication.

Follow the given below steps:

Step 1: First install the mysql server ,if you already have mysql server you can skil this step.

sudo apt-get install mysql-server

In between of installation the system will ask you to give root password. Give strong mysql password.

mysql

mysql2

Step 2: Set the hostname and FQDN of the system . To find hostname we use the command “hostname” and for FQDN “hostname -f” (FQDN = Fully Qualified Domain Name)

Here,
Hostname = ubuntu (replace ubuntu word with your system name)
FQDN = ubuntu.example.com (replace example.com with your domain name)

Note: ipaddress in /etc/hosts file you can use loopback address also. (127.0.1.1)

vi /etc/hosts
192.168.56.101 ubuntu.example.com ubuntu

Restart the hostname so that hostname change could take effect

/etc/init.d/hostname restart

Check the hostname and FQDN,by below given command

For hostname = hostname
For FQDN = hostname -f

Step 3: Download the iredmail package from its download site. i.e http://www.iredmail.org/download.html or through command line we will directly download the package into our system.

wget https://bitbucket.org/zhb/iredmail/downloads/iRedMail-0.8.4.tar.bz2

Now untar the package

tar -xvjf iRedMail-0.8.4.tar.bz2

It will extract out a folder called iRedMail-0.8.4

Step 4: Now we will install the iRedMail-0.8.4. login with root or become super user

sudo su – (give the current login user password means your password)

OR

su – (Give root password)

change to directory iRedMail-0.8.4

cd iRedMail-0.8.4

Now use bash command to run the script

bash iRedMail.sh

you will get the first welcome page, select yes

ired2

The installation script will continue itself.Now you will see next Input box in your screen.
It is for Defualt Mail Storage Path. By-Default it uses /var/vmail but as per your requirement you can change the directory path.
After doing this select Next.

ired3

The script will be continue and running

Now in next step you will see a screen with information in table Backend,Web Wail and Web-based management tool.
Here we have only option to select any Backend other sections are by-defualt packages offered by iredmail.
Here we will select mysql and then Next.

ired4

Wait for a few minutes.In next step on screen you will get dialog box of giving mysql root password.
Give the same mysql root password which you have set in starting of this tutorial.

ired5

The script will be still running.

In next step you will see a screen for specifying virtual domain name. Give the domain name (replace test.com with your domain name)

ired6

Now it will ask password for postmaster account of your domain name.Give the password.
This is a primary account you can login with this account in webmail as well as iRedAdmin web console also.

ired7

Wait ,script is still running

Now in next screen you will see all option are bydefault selected. Kindly let it be and select Next These all things are important. (DKIM is important,it is Mail server standard for Domain Key Identification)

ired8

Now type Y for yes, The next screen is telling important message kindly make a note of it and after installation as per your security structure place the file in secured directory.

ired9

Now some Questions will come in your screen. Select as per your requirement.By-defualt we are doing Yes.

ired10

Plz. wait script is running.

In last screen, you will get final message.It means installation is complete.

ired11

Open the web browser

For Webmail access:
IpAddress/mail or FQDN/mail
for eg.
ubuntu.example.com/mail

You will get the below screen of roundcube

ired12

For iRedAdmin access webpage

IpAddress/iredadmin or FQDN/iredadmin
for eg.
ubuntu.example.com/iredadmin

The server is OK for internal network.
If you are using the iRedMail server in production it is important to setup following things in DNS .

(1) PTR record (For PTR record contact to your ISP,Datacenter or Cloud Service wherever your server exist)
(2) SPF record
(3) DKIM
(4) DMARC (optional)

I will write on setting DNS record for mail server in next coming post.

Leave a Reply

Your email address will not be published. Required fields are marked *