Qmail

What is Qmail
Installing and configuring Qmail using Qmailtoaster package

http://qmail-support.blogspot.com/

What is Qmail?

Qmail is an incredibly fast, stable and secure mail solution suitable for almost any environment. It's a drop-in replacement for the Sendmail system provided with UNIX operating systems. qmail uses the Simple Mail Transfer Protocol (SMTP) to exchange messages with MTA's on other systems.

There are many websites which are giving information for installing and configuring qmail.

  1. http://www.lifewithqmail.org
  2. http://qmailrocks.org
  3. http://www.qmailtoaster.com

I have successfully configred and installed qmail from the Source RPMS provided by http://www.qmailtoaster.com. The installation is pretty easy and straight forward. Qmail Toaster package has the following features.

  • Source RPM packages ready for all RPM based distributions
  • Integrated SpamAssassin, ClamAV and Simscan
  • Warlock virus and worm loader realtime scanning
  • CHKUSER 2.0 functions for qmail-smtpd
  • Qmail-Tap provides email archive capability
  • Virtual Domains (MySQL), Virtual Users (MySQL)
  • Autoresponder, Mailing List
  • Web-based email system, Web-based administration tools
  • SMTP roaming via SMTP-AUTH, POP3-AUTH, & IMAP-AUTH
  • POP3, POP3-SSL, IMAP and IMAP-SSL

Installing and configuring qmail using Qmail toaster package

The following procedure is for installing qmail toaster package on a fedora core 4 systems

More Information about installing qmail toaster package on other platforms can be found from http://www.qmailtoaster.com.

Pre-installtion tasks

01. Remove sendmail, evolution & Spamassassin if already installed

    yum -y remove sendmail evolution spamassassin

02. Install the Pre-requisites

   yum -y install autoconf automake automake17 bzip2 bzip2-devel compat-gcc-32 \
   compat-gcc-32-c++ curl curl-devel expect expect-devel gcc gcc-c++ gcc-java \
   gdbm gdbm-devel gmp gmp-devel httpd httpd-devel httpd-manual krb5-auth-dialog \
   krb5-devel krb5-libs krb5-workstation libgcc libidn libidn-devel mysql mysql-bench \
   mysql-devel mysql-server mrtg ntp openssl openssl-devel pcre perl-Digest-HMAC \
   perl-Digest-SHA1 perl-Net-DNS perl-Time-HiRes php php-ldap php-mysql php-pear \
   redhat-rpm-config rpm-build rpm-devel rpm-libs rpm-python sed setup setuptool \
   spamassassin stunnel system-config-date which 

03. Download the qmail toaster source RPMS

The source RPMS can be downloaded from http://www.qmailtoaster.com

You can directly download the above bz2 file using wget command.

 $ wget http://sys-admin.net/downloads/qmail/qmailtoaster.tar.bz2

If you download the above bz2 file, untar and unzip to your download directory using the following command.

 $ tar jxvf qmailtoaster.tar.bz2

04. setup the mysql administrative account if not setup yet

   chkconfig --level 2345 mysqld on
   service mysqld start
   /usr/bin/mysqladmin -u root password 'new-password'
   /usr/bin/mysqladmin -u root -h 'your sytem name' password 'new-password'

05. Make sure your hostname and DNS are setup properly

   host mail.yourdomain.com
   host -t mx yourdomain.com
   host -t a mail.yourdomain.com

Installing Qmail toaster package

Build and install zlib

   rpmbuild --rebuild zlib-1.2.3-1.0.2.src.rpm
   rpm -Uvh --replacefiles --replacepkgs /usr/src/redhat/RPMS/i386/zlib*.rpm

Build and install daemontools

   rpmbuild --rebuild --with fdr40 daemontools*.src.rpm
   rpm -Uvh /usr/src/redhat/RPMS/i386/daemontools*.rpm

Build and install ucspi-tcp-toaster

   rpmbuild --rebuild --with fdr40 ucspi-tcp-toaster-*.src.rpm
   rpm -Uvh /usr/src/redhat/RPMS/i386/ucspi-tcp-toaster*.rpm

