First, install the environment and prepare work 1, download the file package, do not add a detailed description, you can download a big package (including many Dongdong) 2, install redhat9.0 is best installed in the province 3, unzip download This article attached to the compressed package file and enters this directory
Second, 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
Note: The above steps can be done with install_ucspi_tcp.sh
Third, install qmail
1. Create a directory:
MKDIR / VAR / Qmail Mkdir / Var / qmail / alias
2. Construction groups and users:
GroupAdd Nofiles GroupAdd Qmail Useradd Alias -g Nofiles -d / Var / qmail / alias -s / nonexistent UserAdd qmails -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
3. Patching dies and finishing QMAIL
TAR ZXVF qmail-1.03.tar.gztar zxvf qmail-smtpd-auth-0.31.tar.gzcp qmail-smtpd-auth-0.31 / base64. * Qmail-1.03 // Install SMTP-Auth patch, support SMTP authentication Patch -d qmail -1.03 4. Add alias users: Touch /var/qmail/alias/.qmail-root touch /var/qmail/alias/.qmail-postmaster touch /var/qmail/alias/.qmail-mailer-daemon 5. If posketfix and sendmail, deactivate the current Mail service /etc/rc.d/init.d/sendmail stopcp / var / qmail / bin / sendmail /usr/sbin/qmail.sendmailrm -f / etc / alternative / mtaln -s /usr/sbin/qmail.sendmail / etc / Alternative / MTA 4, install vpopmail 1. Create a directory: MKDIR / HOME / VPOPMAILMKDIR / HOME / VPOPMAIL / ETC 2. Add users and groups: GroupAdd vchkpwuseradd -g vchkpw vpopmail 3. Add a mysql's vpopmail user to operate the VPOPMAIL database MySQL -U root -p // Enter the mysql command line mysql> grant all on vpopmail. * to vpopmail @ localhost identified by "password"; 4. Compilation and installation VPOPMAIL TAR ZXVF vpopmail-5.2.1.tar.gzcd vPopmail-5.2.1vi vmysql.h / * =================================== Vmysql. H ============================================================================================================ Name) Define MySQL_UPDATE_PASSWD "12345678" (changed to the password you set) Define mysql_read_server "localhost" Define mysql_read_user "vpopmail" define mysql_read_passwd "12345678" (changed to your password) / * =============== ============================================================================================================================================================================================================= * / 5. Create a TCP.SMTP file (or use /etc/tcp.smtp) Vi /Home/vpopMail/tc/tcp.smtp/*==================== ts.. =========================================== ============================: Allow / * ================ ================================================== * / cd / home / vpopmail / EtctCprules tcp.smtp.cdb tcp.smtp.tmp ./configure / below is the parameters I use --prefix = / home / vpopmail / specified installation path --Nable-mysql = Y / Whether to apply mysql database --Nable-incdir = / usr / include / mysql / mysql database include Include Document Directory --Nable-libdir = / usr / lib / mysql / mysql database lib file where the directory is located --enable-default-domain = mydomain.com / Define Virtual domain name - access = N / Whether to use system password verification Method --Nable-Defaultquota = 52428800s / Definition By Douk size, 10485760 is 10MB, 20971520 is 20MB, 52428800S is 50MB - enable-tcprules-prop = / usr / local / bin / tcprules / specified tcprules directory --enable- TCPServer-file = / home / vpopmail / etc / tcp.smtp / Specify TCPRULES Application Rule File - INABLE-VPOPUSER = VPOPMAIL / VPOPMAIL User - SetNable-VpopGroup = Vchkpw / VPopmail Group --Nable-IP-Alias- Domains = n / in the virtual domain allows Virtual domain name Make Install-Strip by reverse IP address The above steps can be implemented by implementing install_vpopmail.sh 7. Create a virtual domain CD / home / vpopmail / bin ./vadddomain domain (password) (automatically generate vpopmail forms in MySQL Database VPopmail (if you use the same virtual domain name as the machine name, you should be a different virtual domain name, otherwise there will be problems. The VPOPMAIL database cannot be generated ./vadduser username password (automatically add user data to watch VPopmail, username, if you are unsuccessful, you must first remove the created domain,. / vdeldomain domain 5, SMTP-AUTH settings 1. Modify the properties of vchkpw CHMOD 4755 vchkpwchown root.root vchkpw If you use the verified SMTP, the SMTP process is to call the password verification program, you must use SetUID and SetgID. Improve the permissions of VCHKPW to complete the setgid operation. 2. Download installation CMD5Checkpw TAR ZXVF cmd5checkpw-0.22.tar.gzcd cmd5checkpw-0.22makemake install Note, because Checkpassword does not need to be installed because of the use of VPopmail. 6. Generate qmail's startup script Cp / var / qmail / boot / home / var / qmail / rc vi / var / qmail / rc // modified the RC file to determine the delivery mode: / * ============ ===== rc ================================= * /! / bin / sh USING SYSLOG. Using dot-forward to support sendmail-style ~ / .forward files. Using qmail-local to deliver messages to ~ / mailbox by default. Exec Env - path = "/ var / qmail / bin: $ path" qmail-start ./mails/ splogger qmail & / * ======================= ======================= * / VI / VAR / QMAIL / SMTP // Edit SMTP service startup script / * ============================================================================================================================================ ================== * /! / bin / sh Qmailduid = qmails / usr / local / bin / tcpserver -h -r -l 0 -t 1 -V -P /HOME/vpopMail/tc/tcp.smtp.cdb -u $ qmailduid -g $ nofilesgid 0 SMTP / VAR / QMAIL / BIN / qmail-smtpd hostname / home / vpopmail / bin / vchkpw / bin / true / bin / cmd5checkpw / bin / true 2> & 1 | / var / qmail / bin / splogger smtpd 3 & / * = ============================================================================================================================================================================================================= === * / Vi / var / qmail / pop3 // Edit POP3 service startup script / * ====================== POP3 ========== ================= * /! / bin / sh / usr / local / bin / tcpserver -h -r 0 pop3 / var / qmail / bin / qmail-popup hostname / home / vpopmail / bin / vchkpw / var / qmail / bin / qmail-pop3d maildir & / * === ============================================================================================================================================================================================================= * / CHMOD 755 / VAR / QMAIL / RCCHMOD 755 / VAR / QMAIL / SMTPCHMOD 755 / VAR / QMAIL / POP3 7. Run qmail and test / var / qmail / rc / var / qmail / smtp / var / qmail / pop3ps AUX | GREP "qmail" // View QMAIL's service process is completely started if Qmail is started normally, test QMail's SMTP and POP3 with Outlook Whether it is normal, pay attention to the VPopMail supports the virtual domain name, so when you set a mail account in Outlook, you will add a domain name, such as demo@demo.com. SMTP is certified, and it is also necessary in Outlook. It is recommended to install the qmail after the QMAIL will be installed. After QMAIL is working properly, IGENUS is installed for only 10 minutes, very smooth. If Qmail occurs, you can view the vpopmail database under MySQL, MySQLD and Mailog logging under / var / log, so it is easy to find out the problem. Eight, install and run IGENUS Building a TEMP folder CD / VAR / WWW / HTML / IGENUSMKDIR TEMPCHMOD -R 0755 Tempchown -R VPOPMAIL: Vchkpw Temp 2. Modify httpd.conf Vi /etc/httpd/conf/httpd.confgroup apacheuser apache modified to: Group vchkpwuser vpopmail 3. Modify config_inc.php files CD / usr / local / apache / htdocs / igenus / config vi config_inc.php / * =============== in config_inc.php ============= ======= * / $ cfg_basepath = "/ usr / local / apache / htdocs / iGenus"; $ Cfg_mysql_host = 'localhost'; $ cfg_mysql_user = 'vpopmail'; $ cfg_mysql_pass = '12345678'; / change to your password $ cfg_mysql_db = 'vpopmail'; $ Cfg_temp = $ cfg_basepath. "/ TEMP"; / * ===================================== ========= * / 4. Re-establish MySQL Database Table mysql -u root -pmysql> use vpopmail; mysql> alter table vpopmail drop primary key; mysql> alter table vpopmail add column pw_id int (5) NOT NULL primary key auto_increment; mysql> create table address (id int (11) unsigned NOT NULL AUTO_INCREMENT, PW_ID INT (5) Unsigned Not Null Default '0', Name Varchar (64) Not Null Default ', Email Varchar (128) Not Null Default', UNIQUE Key ID (ID), Key PW_ID (PW_ID) ) Type = myisam; mysql> quit; 5. Add new domains and new users with Vadddomain and Vadduser. Nine, anti-virus mail filtering There are many ways to filter filtration, such as MAIDROP Procmail, etc. This article uses Procmail for mail filtering. Many online practices are for Sendmail, which is relatively small for QMAIL. So I wrote this Dongdong for your reference, because I have just started contact with Procmail, if there is an improper, please correct it. The specific practices are as follows: 1. Install ProCmail If you don't have procmail in your operating system release, you need to install the download address: http://www.procmail.org/ You can find a lot of links through this website, or you can pass Google Search, there are still many introductions to Procmail. 2. Making the Procmailrc file Create this file via the editor, I am placed in / etc /, or it can be placed in other paths. The following example is first assuming: domain name: Test.com Username: EastfreeMan ProcmailRC file placement path: / etc / vpopmail installation path: / home / vpopmail / procmailrc files are as follows: ### st Procmailrc #### logfile = / var / log / procmail.log verbose = on virtualhome = `/ home / vpopmail / bin / vusefo -d $ ext@ Test.com` Maildir = $ VIRTUALHOME / MAILDIR : 0 b * ^ content-type:. * * Name =. * /. (HTA | COM | PIF | EXE | SCR) / dev / null