Install qmail + igenus in RedhatLinux9.0

Source: Internet
Author: User
Tags qmail
1. Install the environment and preparations to install RedHat9.0. During installation, select apache, php, and mysql to save the trouble of Self-Compiling and installation. For mysql, select the mysql-devel development kit, the header file and library file of mysql are in/usr/include/mysql and/usr/lib/mysql respectively. After Redhat9.0 is installed, modify/etc/httpd/conf/httpd. conf to enable the web service properly. For m 1, the installation environment and preparation work
Install RedHat9.0 and install apache, php, and mysql during installation, which saves the trouble of Self-Compiling and installation in the future. mysql should select the mysql-devel development kit, the header file and library file of mysql are in/usr/include/mysql and/usr/lib/mysql respectively.
After Redhat9.0 is installed, modify/etc/httpd/conf/httpd. conf to enable the web service properly and add the root user password for mysql. If a firewall is set, you need to open the smtp 25 and pop3 110 ports on the server.
  
2. Install ucspi-tcp-0.88
1. Download the corresponding software and patch. Due to the glibc version of redhat9.0, you must install the patch before compiling.
Wget http://cr.yp.to/ucspi-tcp/ucspi-tcp-0.88.tar.gz
Wget http://qmail.te8.com/rpms/glibc-2.3.1/ucspi-tcp-0.88.a_record.patch
Wget http://qmail.te8.com/rpms/glibc-2.3.1/ucspi-tcp-0.88.errno.patch
Wget http://qmail.te8.com/rpms/glibc-2.3.1/ucspi-tcp-0.88.nobase.patch
2. Install ucspi-tcp-0.88
# Tar zxvf ucspi-tcp-0.88.tar.gz
# Cd ucspi-tcp-0.88
# Patch-p1 <../ucspi-tcp-0.88.a_record.patch
# Patch-p1 <../ucspi-tcp-0.88.errno.patch
# Patch-p1 <../ucspi-tcp-0.88.nobase.patch
# Make
# Make setup check
  
3. Install qmail
1. Download Software and patches:
Wget http://cr.yp.to/software/qmail-1.03.tar.gz
Wget http://www.ckdhr.com/ckd/qmail-103.patch
Wget http://www.qmail.org/qmailqueue-patch
Wget http://www.shupp.org/patches/qmail-maildir++.patch
Wget http://qmail.te8.com/rpms/glibc-2.3.1/qmail-1.03.errno.patch
Wget http://qmail.te8.com/rpms/glibc-2.3.1/qmail-1.03.qmail_local.patch
Wget http://members.elysium.pl/brush/qmail-smtp-auth/dist/qmail-smtpd-auth-0.31.tar.gz
2. Create a directory:
# Mkdir/var/qmail
# Mkdir/var/qmail/alias
3. Create a group and a user:
# Groupadd nofiles
# Groupadd qmail
# Useradd alias-g nofiles-d/var/qmail/alias-s/nonexistent
# Useradd qmaild-g nofiles-d/var/qmail-s/nonexistent
# Useradd qmaill-g nofiles-d/var/qmail-s/nonexistent
# Useradd qmailp-g nofiles-d/var/qmail-s/nonexistent
# 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
4. Install qmail by patching and coding.
# Tar zxvf qmail-1.03.tar.gz
# Tar zxvf qmail-smtpd-auth-0.31.tar.gz
# Cp qmail-smtpd-auth-0.31/base64. * qmail-1.03 // install the smtp-auth patch, supporting smtp authentication
# Patch-d qmail-1.03 <qmail-smtpd-auth-0.31/auth. patch
# Cd qmail-1.03
# Patch-p1 <../qmail-103.patch
# Patch-p1 <../qmailqueue-patch
# Patch-p1 <.. qmail-maildir ++. patch
# Patch-p1 <.. qmail-1.03.errno.patch
# Patch-p1 <.. qmail-1.03.qmail_local.patch
# Vi qmail-smtpd.c // change 451 in the straynewline function to 553
# Make setup check
#./Config-fast test.mydomain.com
5. Add an alias User:
# Touch/var/qmail/alias/. qmail-root
# Touch/var/qmail/alias/. qmail-postmaster
# Touch/var/qmail/alias/. qmail-mailer-daemon
6. If postfix and sendmail exist, disable the current mail service.
#/Etc/rc. d/init. d/sendmail stop
# Cp/var/qmail/bin/sendmail/usr/sbin/qmail. sendmail
# Rm-f/etc/alternative/mta
# Ln-s/usr/sbin/qmail. sendmail/etc/alternative/mta
Redhat9.0 has considered using another email server instead of sendmail, because it provides two options: postfix and sendmail.
  
