Setting Mail Server with Qmail on Fedora 3 part3
11. Installing 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
# ./configure --enable-cgibindir=/var/www/cgi-bin --enable-htmldir=/var/www/html
# make && make install-strip
Vqadmin should install itself in the cgi-bin directory of your default website.
Now you will need to add the following to your server's Apache configuration file (httpd.conf)
# vi /etc/httpd/conf/httpd.conf
deny from all
Options ExecCGI
AllowOverride AuthConfig
Order deny,allow
Within the Apache master config file you have to set the "AllowOveride" option to "All".
Example: AllowOverride All
# cd /var/www/cgi-bin/vqadmin
Now you will want to create a .htaccess file to password protect the Vqadmin interface.
# vi .htaccess
AuthType Basic
AuthUserFile /var/www/cgi-bin/.htpasswd
AuthName vQadmin
require valid-user
satisfy any
# chown apache .htaccess
# chmod 644 .htaccess
Now you need to create a corresponding .htpasswd file that's going to contain the username and encrypted password for the Vqadmin administrator...
htpasswd -bc /var/www/cgi-bin/.htpasswd admin admin_password
# chmod 644 /var/www/cgi-bin/.htpasswd
Now restart Apache...
# apachectl stop
# apachectl start
If all has gone well, you should now be able to browse (in your web browser) to:
http://www.smiert.org/cgi-bin/vqadmin/vqadmin.cgi
Enter the user "admin" and whatever password your assigned it.
You should now see the Vqadmin interface. Go ahead and add a new domain to your server!
The "postmaster" user serves as the admin user for any new domain and we will use it to log into Qmailadmin.
The nice thing about Vpopmail and Vqadmin is that you do not need to restart anything after you add a domain.
12. Installing 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
13. Installing Qmailadmin
Qmailadmin provide us with a nice web based interface for administering mail accounts once they are setup through Vpopmail (or Vqadmin).
From Qmailadmin we can create mailboxes, aliases, fowards, mail robots, mailing lists.
# cd /downloads/qmailrocks
# tar zxvf qmailadmin-1.2.9.tar.gz
# cd qmailadmin-1.2.9
# ./configure --enable-cgibindir=/var/www/cgi-bin --enable-htmldir=/var/www/html
# make && make install-strip
Now browse to http://www.smiert.org/cgi-bin/qmailadmin and you should see the login screen.
Login with the postmaster account and password for the domain that you created a while back using Vqadmin.
Go ahead and create some additional mailboxes for your domain(s).
14. Finalizing qmail installation
Create the qmail supervise scripts, create the the qmail rc and qmailctl scripts and then set the needed permissions on all these scripts.
# /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.smiert.org
# vi /var/qmail/supervise/qmail-smtpd/run
Find "mail.example.com" and change it to your server's hostname. For example: mail.smiert.org
# qmailctl stop
We setup selective relaying for localhost...
# echo '127.:allow,RELAYCLIENT=""' >> /etc/tcp.smtp
# qmailctl cdb
Now we create the common system aliases.
These aliases are going to tell Qmail what to do with common server-generated mails. Stuff like bouncebacks, cron daily output and various other systemic sources.
# echo postmaster@smiert.org > /var/qmail/alias/.qmail-root
# echo postmaster@smiert.org > /var/qmail/alias/.qmail-postmaster
# echo postmaster@smiert.org > /var/qmail/alias/.qmail-mailer-daemon
# ln -s /var/qmail/alias/.qmail-root /var/qmail/alias/.qmail-anonymous
# chmod 644 /var/qmail/alias/.qmail*
15. Uninstalling other Mail Transport Agent like Sendmail, Postfix, and Exim
# rpm -qa | grep sendmail
# /etc/init.d/sendmail stop
# rpm -e --nodeps sendmail
# rpm -e --nodeps sendmail-doc
# rpm -e --nodeps sendmail-devel
# rpm -e --nodeps sendmail-cf
# rpm -qa | grep postfix
# rpm -e --nodeps postfix
# rpm -qa | grep exim
# rpm -e --nodeps exim
Now we will need to set up an "artificial" Sendmail, which is just a symbolic link to Qmail's Sendmail.
This is needed to ensure that the myriad of systemic mail scripts are still able to send mail!
Qmail's "Sendmail" is nothing more than a direct injection into Qmail itself...
# ln -s /var/qmail/bin/sendmail /usr/lib/sendmail
# ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail