Install and configure iRedMail on Ubuntu with Screenshots
A DNS MX record tells the internet where to send email directed at you domain. Before your server can receive email for addresses at a domain, an MX record must be created for that domain, pointing to your Server IP address.
Add SPF records to make sure others cant spoof emails by pretending to send them from your domain.
Make sure to have “-all” in your SPF record, and point it to your droplet’s IP.
The record’s format would be “v=spf1 ip4:IP_ADDRESS -all”
Followings are the step to Install and configure iRedMail :
First check you server hostname for maling.
[email protected]:~$ hostname linuxtweaks.in [email protected]:~$ hostname -f mail.linuxtweaks.in
Make sure to set the hostname of your domain name if you havn’t.
Download the latest release of iRedMail. The current release, as of 16 September 2014, is 0.8.7 and can be downloaded by entering the following:
Visit Download page to get the latest stable release of iRedMail.
Uncompress the package and run the script:
tar jxvf iRedMail-0.8.7.tar.bz2 && cd iRedMail-0.8.6 hostname linuxtweaks.in bash iRedMail.sh
The remainder of the installation refers to on-screen confirmation of default options and selections. With the exception of the backend and hostname selections, most users will simply confirm the default options and continue the installation.
Screenshots of installation:
Press “enter” to say “yes” to installing iRedMail. NOTE: Ctrl-C will exit the installation process in any step of process.
Press “enter” to accept /var/vmail as the default mail storage directory or you can change the directory path.
Use the “up” and down arrow keys to highlight your preferred backend. Press “space” to select your preferred option, then press “enter”. If you’re unsure, choose
Choose a password for your MySQL root administrator and press “enter”.
Enter your domain name as the first virtual domain name and press “enter”.
By default, iRedMail configures [email protected] as the default administrator. Enter a password for your iRedMail administrator and press “enter”.
The next screen lists optional components to be included in your MySQL backend. These are all optional for mail server but recommend for the installation for security of your mail server.
The installer then downloads and installs the appropriate files. After it completes, you will receive a prompt asking whether you would like to use iRedMail’s firewall rules at
/etc/default/iptables, and identifies your SSHD port. Type “y” to accept, or “n” if you want to configure your firewall manually.
After typing “y”, the install screen will ask if you’d like to restart the firewall. Type “y”.
The installation is now complete! While this screen will shows the location of the iRedMail tips file
Navigate to https://mail.yourdomain.com/mail and login as “[email protected]” to retrieve the necessary info.
Although this step is optional if you just want to use self-generated certificate, we would still recommend getting a trusted SSL certificate.
By default, iRedMail will create a self-signed certificate and store it in /etc/ssl/certs/iRedMail_CA.pem and /etc/ssl/private/iRedMail.key
We can get a free SSL certificate from InstantSSL
You would need to create a CSR and private KEY first:
cd /etc/ssl openssl req -out cloudmail.tk.csr -new -newkey rsa:2048 -nodes -keyout cloudmail.tk.key
This will generate 2 files: cloudmail.tk.csr (your Certificate Signing Request file), and cloudmail.tl.key (your private SSL key which should not be shared with anyone).
You would provide the CSR file (cloudmail.tk.csr) to InstantSSL during SSL request.
After they have validated your request, you will receive the certificate file (in zip format) that contains two files:
cloudmail_tk.ca-bundle (your SSL certificate bundle)
cloudmail_tk.crt (your SSL certificate)
Place both files to /etc/ssl and modify /etc/apache2/sites-available/default-ssl
SSLCertificateFile /etc/ssl/linuxtweaks.in.crt SSLCertificateKeyFile /etc/ssl/linuxtweaks.in.key SSLCACertificateFile /etc/ssl/linuxtweaks.in.ca-bundle.crt
service apache2 restart
Now you should have SSL enabled, and you can proceed to logging in to iRedAdmin (https://linuxtweaks.in/iredadmin/ ) with username [email protected] and password you provided during installation in Step 3.
iRedMail is packaged with a mail server account configuration called iRedAdmin. Below are the steps required to add a user/mailbox to your mail server.
1. To access iRedAdmin, navigate to
https://yourdomain.com/iredadmin and log in with your [email protected] user.
2. Once the dashboard page loads, navigate to the
Add dropdown and select
3. Fill in the address, password, display name, and mailbox quota blocks then click Add will complete the process.