4. Install vpopmail
1. Download the stable version of vpopmail
Wget http://www.inter7.com/vpopmail/vpopmail-5.2.1.tar.gz
2. Create a directory:
# Mkdir/home/vpopmail
# Mkdir/home/vpopmail/etc
3. Add users and groups:
# Groupadd vchkpw
# Useradd-g vchkpw vpopmail
4. Add the mysql vpopmail user to operate the vpopmail database.
# Mysql-u root-p // enter the mysql Command Line
Mysql> create database vpopmail;
Mysql> grant all on vpopmail. * to vpopmail @ localhost identified by "password ";
5. Compile and install vpopmail
# Tar zxvf vpopmail-5.2.1.tar.gz
# Cd vpopmail-5.2.1
# Vi vmysql. h
/* ============================== Vmysql. h ===================================== */
# Define MYSQL_UPDATE_SERVER "localhost" (mysql server name)
# Define MYSQL_UPDATE_USER "vpopmail" (user name)
# Define MYSQL_UPDATE_PASSWD "12345678" (change to the password you set)
  
# Define MYSQL_READ_SERVER "localhost" (mysql server name)
# Define MYSQL_READ_USER "vpopmail" (user name)
# Define MYSQL_READ_PASSWD "12345678" (change to your password)
/* ===================================================== ===================================== */
6. Create a tcp. smtp File (or use/etc/tcp. smtp)
# Vi/home/vpopmail/etc/tcp. smtp
/* ================================= Tcp. smtp ===================================== */
127.0.0.1: allow, RELAYCLIENT = ""
: Allow
/* ===================================================== =================================== */
# Cd/home/vpopmail/etc
# Tcprules tcp. smtp. cdb tcp. smtp. tmp <tcp. smtp
7. Compile:
#./Configure \ The following are my parameters
-- Prefix =/home/vpopmail \ specifies the installation path
-- Enable-mysql = y \ whether to apply the Mysql database
-- Enable-incdir =/usr/include/mysql \ Mysql database include file directory
-- Enable-libdir =/usr/lib/mysql \ Mysql database lib file directory
-- Enable-default-domain = mydomain.com \ define virtual domain name
-- Enable-passwd = n \ whether to use the system password verification method
-- Enable-defaultquota = 52428800 s \ defines the default mailbox size, 10485760 is 10 MB, 20971520 is 20 MB, and 52428800s is 50 MB
-- Enable-tcprules-prog =/usr/local/bin/tcprules \ specify the tcprules directory
-- Enable-tcpserver-file =/home/vpopmail/etc/tcp. smtp \ specify the tcprules application rule file
-- Enable-vpopuser = vpopmail \ vpopmail user
-- Enable-vpopgroup = vchkpw \ vpopmail Group
-- Enable-ip-alias-domains = n \ allows reverse ip addresses to be used to find virtual domains in a virtual domain
# Make
# Make install-strip
8. Create a virtual domain
# Cd/home/vpopmail/bin
#./Vadddomain domain name (password) (The vpopmail form is automatically generated in mysql database vpopmail)
(If the virtual domain name is the same as the machine name, it should be converted into another virtual domain name. Otherwise, a problem occurs and the vpopmail database cannot be automatically generated)
#./Vadduser Username Password (will automatically add user data to the table vpopmail, the user name to carry a domain name, such as demo@demo.com)
If it fails, you must first Delete the domain name./vdeldomain
  
5. smtp-auth settings
1. Modify vchkpw attributes
# Chmod 4755 vchkpw
# Chown root. root vchkpw
If you use smtp with verification, the smtp process must use setuid and setgid to call the password verification program. The setgid operation can be completed only when the vchkpw permission is improved.
2. Download and install cmd5checkpw
Wget http://members.elysium.pl/brush/cmd5checkpw/dist/cmd5checkpw-0.22.tar.gz
# Tar zxvf cmd5checkpw-0.22.tar.gz
# Cd cmd5checkpw-0.22
# Make
# Make install
Note that because vpopmail is used, the checkpassword does not need to be installed.
  
6. Generate the qmail Startup Script
# Cp/var/qmail/boot/home/var/qmail/rc
# Vi/var/qmail/rc // modify the rc file to determine the delivery method:
/* = ===== */
#! /Bin/sh
  
# Using splogger to send the log through syslog.
# Using dot-forward to support sendmail-style ~ /. Forward files.
# Using qmail-local to deliver messages ~ /Mailbox by default.
  
Exec env-PATH = "/var/qmail/bin: $ PATH "\
Qmail-start./Maildir/splogger qmail &
/* ===================================================== ======= */
# Vi/var/qmail/smtp // edit the startup script of the smtp service
/* = ================= */
#! /Bin/sh
  
QMAILDUID = qmaild
NOFILESGID = nofiles
  
/Usr/local/bin/tcpserver-H-R-l 0-t 1-v-p-x/home/vpopmail/etc/tcp. smtp. cdb-u $ QMAILDUID-g $ NOFILESGID 0 smtp/var/qmail/bin/qmail-smtpd hostname/home/vpopmail/bin/vchkpw/bin/true/bin/empty 5checkpw/bin /true 2> & 1 |/var/qmail/bin/splogger smtpd 3 &
/* ===================================================== ========================= */
# Vi/var/qmail/pop3 // edit the pop3 Service Startup Script
/* = ==========
Related Article

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.