This tutorial will walk you through the process of installing the iRedMail bundled mail server to successfully send and receive e-mail.
This tutorial assumes a few things:
Read this before continuing:
Mail servers are complex pieces of software and can be difficult to setup and maintain. An improperly configured mail server could cause quite a havoc not only on your server but for the rest of the Internet if spammers begin using your servers to send spam. Before attempting to run a mail server please be sure that you have a comfortable understanding of DNS (SPF/TXT/MX records), Domain Keys, Sender Policy Framework, and how mail servers/mail flow works. If you are not sure about any of these topics please read up before continuing otherwise you may run into problems and become frustrated very quickly.
Before we can begin installing the mail server we need to setup our reverse DNS. Without this you will find it hard to send or receive alot of e-mail across the Internet because servers will think you are spamming them or sending falsified e-mail.
Setting up reverse DNS through our Control Panel is very easy. Please refer to our instruction on how to setup a reverse DNS record. Keep in mind that DNS changes may take up to 24 hours to propagate across the Internet.
Once you have your reverse DNS entries setup we can begin setting up the server. First we will make sure that our server is update to date software-wise. To do this we will run a YUM update:
# sudo yum update
Note: You may get asked to import a key... simply press Y and Enter.
One final step that needs to take place is setting up the host name of your mail server. You can view your current host name by typing:
# hostname --fqdn kelly.myServer
Now this might work for most applications but for a mail server this just won't do! We need to set your mail server's host name to match the Fully Qualified Domain Name. A Fully Qualified Domain Name, or FQDN, might look like www.google.com. For most mail servers it will be something like mail.yourdomain.com.
Have no fear! Changing your host name is a very simple task!
To change your host name we will need to modify the /etc/sysconfig/network file on your server. This is the file that stores the host name information.
# sudo nano /etc/sysconfig/network
When the nano editor opens scroll down to the line that reads HOSTNAME= and change your host name. Like I said earlier, most mail servers are mail.yourdomain.com. Be sure to write down what you set your host name to as we will need it later on.
Once you have modified the HOSTNAME= line simply press CTRL-X followed by Y and Enter to save.
We have one more change to make before we can begin the installation. When addressing your FQDN we need to tell the server that it will be referring to itself and not some IP on the Internet. This will help reduce traffic and helps the server know where it is located. To do this we will need to modify the /etc/hosts file. This, too, is an easy task!
To modify the hosts file type the following:
# sudo nano /etc/hosts
The nano editor will open with your hosts file. Simply go to the bottom of the file and add a line, changing mail.mydomain.com to match your FQDN.
127.0.0.1 mail.mydomain.com
You will see that there is already a 127.0.0.1 entry in the file with localhost -- this is okay. To save the file simply press CTRL-X followed by Y and Enter as we did before.
We need to make sure that YUM has all of the available software modules available to it during our installation. To do this we need to make sure that the default YUM repositories that are shipped with CentOS are enabled. Type the following to look at the appropriate 'repo' file:
# cd /etc/yum.repos.d/
# sudo nano CentOS-Base.repo
You will be presented with the nano text editor and a long list of repository definitions. Scroll through each one and change the enabled=0 lines to enabled=1.
Once you have finished simply save the file with CTRL-X, Y and Enter.
Now we need to test our repository changes. To do this type the following:
# sudo yum clean all
# sudo yum list
This should produce a long list of items -- this is okay.
You're probably thinking "when are we going to install the software?" Have no fear, we are almost there! First we need to install a couple of software packages for the system to install correctly. The following software packages need to be installed:
# sudo yum install acl wget createrepo dialog
We need to enable ACL access control on the file system. Please read this portion very carefully! Making improper changes to this file could destroy your file system!
Read this again! Making improper changes to this file could destroy your file system
Open up the /etc/fstab file and modify the mount options that are used to mount the main file system partition.
# sudo nano /etc/fstab
Look for a line that begins with either /dev/sda1 or /dex/xvda1 and put a # comment mark in front of it.
If that line started with /dev/sda1 go to the bottom of the file and type or copy in the following line:
/dev/sda1 / ext3 errors=remount-ro,noatime,acl 0 1
If the line started with /dev/xvda1 go to the bottom of the file and type or copy in the following line instead:
/dev/xvda1 / ext3 errors=remount-ro,noatime,acl 0 1
Save the file with CTRL-X, then Y and Enter.
Take a breath!
Once you have the changes made to the /etc/fstab file you now need to reload them. This is fairly easy to do.
# sudo mount -o remount,rw,acl /
Now we are ready to install iRedMail!
To install iRedMail you will need to download the installation package from their website. Please point your web browser to http://code.google.com/p/iredmail/downloads/list and download the latest version. At the time of writing the current version is 0.6.0. For the purposes of our installation we will be using wget to download the installation package. Note that we are downloading this to the home directory of the current user.
# cd ~
# wget http://iredmail.googlecode.com/files/iRedMail-0.6.0.tar.bz2
You'll notice that iRedMail comes packaged as a TAR file with further BZ2 (BZip2) compression. To unpack this type the following:
# sudo tar xjf iRedMail-0.6.0.tar.bz2
This will create a directory called iRedMail-0.6.0.
A few packages need to be downloaded by the installer before installation can commence. Run the following lines of code to make this happen:
# cd iRedMail-0.6.0/pkgs/ (Note that the directory name may differ between versions)
# sudo bash get_all.sh
This will download all of the packages necessary and make them available to YUM. Now we need to refresh the repository list:
# sudo yum clean all
# sudo yum list
The moment has come! To start the installation type the following:
# cd ~/iRedMail-0.6.0 (Note that the directory name may differ between versions)
# sudo bash iRedMail.sh
You will see a welcome screen, press OK.
You will be prompted for the home directory location for the vmail user. The default value, /home/vmail, will be listed -- this is okay. Simply press OK for the default option.
You will be asked which backend you would like to use: MySQL or OpenLDAP. Because of the simplicity and popularity of MySQL we will use that. Because it is the default installation item go ahead and press OK for the default option, MySQL.
You will be prompted for your MySQL password. Enter it here and press OK.
You will be prompted for the vmail user password as well. This will be a system user that holds all of your mail. Type it and press OK.
You will be asked to enter your first virtual domain. This is the domain that you will be hosting mail for. Type in your domain name (such as mydomain.com) and press OK.
You will be prompted to enter the administrator name of your virtual domain. The default value of postmaster is an industry standard and should be used. This address will be postmaster@mydomain.com when the installation is completed. Press OK.
You will be prompted to enter a password for the above postmaster e-mail address. Press OK after you have entered it.
You will be asked to add your first user for your domain. This will be your first e-mail account such as john.doe. The full e-mail address would be john.doe@mydomain.com. Enter the user name here and press OK.
Next you will be asked what password you would like to use for the user we just setup. You will see the full e-mail address at the top of the window. Type in the password and press OK.
You will be prompted if you would like to setup SPF (Sender Policy Framework) and DKIM (DomainKeys Identified Mail). SPF is highly recommended, but DKIM is optional and should only be installed by more experienced users. Uncheck DKIM if you are unfamiliar with it. Keep in mind that these will require additional DNS entries to be made. If you would like to use these simply press OK. We will walk you through setting up the SPF and DKIM records later.
You will be asked if you would like to use ManageSieve to process SIEVE scripts from the user end without administrative access. Leave this option checked and press OK.
You will be asked what services you would like to support: POP3, POP3S, IMAP, IMAPS. By default all are selected -- leave this and press OK.
You will be asked what WebMail application you would like to use. Because we are using the MySQL back-end it is recommended to use the RoundCubeMail application. Because it is the default option simply press OK. Keep in mind that choosing another WebMail client is considered outside the scope of this article and will not be supported.
You will be asked for your default language for WebMail. Select your language and press OK.
Because we are choosing MySQL as our back-end we have a number of administrative tools we can install. Those tools include phpMyAdmin, PostfixAdmin and AWstats. By default they are all checked so click OK. If you would like to deselect any go ahead and do that.
You will be asked what e-mail address to use for the PostfixAdmin administrative e-mail. You can use the default postmaster@mydomain.com e-mail or use a different address. Click OK.
You will be asked to put an e-mail address to use for the root user. This is where all system e-mail will be sent pertaining to the system and the root user. Put in your e-mail address and press OK. It is advised to use an e-mail address NOT hosted on your mail server.
You will be prompted to continue with the installation. Press Y and then Enter.
You will be prompted at the end of the installation if you would like to use the default iptables firewall configuration. If you have a brand new server simply press Y and then Enter. Do not do this if you have previously made modifications to your iptables configuration.
You will then be prompted if you would like to restart iptables. For now press N and press Enter.
You will be asked if you would like to use the MySQL configuration shipped with iRedMail. Select Y and press Enter.
You will be asked if you would like to run freshclam. Press N and then Enter.
You will be asked if you would like to start Postfix now. Press N and press Enter.
You installation should now be finished and you will be returned to a shell prompt.
Before this server is ready to be used in a production environment it must be safely locked down and the setup files should be removed. This is easily accomplished with one rm statement.
# rm -f ~/iRedMail-0.6.0/config
Go ahead and reboot the server to reload everything and cleanly start Postfix.
# sudo reboot
Now we will need to go setup an SPF record. Go to http://old.openspf.org/wizard.html to determine what your SPF record should be. Once you have done this please submit a ticket and we will process your SPF record. Note that your mail may still function without this but you may receive frequent mail rejections.
To create a the Domain Key entry type the following:
# sudo /usr/sbin/amavisd showkeys
You will see an output like the following:
[user@mail ~]$ sudo /usr/sbin/amavisd showkeys
; key#1, domain mydomain.com, /var/lib/dkim/mydomain.com.pem
dkim._domainkey.mydomain.com. 3600 TXT (
"v=DKIM1; p="
"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCuv5EpKWzSRGm8Gtks8uDEpllQ"
"Ug50USM6LjIEfx77+C9c3GpuxtTdfYMUlA7nqlolJ0GCx+PPrbSOCKZO1UeHAG2M"
"/KYC9Kw8ByqP80Ni+Xx+M2fNSQCn4c+fmsX6AwLHZfshTmR6lGNTL/VMi84GgJtA"
"vfufWEShr/j8f4udcwIDAQAB")
If you are hosting your DNS with Cloud Servers please submit a ticket and request that the domain key is added. We will create a TXT record for your domain with the above key. If you are hosting your DNS elsewhere you will need to create a TXT record for dkim._domainkey.mydomain.com and use the enclosed text (without the quotes) as the content.
Once you have the TXT record created you can test it on your server by typing the following:
# sudo /usr/sbin/amavisd testkeys
If it passes you should see something like the following:
TESTING#1: dkim._domainkey.mydomain.com => pass
If you receive 'fail' then you may have a problem with your key. Please check it again. This will also result from DNS entries that have not propagated yet.
Reboot your server one more time.
# sudo reboot
Once the server has come back online proceed below.
Point your web-browser to http://mail.mydomain.com/mail/ and this should bring up the RoundCubeMail WebMail application. Type in your login name and password and click Login. Send yourself an e-mail from another e-mail account to see if it is working. You can also send an e-mail to someone on the Internet to test outbound e-mail.
You can find information about your installation file located here: ~/iRedMail-0.6.0/iRedMail.tips
The following links are valid for your iRedMail installation. Please replace mail.mydomain.com with your FQDN.
If you are having troubles with your mail server you might want to take a peek at the logs. To view the logs for iRedMail simply type the following:
# sudo tail -F /var/log/maillog
This will display the last output of the log and show the entries as they are added in real-time. Your output may look like the output below:
Jul 8 23:25:53 mail postfix/smtp[4530]: 2CBEFD49DD: to=, relay=127.0.0.1[127.0.0.1]:10024,
delay=2251, delays=2251/0.04/0/0.44, dsn=2.0.0, status=sent (250 2.0.0 Ok, id=04262-04, from
MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 87F93D49DA)
Jul 8 23:25:53 mail postfix/qmgr[4298]: 2CBEFD49DD: removed
Jul 8 23:25:53 mail postfix/pipe[4536]: 87F93D49DA: to=, relay=dovecot, delay=0.06,
delays=0.04/0.01/0/0.02, dsn=2.0.0, status=sent (delivered via dovecot service)
Jul 8 23:25:53 mail postfix/qmgr[4298]: 87F93D49DA: removed© 2011-2013 Rackspace US, Inc.
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License

