Pages

Search This Blog

Total Pageviews

Wednesday, April 13, 2011

LINUX + NETQMAIL 1.6 + Patches + MYSQL + VPOPMAIL + VQADMIN + QMAILADMIN + COURIER-IMAP + SQUIRRELMAIL, SIMSCAN + CLAM ANTIVIRUS + SPAMASSASSIN + SASQL Plugin


I wrote this Qmail blog for couple of reasons, First (according to my needs) existing guides does not provide a complete solution, my qmail learning is tough and my first complete qmail installation is such a pain. Great resources in internet for qmail contributions make my life lot easier. I have installed my qmail system with the following features. The below procedure works better for my environment and has no guarantee.


Index

  1. Sources needed and there link to download
  2. Prepare patch and Install Qmail
  3. Installing Ucspi-tcp and Daemon tools
  4. Starting Qmail:
  5. Removing sendmail:
  6. Establishing an "artificial" Sendmail path
  7. Ezmlm Mailing list Installation
  8. Autoresponder from inter7
  9. Vpopmail Installation
  10. Vqadmin Installation
  11. Maildrop
  12. Qmailadmin
  13. Installing Courier-imap/imaps with Courierpassd
  14. Installing Webmail:
  15. SPAM AND VIRUS CHECKING
  16. Simscan Prerequisites
  17. SASQL and Mysql configuration

Step by Step Procedure

Stuff’s we will be needing (Sources)



1. NetQmail v1.06 from http://www.qmail.org

2. Bill Shupp TLS + SMTP Auth Patch from http://www.qmail.org/netqmail/

3. Qmail Patches and explanations from http://www.memoryhole.net/qmail/

4. Ucspi-TCP v0.88 from http://cr.yp.to

5. Daemontools v0.76 from http://cr.yp.to

6. ezmlm-idx-7.0.2.tar.gz from http://www.ezmlm.org

7. autorespond-2.0.5.tar.gz from http://www.inter7.com

8. vpopmail-5.4.28.tar.gz from http://www.inter7.com

9. vqadmin-2.3.5.tar.gz from http://www.inter7.com

10. maildrop-2.2.0.tar.bz2 from http://www.courier-mta.org

11. pcre-7.6 from http://www.pcre.org/

12. qmailadmin-1.2.13.tar.gz from http://www.inter7.com

13. courier-authlib-0.55.tar.bz2 from http://www.courier-mta.org/authlib/

14. courier-imap-4.0.2.tar.bz2 from http://www.courier-mta.org/imap/

15. courierpassd-1.1.0-RC1.tar.gz fromhttp://www.arda.homeunix.net/store/

16. razor-agents-2.84.tar.bz2 from http://razor.sourceforge.net

17. Mail-SpamAssassin-3.2.5.tar.gz from http://www.spamassassin.org

18. clamav-0.95.2.tar.gz from http://www.clamav.net

19. ripmime-1.4.0.9.tar.gz from http://www.pldaniels.com/ripmime/

20. simscan-1.4.0.tar.gz from http://www.inter7.com



I'm assuming that Apache web server and PHP and Mysql are installed, configured and fully operational on the machine you are installing qmail on.



Prepare, Patch and Install and Qmail


Now we are going to install Qmail from downloaded sources. We'll apply some necessary patches to Qmail, to make sure that the solution we are going to implement works perfectly.

First, we untar qmail and change directory to qmail sources. Then, we apply the needed patches to Qmail.



# cd /usr/src/qmail

# tar zxvf /downloads/netqmail-1.06.tar.gz

# mkdir /downloads/patches

# cd /downloads/patches

# wget http://www.memoryhole.net/qmail/patch-qmail-1.03-rfc2821.diff

# wget http://www.memoryhole.net/qmail/smtpd-502-to-500.patch

# wget http://www.memoryhole.net/qmail/any-to-cname.patch

# wget http://www.memoryhole.net/qmail/qmail-103.patch

# wget http://www.memoryhole.net/qmail/qmail-smtpd-relay-reject

# wget http://www.memoryhole.net/qmail/rfc1870.diff

# wget http://www.memoryhole.net/qmail/netqmail-1.05-tls-20060104.patch

# wget http://inoa.net/qmail-tls/netqmail-1.05-tls-20070408.patch

# wget http://inoa.net/qmail-tls/qmail-tls-check_certs

# wget http://www.memoryhole.net/qmail/qmail-smtpd-viruscan-1.3.patch

# wget http://www.memoryhole.net/qmail/qmail-smtpd-rcptcheck.patch

# wget http://www.memoryhole.net/qmail/greylist.sh

# wget http://www.memoryhole.net/qmail/qmail-1.03-maildir-uniq.patch

# wget http://www.memoryhole.net/qmail/qmail-remote.sh



# mkdir –p /var/qmail

# mkdir /usr/src/qmail


 

Create Qmail Users and Groups

The easiest way to create the  necessary users and groups is to create a little script file
to do it for you. In the source directory you'll find a file called INSTALL.ids.It contains 
the command lines for many platforms,so  copying the file to another name and editing that 
is quick and easy.


#   cd  /usr/local/src/netqmail-1.06