Build and install vpopmail-toaster

   rpmbuild --rebuild --with fdr40 vpopmail-toaster*.src.rpm
   rpm -Uvh /usr/src/redhat/RPMS/i386/vpopmail-toaster*.rpm

(Note: rpmbuild process may fail if any user is using the UID 89. Because, during the vpopmail installation process, it creates a user called 'vpopmail' with UID 89.)

Additional tasks

  • Cerate mysql Database called vpopmail
        mysqladmin create vpopmail -u root -p
        mysqladmin -u root -p reload
        mysqladmin -u root -p refresh
  • Now create a mysql user called vpopmail
  • Replace the 'passwd' with password of your choice.
       echo "GRANT ALL PRIVILEGES ON vpopmail.* TO vpopmail@localhost \
       IDENTIFIED BY 'passwd'" | mysql -u root -p 
       mysqladmin -u root -p reload
       mysqladmin -u root -p refresh
  • /home/vpopmail/etc/vpopmail.mysql have the default password of SsEeCcRrEeTt
  • Replace this default password with the one you just created.
  • Test the new user we just created...
       mysql -u vpopmail -p

Additions to Qmail

Build/Install qmail-toaster

   rpmbuild --rebuild --with fdr40 qmail-toaster*.src.rpm
   rpm -Uvh /usr/src/redhat/RPMS/i386/qmail-toaster*.rpm
   rpm -Uvh /usr/src/redhat/RPMS/i386/qmail-pop3d*.rpm

Compile and install courier-imap-toaster

   rpmbuild --rebuild --with fdr40 courier-imap-toaster*.src.rpm
   rpm -Uvh /usr/src/redhat/RPMS/i386/courier-imap-toaster*.rpm

Compile and install autorespond-toaster

   rpmbuild --rebuild --with fdr40 autorespond-toaster*.src.rpm
   rpm -Uvh /usr/src/redhat/RPMS/i386/autorespond-toaster*.rpm

Compile and install control-panel-toaster.

(Note: these rpms are compiled in /usr/src/redhat/RPMS/noarch. 
  Also, Take note of the installation message)
   rpmbuild --rebuild --with fdr40 control-panel-toaster*.src.rpm
   rpm -Uvh /usr/src/redhat/RPMS/noarch/control-panel-toaster*.rpm

Note: The followin message is displayed while installing the above RPM

Take a look at your httpd.conf 

A new include directive was added:
/etc/httpd/conf/toaster.conf 

Configuration,
If you plan to use it in a VirtualDomain please delete the include 
directive from httpd.conf and  add it  in your VirtualDomain

If you plan to use it without VirtualDomain just leave it as is 
(but be sure about cgi and alias)

To make changes taking effect you need to reload httpd 

rpm -Uvh /usr/src/redhat/RPMS/noarch/send-emails-toaster*.rpm

Compile and install ezmlm-toaster.

   rpmbuild --rebuild --with fdr40 ezmlm-toaster-*.src.rpm
   rpm -Uvh /usr/src/redhat/RPMS/i386/ezmlm-toaster*.rpm

Compile and install maildrop-toaster

   rpmbuild --rebuild --with fdr40 maildrop-toaster*.src.rpm
   rpm -Uvh /usr/src/redhat/RPMS/i386/maildrop-toaster*.rpm

Compile and install qmailadmin-toaster.

   rpmbuild --rebuild --with fdr40  qmailadmin-toaster*.src.rpm
   rpm -Uvh /usr/src/redhat/RPMS/i386/qmailadmin-toaster*.rpm

Compile and install qmailmrtg-toaster

   rpmbuild --rebuild --with fdr40 qmailmrtg-toaster*.src.rpm
   rpm -Uvh /usr/src/redhat/RPMS/i386/qmailmrtg-toaster*.rpm

Compile and install isoqlog-toaster

   rpmbuild --rebuild --with fdr40 isoqlog-toaster*.src.rpm
   rpm -Uvh /usr/src/redhat/RPMS/i386/isoqlog-toaster*.rpm

Compile and install vqadmin-toaster

   rpmbuild --rebuild --with fdr40 vqadmin-toaster*.src.rpm
   rpm -Uvh /usr/src/redhat/RPMS/i386/vqadmin-toaster*.rpm

