Qmail-Based Complete webmail solution Installation Details

Source: Internet
Author: User
Tags qmail

Installation Platform: Linux, Solaris
Version: qmail-1.03
Installed machine: mail.mydomain.com

Software Package:
Qmail-1.03 Qmail Basic System
Ucspi-tcp-0.88 tcpsever ServiceProgram
Daemontools-0.70 monitoring tools
Checkpassword-0.81 POP3 USER verification program
Ezmlm-0.53 Email Forwarding
Vpopmail-4.9.6-1 virtual domain user POP3 support
Qmailadmin-0.35 virtual domain Web Management
Autorespond-1.0.0 auto-reply Program
Web mail sqwebmail-1.2.0
Vqsignup-0.4 web-based user registration
Software Source:
Http://www.qmail.org
Http://www.inter7.com/qmail
You must carefully read the install and FAQ before installing each package. You can solve many problems in the FAQ.

Installation steps:

1. # mkdir/var/Qmail

2. # groupadd nofiles
# Useradd-G nofiles-D/var/Qmail/alias
# Useradd-G nofiles-D/var/Qmail qmaild
# Useradd-G nofiles-D/var/Qmail qmaill
# Useradd-G nofiles-D/var/Qmail qmailp
# Groupadd Qmail
# Useradd-G Qmail-D/var/Qmail qmailq
# Useradd-G Qmail-D/var/Qmail qmailr
# Useradd-G Qmail-D/var/Qmail qmails

3. # tar xzvf qmail-1.03.tar.gz
Go to the Qmail directory, read the README and install files carefully, and then compile Qmail.
# Make setup check

4. # cd qmail-1.03
#./Config

5. Create a system alias
# (Cd ~ Alias; touch. Qmail-postmaster. Qmail-mailer-daemon. Qmail-root)
# Chmod 644 ~ Alias/. Qmail *

6. # cp/var/Qmail/boot/home/var/Qmail/RC
# Chmod 755/var/Qmail/RC

Edit/var/Qmail/RC
Modify./mailbox to./maildir as follows:

#! /Bin/sh
# Using splogger to send the log through Syslog.
# Using Qmail-Local to deliver messages ~ /Maildir by default.
Exec env-Path = "/var/Qmail/bin: $ path"
Qmail-start./maildir splogger Q

The splogger Qmail command is used to record recorded files in.
Create a template
$/Var/Qmail/bin/maildirmake/etc/skel/maildir
$ Echo./maildir/> ~ /. Qmail
Note that maildir must be owned by this user. You can change the value of chown and set the permission with chmod 700 maildir.

7. Install ucspi-tcp-0.88
# Tar zxvf ucspi-tcp-0.88.tar.gz
# Cd ucspi-tcp-0.88
# Make
# Make setup check
The execution file will be installed in/usr/local/bin.

8. Install checkpassword
# Tar zxvf checkpassword-0.81.tar.gz
# Cd checkpassword-0.81
# Make
# Make setup check
# Chmod og-Rx/bin/checkpassword
The checkpassword of the execution file will be installed in/bin.
If you do not open mail to users in/etc/passwd, you do not need to install checkpassword. You only need to install Vpopmail.

9. Install daemontools
# Tar zxvf daemontools-0.70.tar.gz
# Cd daemontools-0.70
# Make
# Make setup check
The execution file will be installed in/usr/local/bin.

After installing this tool, you can use
# Mkdir/var/run/Qmail
# Supervise/var/run/Qmail/var/Qmail/RC
To start Qmail, you can use SVC to disable live restart Qmail, and use svstat to monitor Qmail running status (Qmail FAQ)

10. Install Vpopmail
# Groupadd vchkpw
# Useradd-G vchkpw Vpopmail
# Mkdir ~ Vpopmail/etc
# Echo ": Allow"> ~ Vpopmail/etc/tcp. SMTP
# Tar zvfz vpopmail-4.9.6-1.tar.gz
# Cd vpopmail-4.9.6-1
#./Configure -- enable-roaming-users = y -- enable-default-domain = mydomain.com -- enable-passwd = N
# Make
# Make install-strip

# Crontab-e
40 ***/home/Vpopmail/bin/clearopensmtp 2> & 1>/dev/null

# Cd/home/Vpopmail/bin
#./Vadddomain mydomain.com mydomain
Append mydomain.com to/var/Qmail/control/rcpthosts