28 Comments
Hit a snag at getting all the extra packages for iRedMail
< ERROR > Please configure a fully qualified domain name (FQDN) in /etc/hosts before we go further.
Example:
127.0.0.1 mail.iredmail.org mail localhost
I did it exactly how the instructions requested it, and tried to mirror the suggested example, to no avail.
Please help!
RE: Hit a snag at getting all the extra packages for iRedMail
Sorry to hear that you are running into a problem with the FQDN requirement in /etc/hosts. Please ensure that you are entering a domain (as opposed to an FQHN), save the changes to /etc/hosts, and try to download the Installation related packages for the appropriate version of iRedMail again. What Linux distribution are you installing this on? Make sure and check the iRedMail official installation guides for your appropriate distribution here: http://www.iredmail.org/doc.html - and please let us know if we can be of any more help.
This is for CentOS, running
I have double checked everything a couple times (including your link) and can't figure out what the problem is.
Could you explain your differentiation between FQDN and domain? If that isn't it, can support troubleshoot this?
RE: This is for CentOS, running
Sure thing! An FQDN is a fully qualified domain name which contains a host name/domain, and TLD (Top Level Domain) like mail.yahoo.com. (here the trailing '.' signifies an empty TLD) An FQHN can be spelled out in the same way, or you might try using the IP address of that server. Try adding a trailing '.' after the host name, or using the numerical IP address for your server.
I'm getting the same error as
Using iRedMail-0.7.3.tar.bz2
Re: FQDN
The main purpose, I think, is to make sure you get your fully-qualified domain name back when you run the command:
host -f
After setting the name in /etc/hosts it's possible some systems may need to be rebooted before they will use that information to return the FQDN to the host query.
Installation Failed
Thanks for your comment! I
Re: iRedMail installation error
Failed during iRedMail installation
http://iredmail.org/yum/rpms/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found : http://iredmail.org/yum/rpms/repodata/repomd.xml
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: iRedMail. Please verify its path and try again
Re: repodata directory
If you're still getting the error, exactly which step are you on when you get that message? The "get_all" script?
Worked on 2nd try
Re: working
CentOS 6 DKIM & iRedMail-0.7.4
sudo /usr/sbin/amavisd showkeys
It looks for /etc/amavisd.conf which does not exist.
It now exists in /etc/amavisd/amavisd.conf.
So I sym linked it.
ln -s /etc/amavisd/amavisd.conf /etc/amavisd.conf
Just thought I would point it out for others.
Outlook error
I'm using this server to send and recive mails only in local area network.My problem is,every time that we open outlook it getting an internet security warning it is " The server you are connected to is using a security certificate that cannot be verified. The target principal name is incorrect. Do you want to continue using this server? always i have to click yes.. how can i fix this error
Re: certificate
Try checking the Outlook config for the account, and if it's trying to use an encrypted (SSL) connection, switch it to an unencrypted connection (if it's just on the LAN, that should be okay).
It may be a little late to
Visit this page http://www.rackspace.com/apps/support/portal/1088 for the details on the correct settings. It also has a link to the port checker tool which will tell you if the necessary ports are open. I'd put the settings here, but if they change in the future, then the info would be outdated.
I'm running CentOS 6.3. I am
Error: Package: 5:postfix-2.5.9-5.ired.x86_64 (iRedMail)
Requires: libmysqlclient.so.15(libmysqlclient_15)(64bit)
Error: Package: policyd-1.82-4.rhms.x86_64 (iRedMail)
Requires: libmysqlclient.so.15()(64bit)
Error: Package: 1:perl-Convert-UUlib-1.11-1.ired.x86_64 (iRedMail)
Requires: perl(:MODULE_COMPAT_5.8.8)
Error: Package: pysieved-1.0-2.ired.noarch (iRedMail)
Requires: python(abi) = 2.4
Installed: python-2.6.6-29.el6_3.3.x86_64 (@updates)
python(abi) = 2.6
Available: python-2.6.6-29.el6_2.2.i686 (base)
python(abi) = 2.6
Error: Package: 5:postfix-2.5.9-5.ired.x86_64 (iRedMail)
Requires: libmysqlclient.so.15()(64bit)
Error: Package: policyd-1.82-4.rhms.x86_64 (iRedMail)
Requires: libmysqlclient.so.15(libmysqlclient_15)(64bit)
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
< ERROR > Installation failed, please check the terminal output.
I thought maybe it was because I had installed MySQL prior to this, but I uninstalled that and I still get the error.
re: error
The other issue is that the version of iRedMail described in this (older) article requires Python 2.4, and you have Python 2.6 installed. You should be able to poke around the web and find instructions for installing Python 2.4 alongside 2.6, but be careful - 2.6 is probably required by some system tools.
You might check the iRedMail website for a newer version (0.8.3 at this time) to see if it might be compatible with Python 2.6, eliminating the need to install the older python version.
http://www.iredmail.org/
Does iRedMail works on Fedora?
re: Fedora
The distributions supported by iRedMail are listed here:
http://www.iredmail.org/download.html
User password error
re: password
http://sourceforge.net/projects/postfixadmin/
I have a error when i have
"Error: (1364, "Field 'disclaimer' doesn't have a default value")".
I had migration the mysql to the remote host and this tables is same.
re: Default value
http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html#sqlmode_strict_trans_tables
Error: (1364, "Field 'disclaimer' doesn't have a default value")
AD&LDAP change password error
re: LDAP
http://www.iredmail.org/forum/forum2-iredmail-support.html
Add new comment