Connect with us

Hi, what are you looking for?


How to configure Linux Mail Server Qmail on CentOS 6

How to Install QMAIL Mail Server Configuration on CentOS/RHEL 6/5 step by step with details:

QMAIL Mail Server

  • Qmail is Founded in June of 2003.
  • Qmail put together to provide a free and open resource for anyone needing help with the installation and configuration.
  • Qmail is an incredibly fast, stable and secure mail solution suitable for almost any environment.
  • continues to grow and improve because of the generous contributions from devoted qmail fans across the world.
  • It is used by yahoo as there mail servers

QMAIL Mail Server Quick Snapshots

A successful qmailrocks qmail installation will leave you with the following :
  • Qmail itself ? qmail, ucspi?tcp, daemontools w/enhanced logging.
  • John Simpson’s massive qmail patch, which includes (among others) qmailqueue, smtp?auth and TLS smtp encryption.
  • EZmlm ? A fast and easy to use mailing list manager that works through qmail.
  • Autoresponder ? Enables auto?responder capabilities on your qmail server.
  • Vpopmail ? Enables virtual e?mail hosting for multiple domains. Available with or without mysql integration.
  • Vqadmin ? A web based interface to manage Vpopmail virtual domains on your qmail server.
  • Maildrop ? A server?wide mail filtering tool.
  • Qmailadmin ? A web based interface for managing vpopmail virtual e?mail accounts.
  • Courier?imap/imap?ssl ? The popular IMAP/IMAP?SSL server.
  • Squirrelmail ? A web based mail client with a boat load of cool plugins available
What software packages should I already have installed on my server
  • Php
  • Perl
  • Gcc
  • Mysql
  • Openssl
  • Wget
  • Patch & patchutils
What software packages should NOT be installed?
  • Postfix
  • Any pop services

Install QMAIL Mail Server Configuration on CentOS/RHEL/ Scientific /Oracle Linux 6/5

