Home > Backend Development > PHP Tutorial > Detailed installation of complete WEBMAIL solution based on qmail_PHP tutorial

Detailed installation of complete WEBMAIL solution based on qmail_PHP tutorial

WBOY
Release: 2016-07-21 16:07:17
Original
1142 people have browsed it

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 service program
daemontools-0.70 Monitoring tool
checkpassword-0.81 pop3 user verification program
ezmlm-0.53 Mail forwarding
vpopmail-4.9.6-1 Virtual domain user pop3 support
qmailadmin-0.35 Virtual domain web management
autorespond-1.0.0 Automatic reply program
sqwebmail-1.2.0 webmail
vqsignup-0.4 web user registration
Software source:
http ://www.qmail.org
http://www.inter7.com/qmail
Be sure to read the INSTALL and FAQ carefully before installing each package. Many problems have solutions in the FAQ.


Installation steps:

1. #mkdir /var/qmail

2. # groupadd nofiles
# useradd -g nofiles -d /var/ qmail/alias 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
After entering the qmail directory, carefully read the README and INSTALL files. Then start compiling qmail
#make setup check

4. #cd qmail-1.03
#./config

5. Create 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 to ~/Maildir by default.
 exec env - PATH="/var/qmail/bin:$PATH"
 qmail-start ./Maildir splogger q

 The splogger qmail command is used to record the log file in /.
Create a template
$ /var/qmail/bin/maildirmake /etc/skel/Maildir
$ echo ./Maildir/ > ~/.qmail
Note that Maildir must be owned by the user. You can chown changes and set permissions 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 executable 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 executable checkpassword file will be installed in /bin
If mail is not open to users in /etc/passwd, there is no need to install checkpassword, just vpopmail

9. Install daemontools
 # tar zxvf daemontools-0.70.tar.gz
 After installing this tool in

in bin, you can use
# mkdir /var/run/qmail
# supervise /var/run/qmail /var/qmail/rc
to start qmail, you can Use svc to close and restart qmail, and use svstat to monitor the operation of qmail, (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 use qmail’s sendmail libraby to replace the original sendmail
 # mv /usr/lib/sendmail /usr/lib/sendmail.old
 # mv /usr/sbin/sendmail /usr/sbin/sendmail .old
  # ln -s /var/qmail/bin/sendmail /usr/lib/sendmail
  # ln -s /var/qmail/sbin/sendmail /usr/sbin/sendmail
Remove sendmail Start the program, taking Linux as an example:
Remove the sendmail settings in inetd.conf and the sendmail startup file under /etc/rc.d/init.d. (Linux)


12. Start qmail SMTP, POP3 daemon system service

Create SMTP forwarding rules
Create /etc/tcp.smtp with the content
:allow
This is to accept forwarding letters sent by any client
If you want to reject Relay sent by certain IPs, change /etc/tcp.smtp to the following
1.2.3.4:allow,RELAYCLIENT=" "
 127.:allow, RELAYCLIENT=""
  In this case, all addresses except 1.2.3.4 and 127.* will be refused to forward letters.
 
 Next, convert tcp.smtp to cdb format.
 # /usr/local/bin/tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp < /etc/tcp.smtp

 Note: If there is any problem with tcp.smtp Any changes must be converted into cdb by tcprules to take effect.
In addition, if tcp.smtp is blank, it means rejecting all transfers because the default rule is deny.
At this point, the forwarding rule has been created, and qmail-smtpd will be started according to this rule later.

Set up the startup of SMTP and POP3 daemon
Please remove the smtp and pop3 settings in inetd.conf (add # sign)
Edit /etc/services and change to the following settings Defined:

 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 &

  The UID and GID are the User ID of qmaild of the new qmail system account mentioned above, and the group ID of nofiles .
 The line /var/qmail/bin/splogger will write the log file in /var/log/maillog.

Start POP3:
Edit the startup file and add the following settings:
tcpserver -H -R 0 pop3
/var/qmail/bin/qmail-popup mail.mydomain.com
/home/vpopmail/bin/vchkpw /var/qmail/bin/qmail-pop3d Maildir &


Create the 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 management qmail

1 ezmlm
$ make
$ make man
# make setup

2 autorespond
gcc -Wall -o autorespond autorespond. c
cp autorespond /usr/local/bin/autorespond

3 qmailAdmin

3.1. There are a few things to consider before you start.
a. Do you have vpopmail user and has installed vchkpw
b. The location of your cgi bin directory
c. The location of your ezmlm directory
d. The location of your autorespond directory
If you have ignored these parts , then pause and continue, let’s get these done first! !


3.2 install

# ./configure
# make
# make install-strip

Open the path http://mail in the browser .mydomain.com/cgi-bin/qmailadmin
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 (when I make, I get an error that db.h cannot be found, cp /usr/include/db1/db.h /usr/include/db.h)
# make check
# make install-strip
# make install-configure
Open the path http://mail.mydomain.com/cgi-bin/sqwebmail

vqsignup
# tar xvfz vqsignup-0.4.tar.gz
# cd vqsignup-4.0

Follow INSTALL to install

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/315180.htmlTechArticleInstallation 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 service program daemontools-0.70 monitoring...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template