WARNING: iRedMail is designed to be deployed on a FRESH server system, which means your server does NOT have mail related components installed, e.g. MySQL, OpenLDAP, Postfix, Dovecot, Amavisd, etc (iRedMail will install and configure them for you automatically). Otherwise it may override your existing files/configurations althought it will backup files before modifing, and it may be not working as expected.

 

To install iRedMail, you need:

  • A FRESH, working OpenBSD system. The latest OpenBSD 5.3 release is supported. All supported Linux/BSD distributions and releases are listed on page Features of iRedMail.
  • Required file sets are:
    • baseXX.tgz
    • etcXX.tgz
    • compXX.tgz
    • manXX.tgz
    • xbaseXX.tgz
  • At least 1GB of memory is required for production use. if you have less memory, you have to disable spam/virus scanning by following our wiki tutorial. WARNING: It's strongly recommended to enable spam/virus scanning for production use, so please go get at least 1GB memory for your mail server.

Notes:

  • All binary packages will be installed with command 'pkg_add -i'.
  • Apache chroot is disabled by default, required by iRedAdmin - the web-based admin panel.
  • PF is enabled by default, with basic rules for ssh and mail services.
  • spamd(8) is enabled by default for greylisting, whitelisting, blacklisting.
  • Sendmail is disabled by default, replaced by Postfix.

Set a fully qualified domain name (FQDN) hostname on your server

Enter command 'hostname' to view the current hostname:

$ hostname
demo-mx.iredmail.org

On OpenBSD, hostname is set in two files:

  • /etc/myname: hostname setting
demo-mx.iredmail.org
  • /etc/hosts: hostname <=> IP address mapping. Warning: List the FQDN hostname as first item.
# Part of file: /etc/hosts
127.0.0.1   demo-mx.iredmail.org demo-mx localhost localhost.localdomain

Verify the FQDN hostname. If it wasn't changed, please reboot server to make it work.

$ hostname
demo-mx.iredmail.org

Set PKG_PATH to your favorite location for installing binary packages

iRedMail will install all required binary packages with command 'pkg_add', it will automatically look the location specified in PKG_PATH environment variable for required packages.

Now login to the OpenBSD server as root user, set a valid PKG_PATH in /root/.profile. For example:

export PKG_PATH="http://ftp.jaist.ac.jp/pub/OpenBSD/`uname -r`/packages/`machine -a`/"

Install Bash shell, it's required by iRedMail.

# . /root/.profile    # <- This steps is required, used to set PKG_PATH without re-login.
# pkg_add bash

Download the latest release of iRedMail

  • Visit Download page to get the latest release of iRedMail.
  • Upload iRedMail to your mail server via ftp or scp or whatever method you can use, login to the server to install iRedMail. We assume you uploaded it to directory /root/iRedMail-x.y.z.tar.bz2 (replace x.y.z by the actual version number).
  • Uncompress iRedMail tarball:
# cd /root/
# tar xjf iRedMail-x.y.z.tar.bz2

It's now ready to start iRedMail installer, it will ask you some simple questions, that's all steps to setup a full-featured mail server.

For Chinese users: Our domain name "iredmail.org" is blocked in China mainland since Jun 04, 2011, please replace all 'iredmail.org' by its IP address "106.187.51.47" (without quotes) in /root/iRedMail-x.y.z/pkgs/get_all.sh BEFORE executing "iRedMail.sh". This is a Linode VPS hosted on Tokyo, Japan.
# cd /root/iRedMail-x.y.z/
# bash iRedMail.sh

It will ask you to choose version numbers for several packages, please choose below versions:

  • openldap-2.4 (if you choose to store mail accounts in OpenLDAP)
  • php-5.3
  • postfix-2.10 for OpenBSD 5.4, or postfix-2.9 for OpenBSD 5.3.
  • p5-Mail-SPF (instead of p5-Mail-SPF-Query)
  • gnupg (instead of gnupg-xxx-idea-card-ldap)

Screenshots of installation:

1) Welcome and thanks for your use

2) Specify location to store all mailboxes. Default is /var/vmail/.

3) Choose backend used to store mail accounts. Please choose the one which you're familiar with. You can manage mail accounts with iRedAdmin, our web-based iRedMail admin panel.

4) If you choose to store mail accounts in OpenLDAP, iRedMail installer will ask you two questions about OpenLDAP.

4.1) LDAP suffix.

4.2) Password of LDAP root dn.

5) Set password of MySQL root user. MySQL is used to store data of other applications, e.g. Roundcube webmail, Policyd, Amavisd-new. If you choose to store mail accounts in MySQL, you will see this dialog too.

6) Add your first mail domain name

7) Set password of admin account of your first mail domain. Note:

  • This account is used only for system administration, not a mail user. That means you CANNOT login to webmail with this account.
  • You can login to iRedAdmin (web-based iRedMail admin panel) with this account for mail accont management, login name is full email address.
  • Admin username is hard-coded, you can create new admins with iRedAdmin after installation completed.

8) Set password of first mail user of your first mail domain. Note:

  • This account is a normal mail user, that means you can login to webmail with this account, login name is full email address.
  • Username is hard-coded, you can create new mail users with iRedAdmin after installation completed.

9) Choose optional components

After answered these questions, iRedMail installer will ask your confirm to start installation. It will install and configure required packages automatically. Type 'y' or 'Y' (without quotes) and press 'Enter' to confirm.

Configuration completed.

*************************************************************************
**************************** WARNING ***********************************
*************************************************************************
*                                                                       *
* Please do remember to *REMOVE* configuration file after installation  *
* completed successfully.                                               *
*                                                                       *
*   * /root/iRedMail-x.y.z/config
*                                                                       *
*************************************************************************
<<< iRedMail >>> Continue? [Y|n]        # <- Type 'Y' or 'y' here, and press 'Enter' to continue
  • Read file /root/iRedMail-x.y.z/iRedMail.tips first, it contains:
    • URLs, usernames and passwords of web-based applications
    • Location of mail serve related software configuration files
    • Some other important and/or sensitive information
  • Setup DNS record for SPF
  • Setup DNS record for DKIM

After installation successfully completed, you can access web-based programs if you choose to install them. Replace 'your_server' below by your actual server name or IP address.

Component URL
Webmail https://your_server/mail/
iRedAdmin (admin panel) httpS://your_server/iredadmin/
phpMyAdmin httpS://your_server/phpmyadmin/
phpLDAPadmin httpS://your_server/phpldapadmin/
phpPgAdmin httpS://your_server/phppgadmin/

Please post all issues, feedbacks, feature requests, suggestions in our online support forum, it's more responsible than you expected: http://www.iredmail.org/forum/.