You are on page 1of 5

Part 2-Installing Qmail itself

Pre-installation check list:


setenforce 0 [To stop Firewall]
iptables -F [To stop Firewall]
service iptables save
Ensure following package is installed
1) gcc
2) openssl
3) openssl-devel
4) db4-devel
5) expect
6) perl-suidperl
stop postfix,dovecot service
mkdir /downloads [For downloading qmail package]
cd /downloads
tar –xzvf ~/qmailrocks.tar.gz

# Following script create necessary user and groups as well as all the needed directories
#Permissions and ownership settings needed for the installation of qmail, ucspi-tcp and daemontools

/downloads/qmailrocks/scripts/install/qmr_install_linux-s1.script
#The following patch will build all sorts of cool functionality directly into qmail before install it.
/downloads/qmailrocks/scripts/util/qmail_big_patches.script
#For Build/install qmail
cd /usr/src/qmail/qmail-1.03
make man && make setup check
./config-fast hostname
make cert
chown -R vpopmail:qmail /var/qmail/control/clientcert.pem /var/qmail/control/servercert.pem
cd /usr/src/qmail/ucspi-tcp-0.88
patch < /downloads/qmailrocks/patches/ucspi-tcp-0.88.errno.patch
make && make setup check
cd /package/admin/daemontools-0.76
cd /package/admin/daemontools-0.76/src
patch < /downloads/qmailrocks/patches/daemontools-0.76.errno.patch
cd /package/admin/daemontools-0.76
package/install

Part 3 – Ezmlm

EZmlm is a nice mailing list add-on to Qmail.


cd /downloads/qmailrocks/
tar zxvf ezmlm-0.53-idx-0.41.tar.gz
cd ezmlm-0.53-idx-0.41
make && make setup
Part 4 – Autoresponder

It allows us to set up autoresponders for mailboxes and so forth.


cd /downloads/qmailrocks
tar zxvf autorespond-2.0.5.tar.gz
cd autorespond-2.0.5
make && make install
Part 5 – Vpopmail
Vpopmail is one of the major components of this installation. Vpopmail allows us to do virtual domain
mail hosting.
cd /downloads/qmailrocks
tar zxvf vpopmail-5.4.13.tar.gz
cd vpopmail-5.4.13
./configure --enable-logging=p
make && make install-strip

Part 6 - Vqadmin

Vqadmin is simply a nice web based interface that will let us manage Vpopmail. Through the interface we
can
create new domains, new users, net quotas, enable services and much more.

cd /downloads/qmailrocks
tar zxvf vqadmin-2.3.6.tar.gz
cd vqadmin-2.3.6
cp ../vpopmain/config.sub .
# ./configure --enable-cgibindir=/path/to/your/cgi-bin --enable-htmldir=/path/to/your/html/directory
./configure --enable-cgibindir=/var/www/cgi-bin --enable-htmldir=/var/www/html
make && make install-strip
vi /etc/httpd/conf/httpd.conf
<Directory "/var/www/cgi-bin/vqadmin">
deny from all
Options ExecCGI
AllowOverride AuthConfig
Order deny,allow
</Directory>

cd /var/www/cgi-bin/vqadmin

vi .htaccess
AuthType Basic
AuthUserFile /etc/htpasswd
AuthName vQadmin
require valid-user
satisfy any

chown apache .htaccess


chmod 644 .htaccess
htpasswd -c /etc/htpasswd admin
/etc/init.d/httpd start
http://www.yourdomain.com/cgi-bin/vqadmin/vqadmin.cgi

Part 7- Maildrop

Maildrop is a mail filtering agent which can be used to filter messages as they arrive on the server.

cd /downloads/qmailrocks
tar zxvf maildrop-1.6.3.tar.gz
cd maildrop-1.6.3
./configure --prefix=/usr/local --exec-prefix=/usr/local --enable-maildrop-uid=root
--enable-maildrop-gid=vchkpw --enable-maildirquota
make && make install-strip && make install-man

Part 8 – Qmailadmin

Qmailadmin is going to provide us with a nice web based interface for administering mail accounts. From
Qmailadmin we can create mailboxes, aliases, fowards, mailing lists.

cd /downloads/qmailrocks
tar zxvf qmailadmin-1.2.9.tar.gz
cd qmailadmin-1.2.9
#./configure --enable-cgibindir=/path/to/your/cgi-bin --enable-htmldir=/path/to/your/html/directory
./configure --enable-cgibindir=/var/www/cgi-bin --enable-htmldir=/var/www/html
make && make install-strip
# Follow the link to access Qmail Admin
http://www.yourdomain/cgi-bin/qmailadmin

Part 9 - Finalizing Qmail

/downloads/qmailrocks/scripts/finalize/linux/finalize_linux.script
vi /var/qmail/supervise/qmail-pop3d/run
Find "mail.example.com" and change it to your server's hostname. For example: mail.mydomain.com.
vi /var/qmail/supervise/qmail-smtpd/run
Find "mail.example.com" and change it to your server's hostname. For example: mail.mydomain.com
Change the soft limit of the file
exec /usr/local/bin/softlimit -m 90000000
echo '127.:allow,RELAYCLIENT=""' >> /etc/tcp.smtp
qmailctl cdb
# For start qmail
svscanboot &

Part 10 - Installing Courier-imap/imaps with Courierpassd

#Courier-imap is the preferred IMAP server to install.


#Courier IMAP works with Vpopmail and virtual domains.
#The Courier-authlib package to enable proper authentication through courier-imap.
cd /downloads/qmailrocks/
tar jxvf courier-authlib-0.55.tar.bz2
cd courier-authlib-0.55
./configure --prefix=/usr/local --exec-prefix=/usr/local --with-authvchkpw --without-authldap --without-
authmysql --disable-root-check --with-ssl --with-authchangepwdir=/usr/local/libexec/authlib --with-
redhat
make && make check
make install-strip && make install-configure
#Now we will add a startup command for authedaemond to the /etc/rc.local file to ensure startup on boot.
vi /etc/rc.local
/usr/local/sbin/authdaemond start
# See /var/log/maillog,if you get error then follow the following step
vi /etc/ld.so.conf
/usr/local/lib
ldconfig
cd /downloads/qmailrocks/
tar jxvf courier-imap-4.0.2.tar.bz2
adduser bsmith
chown -R bsmith:wheel courier-imap-4.0.2
cd /downloads/qmailrocks/courier-imap-4.0.2
su bsmith
./configure --prefix=/usr/local --exec-prefix=/usr/local --with-authvchkpw --without-authldap --without-
authmysql --disable-root-check --with-ssl --with-authchangepwdir=/usr/local/libexec/authlib --with-
redhat
make && make check
exit
make install-strip && make install-configure
/usr/local/sbin/mkimapdcert
vi /usr/local/etc/imapd.cnf
change postmaser@example.com an administrative email address

vi /usr/local/etc/imapd
IMAPDSTART=YES
vi /usr/local/etc/imapd-ssl
IMAPDSSLSTART=YES
TLS_CERTFILE=/usr/local/share/imapd.pem

vi /usr/local/etc/authlib/authdaemonrc
#Go to 27 line
#Comment this line and write the following line
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
/usr/local/sbin/authdaemond start
/etc/rc.d/init.d/imap start
/etc/rc.d/init.d/imaps start

#Courierpassd is going allow us to enable your mail users to change their own mail passwords via the
Squirrelmail interface.
yum install xinetd
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
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 = 127.0.0.1
instances = 4
disable = no
}

vi /etc/services
courierpassd 106/tcp #for /etc/xinetd.d/courierpassd
/etc/rc.d/init.d/xinetd restart

You might also like