11. Stop the sendmail service.
# Killall-term Sendmail (Linux)
Then replace the original sendmail with the Sendmail libraby of Qmail.
# Mv/usr/lib/sendmail. Old
# Mv/usr/sbin/sendmail. Old
# Ln-S/var/Qmail/bin/sendmail/usr/lib/sendmail
# Ln-S/var/Qmail/sbin/sendmail/usr/sbin/sendmail
Remove the Sendmail Startup Program. Take Linux as an example:
Remove the Sendmail setting in inetd. conf and the Sendmail Startup File under/etc/rc. d/init. d. (Linux)

12. Start Qmail SMTP and POP3 daemon system services

Create SMTP forwarding rules
Set/etc/tcp. SMTP
: Allow
This is to accept the transfer letter from any client.
To reject the relay from some IP addresses, change to/etc/tcp. SMTP as follows:
1.2.3.4: Allow, relayclient = ""
127.: Allow, relayclient = ""
In this way, all addresses except 1.2.3.4 and 127. * will be rejected.

Next, convert TCP. SMTP to the CDB format.
#/Usr/local/bin/tcprules/etc/tcp. SMTP. CDB/etc/tcp. SMTP. tmp </etc/tcp. SMTP

Note: any changes to TCP. SMTP must be converted to CDB by tcprules.
In addition, if TCP. SMTP is blank, all transfers are rejected because the preset rule is deny.
Now, the forwarding rule has been set up and qmail-smtpd will be started according to this rule later.

Set the start of SMTP and POP3 daemon
Remove SMTP and POP3 settings in inetd. conf ()
Edit/etc/services with the following settings:

SMTP 25/tcp mail
# Pop-3 110/tcp # Pop Version 3
# Pop-3 110/udp
POP3. 110/tcp
POP3 110/udp

Start SMTP:
/Usr/local/bin/tcpserver-v-x/etc/tcp. SMTP. CDB
-U uid-g gid 0 SMTP/var/Qmail/bin/Qmail-smtpd 2> & 1
|/Var/Qmail/bin/splogger smtpd 3 &

UID and GID are the user ID of qmaild added to the Qmail SYSTEM account and the group ID of nofiles.
The/var/Qmail/bin/splogger line will write the log file in/var/log/maillog.

Start POP3:
Add the following settings to edit the Startup file:
Tcpserver-H-R 0 POP3
/Var/Qmail/bin/Qmail-popup mail.mydomain.com
/Home/Vpopmail/bin/vchkpw/var/Qmail/bin/qmail-pop3d maildir &

Create a file Qmail under/etc/rc. d/init. d. The content is as follows:
-------------------------------------------
#! /Bin/sh

Case "$1" in
Start)
Echo-n "Start Qmail :"
/Var/Qmail/RC &
Echo "."

Echo-n "Start SMTP Service :"
/Usr/local/bin/tcpserver-v-x/etc/tcp. SMTP. CDB
-U uid-g gid 0 SMTP/var/Qmail/bin/Qmail-smtpd 2> & 1
|/Var/Qmail/bin/splogger smtpd 3 &
Echo "."

Echo-n "Start POP3 Service :"
Tcpserver-H-R 0 POP3
/Var/Qmail/bin/Qmail-popup mail.mydomain.com
/Home/Vpopmail/bin/vchkpw/var/Qmail/bin/qmail-pop3d maildir &
Echo "."

Stop)
Echo-n "Stop Qmail :"
Echo "."

*)
Exit 1

Esac

Exit 0
-----------------------------------------------------
# CD ../rc3.d
# Ln-S ../init. d/Qmail s98qmail

Qmailadmin web-based Qmail Management

1 ezmlm
$ Make
$ Make man
# Make setup

2 autorespond
Gcc-wall-O autorespond. c
CP autorespond/usr/local/bin/autorespond

3 qmailadmin

3.1. There are several things to consider before you start.
A. Do you have a Vpopmail user and have installed vchkpw?
B. Location of your cgi bin directory
C. Location of your ezmlm directory
D. Location of your autorespond directory
If you ignore these parts, pause them and proceed !!

3.2 install

#./Configure
# Make
# Make install-strip

Open Path http://mail.mydomain.com/cgi-bin/qmailadmin in browser
User Postmaster; domain mydomain.com; Password: mydomain

Webmail -- sqwebmail
# Tar xvfz sqwebmail-1.2.0.tar.gz
# Cd sqwebmail-1.2.0
#./Configure -- without-authpam -- without-authuserdb -- enable-webpass = No -- without-authpwd -- without-authshadow
# Make configure-Check
# Make (db. H, CP/usr/include/db1/DB. h/usr/include/DB. h cannot be found when I make)
# Make check
# Make install-strip
# Make install-configure
Open Path http://mail.mydomain.com/cgi-bin/sqwebmail in browser

Vqsignup
# Tar xvfz vqsignup-0.4.tar.gz
# Cd vqsignup-4.0

Install

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.