Step-I(Download the Software and extract qmail pkgs)
# wget
# mkdir /downloads
# cd /downloads
# tar zxvf qmailrocks.tar.gz
Step-II(Installing Qmail Itself)
# /downloads/qmailrocks/scripts/install/qmr_install_linux-s1.script
# /downloads/qmailrocks/scripts/util/qmail_big_patches.script
Now we build Qmail…
# cd /usr/src/qmail/qmail-1.03
# make man && make setup check
# ./config-fast your_fqdn_hostname (ex: ./config-fast
[root@dns ~]# make cert
Country Name (2 letter code) [GB]:IN
State or Province Name (full name) [Berkshire]: MH
Locality Name (eg, city) [Newbury]: India
Organization Name (eg, company) [My Company Ltd]: MCH
Organizational Unit Name (eg, section) []: Computer Cell
Common Name (eg, your name or your server's hostname)
Email Address []
# cd /downloads/qmailrocks/
# tar zxvf ezmlm-0.53-idx-0.41.tar.gz
# cd ezmlm-0.53-idx-0.41
# make && make setup
# cd /downloads/qmailrocks
# tar zxvf autorespond-2.0.5.tar.gz
# cd autorespond-2.0.5
# make && make install
# cd /downloads/qmailrocks
# tar zxvf vpopmail-5.4.5.tar.gz
# cd vpopmail-5.4.5
# ./configure --enable-logging=p
# make && make install-strip
# cd /downloads/qmailrocks
# tar zxvf vqadmin-2.3.6.tar.gz
# cd vqadmin-2.3.6
# ./configure --enable-cgibindir=/var/www/cgi-bin --enablehtmldir=/var/www/html/
# make && make install-strip
Now you will need to add the following to your server’s Apache configuration file (usually httpd.conf)
<Directory "/var/www/cgi-bin/vqadmin">
deny from all
Options ExecCGI
AllowOverride AuthConfig
Order deny,allow
In addition, within the Apache master config file you will want to set the “AllowOveride” option to “All”.Example: AllowOveride All
# cd /var/www/cgi-bin/vqadmin
# vi .htaccess
AuthType Basic
AuthUserFile /usr/local/apache/conf/vqadmin.passwd
AuthName vQadmin
require valid-user
satisfy any
# chown apache .htaccess
# htpasswd -bc /usr/local/apache/conf/vqadmin.passwd admin admin
# chmod 644 /usr/local/apache/conf/vqadmin.passwd
# apachectl stop
# apachectl start
# cd /downloads/qmailrocks
# tar zxvf maildrop-1.6.3.tar.gz
# cd maildrop-1.6.3
# ./configure --prefix=/usr/local --exec-prefix=/usr/local --enablemaildrop-uid=root --enable-maildrop-gid=vchkpw --enablemaildirquota
# make && make install-strip && make install-man
# cd /downloads/qmailrocks
# tar zxvf qmailadmin-1.2.1.tar.gz
# cd qmailadmin-1.2.1
# ./configure --enable-cgibindir=/var/www/cgi-bin --enablehtmldir=/var/www/html/
# make && make install-strip
Step-IX(Finalizing Qmail)
# /downloads/qmailrocks/scripts/finalize/linux/finalize_linux.script
Find “” and change it to your server’s hostname. For example:
# vi /var/qmail/supervise/qmail-pop3d/run
# vi /var/qmail/supervise/qmail-smtpd/run
Next, we’ll kill any running qmail processes so that we can implement some final configurations.
# qmailctl stop
Setup Selective relaying Localhost
# echo '127.:allow,RELAYCLIENT=""' >> /etc/tcp.smtp
# qmailctl cdb
# echo > /var/qmail/alias/.qmail-root
# echo> /var/qmail/alias/.qmail-postmaster
# echo> /var/qmail/alias/.qmail-mailerdaemon
# ln -s /var/qmail/alias/.qmail-root /var/qmail/alias/.qmailanonymous
# chmod 644 /var/qmail/alias/.qmail*
Removing Sendmail
# service sendmail restart
# rpm -qa | grep sendmail
# rpm -e --nodeps sendmail-x.x.x.x
# rpm -e --nodeps sendmail-doc-x.x.x.x
# rpm -e --nodeps sendmail-devel-x.x.x.x
# rpm -e --nodeps sendmail-cf-x.x.x.x
# /etc/rc.d/init.d/sendmail stop (to stop Sendmail)
# mv /usr/lib/sendmail /usr/lib/sendmail.old
# mv /usr/sbin/sendmail /usr/sbin/sendmail.old
# chmod 0 /usr/lib/sendmail.old /usr/sbin/sendmail.old
Removing Postfix
# rpm -qa | grep postfix
# postfix-x.x-x
# /etc/rc.d/init.d/postfix stop
# rpm -e nodeps postfix-x.x-x
# ln -s /var/qmail/bin/sendmail /usr/lib/sendmail
# ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail
Step-X(Starting qmail)
# /downloads/qmailrocks/scripts/util/qmr_inst_check
# qmailctl stop
# qmailctl start
# qmailctl stat
# telnet localhost 110
Connected to
Escape character is '^]'.
+OK <>
user (enter your username here remember to use the full e-mail address)
pass galaxy
Connection closed by foreign host.
Step-XI(Installing Courier-imap/imaps with Courierpassd)
# cd /downloads/qmailrocks
# tar jxvf courier-authlib-0.55.tar.bz2
# cd courier-authlib-0.55
# ./configure --prefix=/usr/local --exec-prefix=/usr/local --withauthvchkpw--without-authldap --without-authmysql --disable-rootcheck--with-ssl --with-authchangepwdir=/usr/local/libexec/authlib --with-redhat
# make && make check
# make install-strip && make install-configure
# vi /etc/rc.local
Add the following line:
# /usr/local/sbin/authdaemond start
Now let’s install courier-imap/imaps…
# cd /downloads/qmailrocks/
# tar jxvf courier-imap-4.0.2.tar.bz2
# chown -R bsmith:wheel courier-imap-4.0.2
# cd /downloads/qmailrocks/courier-imap-4.0.2
# subsmith
# ./configure --prefix=/usr/local --exec-prefix=/usr/local --withauthvchkpw--without-authldap --without-authmysql --disable-rootcheck--with-ssl --with-authchangepwdir=/usr/local/libexec/authlib --with-redhat
# make && make check
Now we will exit out of our NON-ROOT USER and go back to being root…
# Exit
# make install-strip && make install-configure
# /usr/local/sbin/mkimapdcert
# vi /usr/local/etc/imapd.cnf
# vi /usr/local/etc/imapd
# vi /usr/local/etc/imapd-ssl
# vi /usr/local/etc/authlib/authdaemonrc authmodulelist="authvchkpw“
# cp /usr/local/libexec/imapd.rc /etc/rc.d/init.d/imap
# cp /usr/local/libexec/imapd-ssl.rc /etc/rc.d/init.d/imaps
Now let’s start up Authdaemond, IMAP and IMAPS. To be safe we’ll stop each service before starting it…
# /usr/local/sbin/authdaemond stop
# /usr/local/sbin/authdaemond start
# /etc/rc.d/init.d/imap stop
# /etc/rc.d/init.d/imaps stop
# /etc/rc.d/init.d/imap start
# /etc/rc.d/init.d/imaps start
# telnet localhost 143
Connected to
Escape character is '^]'.
a login techbrown
a OK LOGIN Ok. (successful login!)
a logout (logs you out)
* BYE Courier-IMAP server shutting down
a OK LOGOUT completed
Connection closed by foreign host.
Note: Courierpassd will require that port 106 be open to at least local traffic (traffic from
# cd /downloads/qmailrocks
# tar zxvf courierpassd-1.1.0-RC1.tar.gz
# cd courierpassd-1.1.0-RC1
# ./configure
# make && make install
# cd /etc/xinetd.d
Here we create the xinetd script for courierpassd.
# vi courierpassd
service courierpassd
 port = 106
 socket_type = stream
 protocol = tcp
 user = root
 server = /usr/local/sbin/courierpassd
 server_args = -s imap
 wait = no
 only_from =
 instances = 4
 disable = no
# vi /etc/services
# /etc/rc.d/init.d/xinetd restart
Connected to localhost.
Escape character is '^]'.
200 courierpassd v0.30 hello, who are you?
200 Your password please.
pass galaxy
200 Your new password please.
newpass galaxy
200 Password changed, thank-you.
200 Bye.
Connection closed by foreign host.
# telnet localhost 106
Step-XII(Installing Squirrelmail)
# cd /downloads/qmailrocks
# tar xvzf squirrelmail-1.4.8.tar.gz
Now rename the untarred folder to something more friendly…
# mv squirrelmail-1.4.8 webmail
And now let’s configure Squirrelmail…
# mkdir /var/sqattachements
# chown -R apache:apache /var/sqattachements
# cdwebmail
# chown -R apache:apache data
# cd config
# ./
For General Settings
1. Domain : (Enter the IP of your server here. Don't be an idiot and actually use
2. Invert Time : false
3. Sendmail or SMTP : SMTP
For IMAP Settings
4. IMAP Server : localhost
5. IMAP Port : 143
6. Authentication type : login
7. Secure IMAP (TLS) : false
8. Server software : other
9. Delimiter : detect
For SMTP Settings
4. SMTP Server : localhost
5. SMTP Port : 25
6. POP before SMTP : false
7. SMTP Authentication : login
8. Secure SMTP (TLS) : false
I edit the httpd.conf Apache configuration file and add the following block:
ServerAlias mail.*
DocumentRoot /var/www/webmail
We’ll sign in with the postmaster account under the domain you should have created earlier using Vqadmin…
Password: techbrown
/etc/rc.d/init.d/imap start
/etc/rc.d/init.d/imaps start
# qmailctl restart
# qmailstat

Congratulation You have Installed QMAIL Mail Server Configuration on CentOS/RHEL 6/5


You May Also Like


How to auto upgrade JioFi firmware for JioFi 2 / JioFi 3 / JioFi 4 / JioFi 5 / JioFi 6 and other JioFi...


Internet is the most important public network for connecting to the WEB. For internet connection requirement the ISP is required as well as it...


How to download and install the Mobile Intel 4 Series Express Chipset Graphics Drivers for Windows 10.  Windows 10 is the one of the...


How to Install and Configure PCSX2 on Windows 10. The Windows 10 is the most recommended operating system for the Games. In stream platform...