#    cp INSTALL.ids IDS

 
Then, using your favorite editor, remove the entire file except the lines you want. For example, here's what IDS would look like for FreeBSD after editing:

# groupadd nofiles

# useradd qmaild -g nofiles -d /var/qmail -s /nonexistent

# useradd alias -g nofiles -d /var/qmail/alias -s /nonexistent

# useradd qmaill -g nofiles -d /var/qmail -s /nonexistent

# useradd qmailp -g nofiles -d /var/qmail -s /nonexistent

# groupadd qmail

# useradd qmailq -g qmail -d /var/qmail -s /nonexistent

# useradd qmailr -g qmail -d /var/qmail -s /nonexistent

# useradd qmails -g qmail -d /var/qmail -s /nonexistent


# chmod 700 IDS

# ./IDS

When the script finishes, all of your users and groups will be created and you can go on to the next section.

 
Vpopmail User creation


# groupadd vchkpw

# useradd -g vchkpw -d /home/vpopmail -s /sbin/nologin -p'*' vpopmail



Patch and Install Qmail

# tar zxvf /downloads/ucspi-tcp-0.88.tar.gz

# mkdir –p /package

# chmod 1755 /package

# cd /package

# tar zxvf /downloads/daemontools-0.76.tar.gz

# mkdir /var/log/qmail

# cd /var/log/qmail/

# mkdir qmail-send qmail-smtpd qmail-pop3d

# chown -R qmaill:root /var/log/qmail

# chmod -R 750 /var/log/qmail

# mkdir /var/qmail/supervise

# cd /var/qmail/supervise/

# mkdir -p qmail-smtpd/log qmail-send/log qmail-pop3d/log

# chmod +t qmail-smtpd qmail-send qmail-pop3d

# cd /usr/src/qmail/netqmail-1.06

# patch -p0 < /downloads/patches/netqmail-1.05-tls-smtpauth-20070417.patch

# patch -p1 < /downloads/patches/patch-qmail-1.03-rfc2821.diff

# patch -p1 < /downloads/patches/smtpd-502-to-500.patch

# patch -p1 < /downloads/patches/any-to-cname.patch

# patch -p1 < /downloads/patches/qmail-103.patch

# patch -p1 < /downloads/patches/qmail-smtpd-relay-reject

# patch -p1 < /downloads/patches/rfc1870.diff

# patch < /downloads/patches/qmail-smtpd-viruscan-1.3.patch

# patch -p1 < /downloads/patches/qmail-1.03-maildir-uniq.patch

# patch -p1 < /downloads/patches/qmail-smtpd-rcptcheck.patch

# patch -p1 < /downloads/patches/logging-3.patch

# echo 211 > /usr/src/qmail/netqmail-1.06/conf-split

# echo 255 > /usr/src/qmail/qmail-1.03/conf-spawn

# echo 255 > /usr/src/qmail/netqmail-1.06/conf-spawn

# make setup check

# make man && make setup check

# ./config-fast FQDN

# make cert

# chown -R vpopmail:qmail /var/qmail/control/clientcert.pem /var/qmail/control/servercert.pem


# cat <<EOF >/var/qmail/control/signatures

Copy and paste the below the contents

/* Copy contents start here

# Windows executables seen in active virii

TVqQAAMAA

TVpQAAIAA

# Additional windows executable signatures not yet seen in virii

TVpAALQAc

TVpyAXkAX

TVrmAU4AA

TVrhARwAk

TVoFAQUAA

TVoAAAQAA

TVoIARMAA

TVouARsAA

TVrQAT8AA

# .ZIPfile signature seen in SoBig.E and mydoom:

UEsDBBQAA

UEsDBAoAAA

# .GIF file found in a previous Microsoft virus making the rounds.

R0lGODlhaAA7APcAAP///+rp6puSp6GZrDUjUUc6Zn53mFJMdbGvvVtXh2xre8bF1x8cU4yLprOy

CTRL + D


Content Ends Here */

These patches all work on netqmail, which you should be using anyway. netqmail is a convenient packaging of some of the patches that have cropped up as being very important. It is not officially the same thing as qmail, but is a convenience packaging of qmail. For more information, go here.

One final note, some of these patches conflict (or seems to) with other patches, and resolving them would not be difficult. Check for .rej files extension on the original files name and correct the errors on the original files.

Installing Ucspi-tcp and Daemon tools

# cd /path/to/ucspi-tcp-0.88

# patch < /usr/src/qmail/netqmail-1.06/other-patches/ucspi-tcp-0.88.errno.patch

# patch < /usr/src/qmail/netqmail-1.06/other-patches/ucspi-tcp-0.88.a_record.patch

# patch < /usr/src/qmail/netqmail-1.06/other-patches/ucspi-tcp-0.88.nodefaultrbl.patch

# make

# make setup check

Daemontools:

# cd /package/admin/daemontools-0.76/src

# patch < /usr/src/qmail/netqmail-1.06/other-patches/daemontools-0.76.errno.patch

# cd ..

# package/install



If no errors are reported, you've successfully compiled the daemontools package!

If you run take a look at the running processes on your server at this point, you should see the daemon "svscanboot" running. You can usually do this with a "ps -aux" command.

No comments:

Post a Comment