SME Server Configuration Scene (Mail Server)
2001-06-05 12:29
Publisher: NetBull Readings: 155 Tanghaijing (Submission) Chapter 4 Mail Server Section 1 Sendmail Server & 1.1 Introduction Mail Service is the most important network service that users need. The web has a large traffic, but the mail is mainly used in communication between individuals, and people - human communication is the foundation of business. The network without mail service is an incomplete network. In other words, if you cannot provide the user to provide mail support under the full TCP / IP, such a network operating system is not trustworthy. Configuring Sendmail is a big and complex work, but it is not entirely, and Linux has configured most of the settings compared to the case where other web server systems are installed, the SMTP server software is installed. Under the majority system, the default configuration can run well. I will give some suggestions for some configurations in this chapter. The main configuration parameters are recommended not to change at will. (LinuxByte Download Sendmail) & 1.2 Required Resources & 1.2.1 Required Package RedHat 6.2 Server Installation & 1.2.2 Required Profile /etc/sendmail.cf System Ossage, Administrator Configuration / Etc/sendmail.cw system comes with Administrator Configuration & 1.3 Configuration Scenario 1./etc/sendmail.cf Description: Sendmail The master configuration file controls the configuration of Sendmail runtime. Complete Sendmail Configuration should include 7 sections: local info (local information): This section defines the information option of the local host: Use to set options to define the Sendmail environment. Message Precedence: Sendmail Message Priority Trusted Users: Defines the user's Format of Headers that allows you to change the send address when you send an email: Define the message header information that is inserted in Sendmail ReWriting Rules. Rewinding rules): This part saves the rewritable email address command to use this command to rewrite the address form of the mail address from the address of the user mail program as the address of the mail sender. MAILER Definition: Defines the program that sends an email, the rewrite rule is the rule used by the mail, and is defined in this section. Source File: V8 / Berkeley CWLocalHost FW /etc/sendmail.cw cp. DyuuNet.u.Net CPUUCP DS mail.Weboa.com.cn Co @%! C .. C [[Kmailertable Hash -o / etc / mail / mailertable # Making DB Library KdomainTable Hash -o / etc / Mail / DomainTable KGENERICS HASH -O / ETC / Mail / GenericStable Kvirtusertable Kaccess Hash -o / etc / Mail / Access KMxServed Bestmx -z: - T
Kreesolve Host -a
-T
FR-O / ETC / MAIL / RELAY-DOMAINS
DR
DH
KDEQUOTE DEQUOTE
CM root
DM mail.weboa.com.cn
# Set the mail server name
DNMAILER-Daemon
Cpredirect
DZ8.9.3
O sevenbitinput = false
O EightBitMode = pass8
O aliaswait = 10
O aliasfile = / etc / mail / aliases, / etc / mail / majordomo
O MinFreeBlocks = 100
# Regulate minimum empty block
O MaxMessagesize = 1000000
# Specify the user's maximum mail size
O Blanksub =.
O Holdexpensive = false
O DeliveryMode = background
O Autorebuildaliases = TRUE
O TempfileMode = 0600
O helpfile = / etc / mail / sendmail.hf
O SendmimeErrors = TRUE
O ForwardPath = $ z / .forward. $ W: $ z / .forward
O connectionCachesize = 2
O connectionCachetimeout = 5M
O Useerrosto = false
O Loglevel = 9
# Record the event level of the log file
O CheckaliaSs = false
O ildstyleheaders = TRUE
O PrivacyOptions = Authwarnings, NoExpn, Novrfy
O Queuedirectory = / var / spool / mqueue
O Timeout.queuereturn = 4D
O Timeout.queuewarn = 4h
O Supersafe = true
O statusfile = / var / log / sendmail.st
O Defaultuser = 8: 12
O SMTPGREETINGMESSAGE = $ J Sendmail $ V / $ Z; $ B
O UnixFromLine = from $ g $ d
O Operatorchars =.:% @! ^ / []
Pfirst-Class = 0
PSPECIAL-DELIVERY = 100
PLIST = -30
PBULK = -60
Pjunk = -100
Ft -o /etc/mail/sendmail.ct
TROOT
TDaemon
TUUCP
R $$ # Error $ @ 5.7.1 $: "550 relaying Denied"
# Above is the default option for Linux, and the client is not allowed to use the mail server to send and receive mail. If the client is allowed, the upper side should be changed to
R $ - $ @ ok
# Note: The middle is two Tab keys
# 一下 邮头 信息 信息
H? P? Return-path: <$ g>
HRECEIVED: $? SFROM $ s $. $? _ ($? S $ | from $. $ _)
H? D? Reason-date: $ a
H? D? Date: $ a
H? F? Rest-from: $? X $ x <$ g> $ | $ g $.
H? F? From: $? X $ x $ g> $ | $ g $.
H? X? Full-name: $ x
H? M? Reason-message-id: <$ h!
H? M? Message-id: T. $@j
# Above is the mail header information
2. Administrators need Touch / etc / mail / aliases and Touch / etc / mail / majordomo to create two files, then restart sendmail, generate two library files using sendmail.cf to generate two libraries: aliases.db And Majordomo.db; & 1.4 Test and Management Measures
& 1.4.1 Test Method
1. Administrators can make changes by executing /etmail restart by performing /etc/rc.d/init.d/sendmail restart
The configuration takes effect.
2. Administrators use not mail by performing fetchmail -u yourname yourserver
The user needs their password, and the user needs to be set according to the client.
3. Administrators should open the POP3 service, that is, change the configuration file
3. Administrators can perform Echo Test | / USR / SBIN / Sendmail on the server
- v thj@weboa.com.cn to test whether the created mail user can work properly.
& 1.5 small knot
In fact, we can implement the function of the Mail server as long as we set a few places, because Sendmail has strong applicability, and it is constantly updated. So now the SENDMAIL's configuration solution has been practiced, and there is no need to make too much changes to the administrator, you can achieve powerful SendMail features.
Section 2 QMAIL server
& 2.1 Introduction
Qmail is a new generation of Unix mail systems that can completely replace the Sendmail-Binmail system. Qmail has a lot of features compared to Sendmail, including:
Safety ---- qmail divides the MAIL process into multiple processes, trying to avoid ROOT users
Run. At the same time, QMAIL prohibits direct delivery of privileged users (root, deamon, etc.)
letter.
Reliable ---- QMAIL direct delivery guarantee that email will not be lost during delivery.
Qmail supports new and more reliable mailbox format maildir, ensuring the system
The entire mailbox is not destroyed under sudden crash.
Efficient ---- On the BSD / OS running in the Pentium, QMail can be easily delivered every day 200000
Sealing letter.
Simple ---- qmail is much smaller than other Internet mail systems. Qmail through
One forward mechanism completes Forwarding, Alias and Mailist etiquette
Yes, qmail uses a simple and efficient queue to handle delivery. Qmail-smtpd can be
Inetd starts and saves a certain resource.
QMAIL support: host and user masquerading
Full host Hiding
Virtual Domains
Null Clients
List-owner shutriting
Relay Control
Double-Bounce Recording
Arbitrary RFC 822 Address Lists
Cross-host mailing list loop detection
& 2.2 Resources required
(
Linuxbyte downloads QMAIL, most other software can be found in LinuxByte, please use the LinuxByte search engine to find if you need.
& 2.2.1 Requirements
QMAIL-1.03.tar.gz qmail basic system package
UCSPI-TCP-0.88.Tar.gz TCPServer and other service programs
Daemontools-0.70.tar.gz Monitoring Tools
Checkpassword-0.90.tar.gz POP3 Verify User Programs
vpopmail-4.9.8.tar.gz virtual domain user POP3
VQSIGNUP-0.4 web way user registration
Sqwebmail-1.2.4.tar.gz webmailqmailadmin-0.42.tar.gz virtual domain web mode management
EZMLM-0.53.tar.gz Mail List Management
AutoRespond-1.0.0.tar.gz automatic reply program
& 2.2.2 Download URL
http://www.qmail.org
http://www.inter7.com/qmail
& 2.3 Installation Process
2.2.1 Install QMAIL Basic Package
(1) Add QMail to users and groups
MKDIR / VAR / Qmail
GroupAdd Nofiles
UserAdd -g Nofiles -d / var / qmail / alias alias
UserAdd -g nofiles -d / var / qmail qmails
UserAdd -g nofiles -d / var / qmail qmaill
UserAdd -g nofiles -d / var / qmail qmailp
GroupAdd Qmail
UserAdd -g nofiles -d / var / qmail qmailq
Useradd -g nofiles -d / var / qmail qmailr
UserAdd -g nofiles -d / var / qmail qmails
(2) Install the QMAIL package
CD / USR / Local / SRC
TAR XVZF QMAIL-1.03.tar.gz
CD QMAIL-1.03
Make setup check
./config-fast $ hostname
# Set the QMAIL server host name
CD ~ alias; touch .qmail-postmaster .qmail-mailer-
Daemon .qmail-root
Sed S / Mailbox / Maildir // / VAR / Qmail / Boot / Home>
/ VAR / QMAIL / RC
CHMOD 755 / VAR / QMAIL / RC
2.2.2 Installing TCPServer and other services
CD / USR / Local / SRC
TAR XVZF UCSPI-TCP-0.88.tar.gz
CD UCSPI-TCP-0.88
Make
Make setup check
2.2.3 Installing POP3 Verify User Programs
CD / USR / Local / SRC
TAR XVF Checkpasswd-0.90.tar.gz
CD Checkpasswd-0.90
Make
Make setup check
CHMOD OG-RX / BIN / Checkpassword
2.2.4 Installing the virtual domain user POP3 support
GroupAdd vchkpw
UserAdd -g vchkpw vpopmail
MKDIR ~ VPOPMAIL / ETC
Echo "127.0.0.:Allow ,ylayclient=" ""> ~ vpopmail / etc / tcp.smtp
echo "192.168.0.:Allow ,ylayclient=" "" >> ~ vpopmail / etc / tcp.smtp
echo ": allow"> /etc/tcp.smtp
/ usr / local / bin / tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp
CD / USR / Local / SRC
TAR XVZF vPopmail-4.9.8.tar.gz
CD VPOPMAIL-4.9.8
Make clean
./configure --enable-hardquota = 10485760 --Nable-Deliver-filter = y
Make
Make Install-Strip
CD / home / vpopmail / bin
./vadddomain weboa.com.cn Weboa./vadduser trj@weboa.com.cn THJ
2.2.5 Change Sendmail to qmail
Killall -Term Sendmail
MV / usr / lib / sendmail /usr/lib/sendmail.org
MV / usr / sbin / sendmail /usr/sbin/sendmail.org
mv /etc/rc.d/init.d/sendmail /etc/rc.d/init.d/sendmail.org
LN -S / VAR / QMAIL / BIN / Sendmail / USR / lib / sendmail
Ln -s / var / qmail / bin / sendmail / usr / sbin / sendmail
Cp / root / qmail / qmail-start /etc/rc.d/init.d/ -f
Cp / root / qmail / datates / var / qmail / control / -f
Ln -s /etc/rc.d/init.d/qmail /etc/rc.d/rc3.d/s98qmail
2.2.6 Making QMAIL Control Scripts
#! / bin / sh
Case "$ 1" in
START)
echo "Start QMail:"
/ VAR / QMAIL / RC &
Echo "Start SMTP Service:"
/ usr / local / bin / tcpserver -v -x /etc/tcp.smtp.cdb 0 SMTP
/ VAR / QMAIL / BIN / QMAIL-SMTPD 2> & 1 | / VAR / QMAIL / BIN / SPLOGGER
SMTPD 3 &
echo "Start Pop3 Service:"
/ usr / local / bin / tcpserver -h -r 0 POP3 / VAR / QMAIL / BIN /
qmail-popup $ hostname / home / vpopmail / bin / vchkpw
/ VAR / QMAIL / BIN / QMAIL-POP3D MAILDIR &
;
STOP)
echo "stop qmail:"
KILLALL -9 TCPSERVER
KILLALL -9 qmail-lspawn
;
*)
EXIT 1
;
ESAC
EXIT 0
2.2.7 Installing Monitoring Tools
CD / USR / Local / SRC
Tar Zxvf daemontools-0.70.tar.gz
CD daemontools-0.70
Make
Make setup check
# Execute the 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 launch QMAIL, you can also use SVC to turn off or restart qmail, monitor SVSTAT
QMAIL operation
2.2.8 QMAIL Web Solution
(1) Install mailing list management
CD / USR / Local / SRC
TAR ZXVF EZMLM-0.53.Tar.gz
Make
Make man
Make Setup
(2) Install automatic reply
CD / USR / Local / SRC
Tar Zxvf daemontools-0.70.tar.gz
GCC-Wall -o Autorespond AutoRespond.c
CP AutoRespond / USR / local / bin / autorespond
(3) Install the virtual domain web mode management
CD / USR / Local / SRC
TAR ZXVF qmailadmin-0.42.tar.gz
CD qmailadmin-0.42.tar.gz
Before installation, you must consider meeting the following requirements: a. Do you have a vPopmail user vchkpw
B.cgi-bin directory location
C.EZMLM directory location
The location of the D.AutoRespond directory
If you can reach the above requirements, you can continue to install
./configure
Make
Make Install-Strip
Test if the installation is correct: Open the path in the browser
Http://mail.weboa.com.cn/cgi-bin/qmailadmin,
Whether it can be successfully logged in according to the user and password set up.
(4) Install Webmail package
CD / USR / Local / SRC
TAR ZXVF SQWwebmail-1.2.4.tar.gz
CD SQWwebmail-1.2.4.tar.gz
./configure --without-authpam --without-authuserdb
Enable-webpass = no --without-authpwd
--without-authshadow
Make configure-check
Make
# When the Make Times is missing DB.H
Can cp /usr/include/db1/db.h /usr/include/db.h
Make Check
Make Install-Strip
Make Install-Configure
Test if the installation is correct: Open the path in the browser
http://mail.weboa.com.cn/cgi-bin/sqwebmail
(5) Install VQSIGNUP
TAR XVFZ vqsignup-0.4.tar.gz
CD VQSIGNUP-4.0
a. Modify the Makefile file:
Flags = -i / home / vpopmail / incn
Modify -i / home / vpopmail / include to the real vpopmail / incline directory
Modify this line below
$ (CC) $ (FLAGS) -O $ (BIN) $ (OBJS) -L / Home / vpopmail / lib --lvpopmail -lcrypt
Modify -L / Home / vpopmail / lib for the real vpopmail lib
b. Compilation
Make
c. Installation
Copy Signup.cgi and Signup.conf files to cgi-bin directory
Switching directory to the CGI-BIN directory
Chown vpopmail signup.cgi
Chgrp vchkpw signalup.cgi
CHMOD UG S Signup.cgi
CHMOD UGO R Signup.conf
Copy the vqsignup_html directory to the CGI-BIN directory, confident
User readable
Copy vqsignup.html file to the DocumentRoot directory, confident
Can be accessed. Edit the vqsignup.conf file under the CGI-bin directory
Modify all lines of "add_domain", plus your real domain, put others
The line deletes it. Change the vqsignup_text / *. Html file, the path to the row containing "result_ *" refers to the correct whole road.
Modify all the files under the vqsignup_text directory so that they only contain you
If you want to support the domain, you can customize these pages to make them more well.
Modify the vqsignup.html file in the documentroot directory, make it only
Contains the domain you want to support, you can customize this page so that it is better
Look at it.
d. test
Use your browser to access http: // your web server / your sub Dir / vqsignup.htm, try to register new users, if successful,
So congratulations. If there is an error, return to the installation step to carefully view the permissions of the file and whether the value in vqsignup.html is correct. & 2.4 Other Resources
ADAM MCKENNA Writing qmail-HOWTO
http://www.flideer.net/qmail/qmail-howto.html
Qmail FQA (included in qmail 1.03 source code)
http://www.qmail.org/
Http://www.linuxAid.com.cn/solution/ There are several more good installation documents
Http://www.linux process.net/cgi-bin/perl/wwwthreads.pl on QMAIL discussion
That is also good
& 2.5 small knots
QMAIL configuration work is greatly simplified than Sendmail, but wants to truly establish a powerful, running a mail server, mastering its flexible configuration, carefully reading its how-to and faq is necessary. About Dot-Forward, Mail List, etc. A very useful method and use skills are limited to the space, it is recommended to refer to the relevant documentation in the package.