Mar 12, 2014: We help shared, VPS or Dedicated platform organisations who wish to migrate, improve and secure their existing complex & fancy third-party servers running demanding and/or critical web, mobile, cloud or mail services with thousands of daily users, we deliver & manage non-standard and highly customized servers on open source SSL platforms unheard of in today’s hyped digital marketplace. Click here if you need custom services to setup and manage your mail or data services either inside your premises or inside our managed data centers.
Here are free guides for customers who are using our Linux / Unix VPS or Dedicated Servers (http://wiki.osspl.com) and want to setup an independent email server on 100% DIY basis. Set up a free, full-featured mail server on CentOS 6, all mail service related components are free and open source, and you have control over your own data. The installation process is easy and smooth.
By following this tutorial, you will have below major software and services ready for production use: Postfix: SMTP service
Dovecot: POP3/POP3S, IMAP/IMAPS, Managesieve service
PostgreSQL or MySQL: Storing mail accounts and application data
Apache: Web server
Amavisd, SpamAssassin, ClamAV: Anti-spam, anti-virus
Fail2ban: scans log files (e.g. /var/log/maillog) and bans IPs that show the malicious signs — too many password failures, seeking for exploits, etc.
PrimeAdmin: A basic, free & open source administration panel to manage the mail accounts. Full featured edition is available for purchase here: PrimeMail./admin_panel.html.
Awstats: Apache and Postfix log analyzer
phpPgAdmin: web-based administration tool for PostgreSQL
What is PrimeMail? A full fledged, full-featured mail server solution. All components are free and open source software. An open source project, released under GPLv2, hosted on BitBucket. Website: Indiahosting.org With PrimeMail, you can set up a full-featured, mail server quickly.
PrimeMail works on 8 major Linux/BSD distributions: Red Hat Enterprise Linux 5.x, 6.x, 7.x
CentOS 5.x, 6.x, 7.x
Scientific Linux 5.x, 6.x
Debian 6.x, 7.x, 8.x, 9.x, 10.x
Ubuntu 14, 15, 16
Linux Mint (based on Ubuntu)
FreeBSD 9.x, 11.x, 12.x, 13.x System Requirements
PrimeMail is designed to be deployed on a FRESH server system, which means your server does NOT have mail related components installed, e.g. Apache, PostgreSQL, OpenLDAP, Postfix, Dovecot, Amavisd, etc. 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 PrimeMail, you need: A FRESH, minimal working CentOS Linux 8. The latest release is recommended.
At least 512MB of memory is required for production use. Preparations
Set A Fully Qualified Domain Name (FQDN) Hostname On Your Server
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: /etc/sysconfig/network 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.PrimeMail.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. 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 PrimeMail
Visit Download page to get the latest release of PrimeMail. At least PrimeMail-0.8.0-beta4 is required. Upload PrimeMail to your mail server via ftp or scp or whatever method you can use, login to the server to install PrimeMail. We assume you uploaded it to directory /root/PrimeMail-x.y.z.tar.bz2 (replace x.y.z by the actual version number). Uncompress PrimeMail tarball:
# cd /root/
# tar xjf PrimeMail-x.y.z.tar.bz2 Start PrimeMail Installer
It’s now ready to start PrimeMail installer, it will ask you some simple questions, that are all steps to set up a full-featured mail server. # cd /root/PrimeMail-x.y.z/
# bash PrimeMail.sh
1) Specify location to store all mailboxes. Default is /var/vmail/
2) 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 PrimeAdmin, our web-based PrimeMail admin panel.
3) Set password of PostgreSQL admin user. PostgreSQL is used to store mail accounts and application data. e.g. Roundcube webmail, Amavisd-new.
4) Add your first mail domain name:
5) 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 PrimeAdmin (web-based PrimeMail 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 PrimeAdmin after installation has completed. 6) 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 PrimeAdmin after installation has completed. 7) Choose optional components: After these questions, PrimeMail 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.
Important Things You Should Know After Installation
- Read file /root/PrimeMail-x.y.z/PrimeMail.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
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://vps3.osspl.com/mail/ (or /webmail, /roundcube. HTTPS is available also.)
- Admin panel: httpS://your_server/PrimeAdmin/
- phpMyAdmin: httpS://your_server/phpmyadmin/
- Awstats: httpS://your_server/awstats/awstats.pl?config=web (or ?config=smtp)