Compile and install Squiirelmail

   rpmbuild --rebuild --with fdr40 squirrelmail-toaster*.src.rpm
   rpm -Uvh /usr/src/redhat/RPMS/noarch/squirrelmail-toaster*.rpm

Note: The followin message is displayed while installing the above RPM

 /etc/httpd/conf/squirrelmail.conf

 Configuration:
   If you plan to use it in a VirtualDomain please delete
   the include directive from httpd.conf and  add it  in
   your VirtualDomain

Build and install spamassassin

   rpmbuild --rebuild --with fdr40 spamassassin-toaster*.src.rpm
   rpm -Uvh /usr/src/redhat/RPMS/i386/spamassassin-toaster*.rpm

Build and install clamav-toaster

   rpmbuild --rebuild --with fdr40 clamav-toaster*.src.rpm
   rpm -Uvh /usr/src/redhat/RPMS/i386/clamav-toaster*.rpm

Build and install simscan-toaster

   rpmbuild --rebuild --with fdr40 simscan-toaster*.src.rpm
   rpm -Uvh /usr/src/redhat/RPMS/i386/simscan-toaster*.rpm

Reboot your system

Congrats!!! Qmail installation is complete. It is time to reboot the system now. After rebooting the system, you can start configuring virtual domains and email accounts by visiting http://your_domain.com/admin-toaster/ link

The default admin user name is 'admin' and the default password for admin in 'toaster' It is highly recomented to change the default password immediately after logging into the qmail-toaster admin page.

The webmail can be accessed from http://yourdomain.com/webmail URL.

Post install Problems

  • If you are running your webserver on a High speed internet connection like Cable/DSL, your outgoing emails sometimes may not reach the destination. That is because, many mail servers rejects the incoming mails if it arrives from an IP address which can not be reverse lookedup. You can overcome this problem by setting the SMTP Routes in Qmail control files. Update the qmail control file with your ISP's SMTP server name. I have comcast High Speed internet and I have updated the qmail control file /var/qmail/control/smtproutes as follows.
     cat /var/qmail/control/smtproutes 
     :smtp.comcast.net
  • While creating virtual domains using vqadmin (vqadmin is accessed from http://yourdoamin.com/admin-toaster/), make sure to fill some numbers which are more than 0 in Accoutns, Forwards, Aliases, Maillinglists, and Autoresponders fields. If you accept the default 0 value, you can not use qmail admin to create new email accounts / forwards / aliases. qmailadmin can be directly accessed by http://yourdoamin.com/qmailadmin link.
  • vqadmin freaks out some times. It may not display the doamin details if you want to edit the domain properties in the later time. It is bacaus some wrong entries are placed in the mysql database sometims.
    • Using phpmyadmin, select the database vpopmail
    • Browse table dir_control
    • Verify the field cur_users for the doamin to which you have problem
    • change it it 0 and try again the vqadmin.

Migrate qmailserver

01. Copy the following directories from the old system to the new system

 /var/qmail/control
 /home/vpopmail/.spamassassin
 /home/vpopmail/domains
 /var/qmail/users/assign 

02. Backup the the vpopmail database from old system to the new system

03. Vqadmin may freak out if you try to access any information about the existing domains. Try adding one already exixing domain thru vqadmin. After that, everything will look normal.


cent0s5 install instruction
The setup is:

CentOS 5 -

1. Server is the only configuration choice checked. No gnome or kde, no
other packages selected.

2. Disable selinux manually

3. Update with yum & reboot

4. Run cnt50-deps.sh

5. Run cnt50-perl.sh

6. Edit cnt50-svcs.sh mysql root password, edit firewall.sh IP Address,
run cnt50-svcs.sh & reboot again

7. Run cnt50-install.sh

8. Run cnt50-djbdns-localcache-install.sh, or setup bind

Configuration is pretty standard from there.

~~~~~~~~~~~~~~~~~

The default is to sign outgoing messages with DKSIGN and to filter
incoming domainkeys with spamassassin. Servers that forward, or are
clustered, will just have to disable signing completely until we find a
fix.

This install instructions are very sketchy, but are just temporary.

Jeeva September 14, 2005, at 09:16 PM