Skip to content
Bots!
Bots!
  • About
    • Myself
    • আমার দোয়া
  • Bookmarks
    • Bookmarks
    • My OCI Bookmarks
    • Useful Proxmox Commands & Links
    • Learning Nano
    • Useful Sites
    • Useful Virtualbox Command
    • Useful MySQL Command
    • Useful Linux Command
    • BTT-CAS
  • Resources
    • Webinar on Cloud Adoption for Project Managers
  • Photos
  • Videos
  • Downloads
Bots!

Install iRedmail on a CentOS 6.8 server

Rumi, March 17, 2018June 10, 2018

We need to set a FQDN hostname before we set up the mail server. On CentOS Linux, hostname is set in two files: Hostname setting:

nano /etc/sysconfig/network

# Part of file: /etc/sysconfig/network

HOSTNAME=demo.iredmail.org

Hostname <=> IP address mapping: /etc/hosts. WARNING: Please list the FQDN hostname as the first item.

# Part of file: /etc/hosts

127.0.0.1 demo.iredmail.org demo localhost localhost.localdomain

Verify the FQDN hostname with command ‘hostname -f’. If you change the hostname, please reboot the server to make it work.

$ hostname -f
demo.iredmail.org

Enable yum repositories for installing new packages
Please enable all default yum repositories in /etc/yum.repos.d/CentOS-Base.repo, and disable all third-party repositories. Repositories are enabled if you set “enabled=1” in the repo file.

Download The Latest Release Of iRedMail
Visit Download page to get the latest release of iRedMail. At least iRedMail-0.8.0-beta4 is required.

http://www.iredmail.org/download.html

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

Start iRedMail Installer
It’s now ready to start iRedMail installer, it will ask you some simple questions, that are all steps to set up a full-featured mail server.

# cd /root/iRedMail-x.y.z/
# bash iRedMail.sh

Screenshots Of iRedMail 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. We will choose PostgreSQL for example in this tutorial, please choose the one which you’re familiar with. You can manage mail accounts with iRedAdmin, our web-based iRedMail admin panel.

4) Set password of PostgreSQL admin user. PostgreSQL is used to store mail accounts and application data. e.g. Roundcube webmail, Amavisd-new.

5) Add your first mail domain name:

6) 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 has completed.

7) 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 has completed.

8) Choose optional components:

After these questions, iRedMail installer will ask you to confirm this installation. It will install and configure required packages automatically. Type y or Y and press Enter to confirm, type n or N and press Enter to cancel this installation.

...
Configuration completed.
*************************************************************************
***************************** WARNING ***********************************
*************************************************************************
* *
* Please do remember to *MOVE* configuration file after installation *
* completed successfully. *
* *
* * /root/iRedMail-x.y.z/config
* *
*************************************************************************
< Question > Continue? [y|N]

Setup DNS record for SPF

How to Setup DNS record for SPF

Please refer http://www.openspf.org/ to setup SPF record.

This is a simply example: 

iredmail.org. 3600 IN TXT "v=spf1 mx mx:mail.iredmail.org -all" or: iredmail.org. 3600 IN TXT "v=spf1 ip4:202.96.134.133 -all"

Another tip from maxie_ro: http://www.iredmail.org/forum/post5456.html#p5456

Setup DNS record for DKIM

After installation, please reboot your system, then use amavisd to help you setup DNS record.

Run command in terminal to show your DKIM keys:

amavisd showkeys
dkim._domainkey.iredmail.org. 3600 TXT ( "v=DKIM1; p=" "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDYArsr2BKbdhv9efugByf7LhaK" "txFUt0ec5+1dWmcDv0WH0qZLFK711sibNN5LutvnaiuH+w3Kr8Ylbw8gq2j0UBok" "FcMycUvOBd7nsYn/TUrOua3Nns+qKSJBy88IWSh2zHaGbjRYujyWSTjlPELJ0H+5" "EV711qseo/omquskkwIDAQAB")

Note: On some Linux/BSD distribution, you should use command ‘amavisd-new’ instead of ‘amavisd’.

if it complains “/etc/amavisd.conf not found”, you should tell amavisd the correct path of its config file. For example: “`

amavisd -c /etc/amavisd/amavisd.conf showkeys

“`

Note: Bind can handle this kind of multi-line format, so you can paste it in your domain zone file directly.
Copy output of above command into one line, like below. It will be the value of DNS record. v=DKIM1; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDYArsr2BKbdhv9efugByf7LhaKtxFUt0ec5+1dWmcDv0WH0qZLFK711sibNN5LutvnaiuH+w3Kr8Ylbw8gq2j0UBokFcMycUvOBd7nsYn/TUrOua3Nns+qKSJBy88IWSh2zHaGbjRYujyWSTjlPELJ0H+5EV711qseo/omquskkwIDAQAB

Add a ‘TXT’ type DNS record, set value to the line you copied above.
After you added this in DNS, type below command to verify it: “`

amavisd testkeys
TESTING: dkim._domainkey.iredmail.org => pass ```

If it shows ‘pass’, it works.

Note: If you use DNS service provided by ISP, new DNS record might take some hours to be available.

References
http://www.dkim.org/

Access Webmail And Other Web Applications

After installation has 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.

  • Webmail: http://your_server/mail/ (or /webmail, /roundcube. HTTPS is available also.)
  • Admin panel: httpS://your_server/iredadmin/
  • phpMyAdmin: httpS://your_server/phpmyadmin/
  • Awstats: httpS://your_server/awstats/awstats.pl?config=web (or ?config=smtp)

Src:
https://www.howtoforge.com/build-a-full-featured-mail-server-with-postfix-dovecot-postgresql-on-centos-6
https://code.google.com/archive/p/iredmail/wikis/DNS_SPF.wiki
https://code.google.com/archive/p/iredmail/wikis/DNS_DKIM.wiki
https://docs.iredmail.org/setup.dns.html#how-to-setup-the-dkim-record

Administrations Configurations (Linux) CentOSiRedmail

Post navigation

Previous post
Next post

Leave a Reply Cancel reply

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

Myself…

Hi, I am Hasan T. Emdad Rumi, an IT Project Manager & Consultant, Virtualization & Cloud Savvyfrom Dhaka, Bangladesh. I have prior experience in managing numerous local and international projects in the area of Telco VAS & NMC, National Data Center & PKI Naitonal Root and CA Infrastructure. Also engaged with several Offshore Software Development Team.

Worked with Orascom Telecom-Banglalink, Network Elites as VAS partner, BTRC, BTT (Turkey) , Mango Teleservices Limited and Access to Informaiton (A2I-UNDP)

Currently working at Oracle Corporation as Principal Technology Solution and Cloud Architect.

You can reach me [h.t.emdad at gmail.com] and I will be delighted to exchange my views.

Tags

Apache Bind Cacti CentOS CentOS 6 CentOS 7 Debain Debian Debian 10 Debian 11 Debian 12 DKIM Docker endian icinga iptables Jitsi LAMP Letsencrypt Linux Munin MySQL Nagios Nextcloud NFS nginx pfsense php Postfix powerdns Proxmox RDP squid SSH SSL Ubuntu Ubuntu 16 Ubuntu 18 Ubuntu 20 Varnish virtualbox vpn Webmin XCP-NG zimbra

Topics

Recent Posts

  • Install Jitsi on Ubuntu 22.04 / 22.10 April 30, 2025
  • Key Lessons in life April 26, 2025
  • Create Proxmox Backup Server (PBS) on Debian 12 April 19, 2025
  • Add Physical Drive in Proxmox VM Guest April 19, 2025
  • Mount a drive permanently with fstab in Linux April 16, 2025
  • Proxmox 1:1 NAT routing March 30, 2025
  • Installation steps of WSL – Windows Subsystem for Linux March 8, 2025
  • Enabling Nested Virtualization In Proxmox March 8, 2025
  • How to Modify/Change console/SSH login banner for Proxmox Virtual Environment (Proxmox VE / PVE) March 3, 2025
  • Install Proxmox Backup Server on Debian 12 February 12, 2025

Archives

Top Posts & Pages

  • Install Jitsi on Ubuntu 22.04 / 22.10
©2025 Bots! | WordPress Theme by SuperbThemes