QMAIL mail system (3) QMAIL works and configuration file settings

xiaoxiao2021-03-06  82

Set of (three) qmail works and profiles: peng forum ID: peng www.chinaunix.net QQ: crab 16,360,544 Introduction In this chapter, we mainly introduce set qmail works and profiles. Through this section, let us analyze questions and facilities qmail. 3.1 What is qmail? QMAIL package is a mail program on the UNIX system. The QMAIL program is a standard UNIX server that is developed by Dan Bernstein, which is used to replace Sendmail for the MAIL TRANSFER AGENT, MTA. QMAIL Internet Home http://www.qmail.org. 3.2 QMAIL and related service QMAIL provide MTA features, but customers can see their own letters and other protocols and software. Two common remote users retrieve their messages are the Mechanism of Post Office Protocal, POP3 and Interactive Mail Access Protocol, IMAP. Overview: QMAIL system includes several executable programs, configuration files, qmail tools, and environment variables, which are mutually influential, together with email services. 3.3 QMAIL Delivery Mail Process Process QMAIL System has 9 core programs, which is a simple introduction. QMAIL-SMTPD is responsible for receiving mail messages from the remote host and transmitting them to qmail-queue processing. The qmail-incject program is used to receive the local mail message and transmit it to the qmail-queue program. Qmai-Queue program handles the mail they sent, move into the mail queue to send. Once the message is successfully placed in the mail queue, call the qmail-send program to process him. Qmail-send Checks each message state in the mail queue, the message that the previous message request failed, and decided that it is temporary failure or permanent, temporary failure will be delivered again, and the permanent fail will be sent to the qmail-clean program, Deleted. That is, qmail-clean practically clears the permanent fail message. Qmail-send calls QMail-Lspawn and QMail-Rspawn programs. Qmail-send determines that the email is sent to, send it to the local, and then delivers qmail-local to the local mail server. If it is determined to be a remote host, call the qmail-rspawn program, qmail-rspawn determines the mail server for each mail message, and then call the qmail-transalog program. 2.2Qmail process qmail-send splogger qmail qmail-lspawn qmaiil-qawn qmail-clean QMAIL requires five programs to run in the background. These core programs allow QMAIL to scanned new mail and send them to the appropriate destination. 3.4 QMAIL Utilities Programs In addition to the above five QMAIL processes, processes and local users will use several other QMAIL utility programs during processing and transfer messages.

As follows: bouncesaying allows users to forward messages to programs or programs, when they are not available, rebounded back information Condirect allows users to forward messages to the program, then forward messages to another address EXCEPT Everbrepts are often used to modify an exit encoding for a calling program to forward messages. A spare email address MAILDIR2MBOX will transition to messages in the MAILDIR format mailbox to a standard Sendmail mailbox in MAILDIRWATCH to generate a mailbox Mails, MAILDIRWATCH Monitor a user's mail directory and report all new messages prelines in transfers messages to related procedures Pre-pre-processing QBIFF When the new message arrives, write a notification qmail-clean from the QMAIL mail queue to qmail-local in the QMAIL mail queue to the QMAIL mail queue from the QMAIL mail queue. User delivery message on the local mail system QMAIL-LSPAWN is called by qmail-send to forward messages to qmail-local programs qmail-newmrh to create qmail database from a MorerCpthosts file qmail-new ASCII file containing system username and mail name The table creates a QMAIL user file QMAIL-POP3D accepts the POP3 connection to allow users to read their mailbox qmail-popup to verify the user ID and password qmail-pw2u in the POP3 connection to convert the Unix system user ID and password to qmail-new A table structure QMAIL-QMTPD accepts the QMTP connection from the remote host to the QMAIL-QRead generates a report of the current QMAIL mail queue message QMail-qstat generating a report to display the current in QMAIL delivery. Wait to send Number of messages qmail-queue Wait for the mail message to wait for the QMail-Remote to send a message to the remote mail user qmail-rspawn by qmail-send forwarding message qmail-recote forwarding message qmail-send Try to deliver mail in QMAIL mail queue Message qmail-showctl Displays the current qmail system configuration QMAIL-SMTPD Receives SMTP connection from the remote host request Qmail-Start initializes Qmail's startup script QMAIL-TCPOK is used to empty qmail-recot The TCP timeout record table qmail-tcpto displays the current TCP timeout record table QRecEiPT to deal with the message Sendmail to be confirmed by sendmail to copy the functionality of the sendmail program to the MTA program to insert the message to insert the message into the system login program TCP-ENV converts network connections to UNIX environment variables Each QMAIL utility program plays different feet in the correct processing and delivery message messages. Some of them can only be called for qmail kernel programs, others can be used by QMAIL's system administrators to process messages and get statistics. There are also some ordinary mail users to make their own mail messages. 3.5 QMAIL Environment Variables In addition to control files, QMAIL programs can also use UNIX environment variables to control their actions. Most of the value of the control file can be overloaded by a corresponding set environment variable. If the environment variable is not set, the value of the control file is used. QMAIL's environment variable is set before the Qmail program is running. This is done by a packaging program. Common is TCPWrapper and TCPServer. This article uses TCPServer. In the future "(4) UCSPI-TCP principle and settings", discussed in detail. 3.6 QMAIL Control File This is very important for managing QMAIL. The control file is the central link in the QMAIL configuration, which controls the operationality of QMAIL. It is located in / var / qmail / control directory. Each file contains a value that defines the corresponding QMAIL executable variables. QMAIL control file is an ASCII text file that defines the qmail parameter.

Most control files require a single text value that can be entered in a row. There are also some control files that can contain multiple values. In this case, each value is input to a separate line, each line ends at a standard UNIX wrap (LF). There is also a key attention to the privilege of the control file, and the recommended root is readable, other read only. #CHMOD 644 / VAR / QMAIL / Control / * The following will introduce a control file one by one: ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- . Moreover, it can take effect without restarting qmail. For example: peng@96633.net ----- Limit a specific user @ jp.yahoo.com ---- limits all users on all hosts on a remote host @ Sina.com --- Restriction The message in the entire domain ---- bouncefrom is used to define the username, which appears in the message that is returned to the original sender, is generally permanent delivery failure message. The BounceFrom default is MAILER-DAEMON, which is usually a virtual user name and is an alias for real users. If you want to give the user's returning message, you can use another name, you can use the command: # echo postmaster> / var / qmail / control / bouncefrom --- is changed to Postmaster, I am used to. ----- BounceHost Develops the host name in the returning message, the default value is the host name of the ME file. ------ ConcurrencyLocal defines the number of local delivery processes that qmail can run simultaneously. It is important for large mail hosts. His default parameter is 10. It is allowed to operate more than 10 local mail delivery processes. The maximum value of this control file is set by the CONF-SPAWN variant parameter in the QMAIL source code. This compilation parameter default value is 120, and his maximum is 255. ------ ConcurrencyRemote defines the number of remote delivery processes that QMAIL can run at the same time, the default value is 20. It is also set by conf-spawn, the default value is 120, and the maximum can be 255. But according to your actual situation, because the process should need memory and hard drive, set too much care about your server load! ------- DefaultDomain default domain name, if you send a local mail user, QMail-Inject will add a domain name in the defaultdom in file with a domain name. If the qmAildefaultDomain environment variable is set, he will overreload the value of the DefaultDomain control file. --------- DEFAULTHOST default host name, on the same mail server, send a local user, if the user address is not adding the domain name, it will add host name. For example: mail host mail.chinaunix.net, send a local user peng@rchinaunix.net, from: peng, then qmail will expand this message to peng @ mail.chinaUnix.net, qmail-send identification is easier. Usually, everyone hopes to see the domain name @ chinaunix.net, do not see the host name @ mail.chinaunix.net, so qmail only allows you to see the domain name. ---- DataBytes defines the maximum number of bytes allowed by the mail message accepted by qmail-smtpd, which is to transmit and accept the size of the message (except for the unit on this machine).

That is to say, the remote mail host and you are sending a letter from remote MUA tools such as Outlook, Foxmail. The default is 0, indicating that it is not limited. It is impossible to understand that there is no file by default, be sure to add. If you think about it, there is a telecom's buddy gives you the bad, in the backbone network computer room, write a timed task, you will send you a few 100M letters, hehe. . . # echo 10000000> / var / qmail / control / data --- is set to 10m, more than 10m, will get Code 552, tolerate: The email size exceeds the limit of the mail host tolerance ---- DoublebounceHost is used Those who have experienced two rebounds specify the host name. The default is the value of the ME file ---- Doublebounceto is used to specify user names for messages that have experienced twice, the default is Postmaster. ---- Envnoathost is the qmail-send used to specify his host name for the mail acceptor without the designated hostname. The default is not this control file, qmail-send uses the ME file-defined ---- Helohost specifies QMail-Remote The host name used in the SMTP session of the remote mail server. If the HeloHost control file is not given, qmail-remote uses the value of the ME file. ---- IDHOST Specifies the value used to generate a message-id: header field to generate a message, default qmail-incject with the value of the ME file. ---- Localiphost is used to specify local addresses for email messages, and the content is the IP address of the mail host. But it will have a problem with it on DNS. It is recommended not to set it. ---- locals Specifies the local address of the message, does not exist, qmail-send assumes that the value of the ME file is the only available local mail host. ---- Me is used to designate the host name of the local mail server, the most important control file, if not, qmail will not run. The ME control file is typically established by running the CONFIG script file under the QMAIL configuration subdirectory. The config script automatically determines the DNS domain name of the mail server and generates an appropriate control file (ME, locals, rcpthhosts). If your mail server cannot connect to the DNS server, you can manually run configfast to specify the mail server hostname: # / var / qmail / configure / config-fast mail.chinaUnix.net ---- Plusdomain is used to use a domain name Specify an address ending with a plus sign ( ). In the default, the domain name appears in the ME file is added to any one of the email addresses ending with the plus sign. ---- queuelifetime Use to specify a message before he is deleted, the number of times can be saved in the mailing list. The default is 604800, and when the delivery failed message exceeds the specified time, it will be removed from the mail queue. ---- RCPHOSTS Defines the host and domain name of QMail to receive messages. However, because the domain names in RCPTHOSTS should not be more than 50 rows, more out of addition to the MorerCpthosts. ---- MorerCpthosts is used to specify that qmail will have additional hosts and domain names to accept messages. ---- SMTPGREETING Used to specify the welcome flag of the SMTP connection, the default is the host name of the Me file.

For example, the SMTPGREETING value will see the following information when building a SMTP connection for Welcome -mail.chinaUnix.Net: Trying 198.160.xx .. connect to mail.96633.net escape characteris ^] . 220 Welcome Connect To Out Open Relay Mail Server -mail.chinaUnix.NET ESMTP ---- SMTPRoutes is used to specify static SMTP connections that can be used to deliver messages to specific destinations. The SMTPRouter line format is as follows: Host: relay where Host can be a host name or domain name, which will be redirected to a specific mail host with Relay defined. Example: Beijing.chinaUnix.net: Xhanghai.ChinaUnix.Net ChinaUnix.net:: tianjin. Chinaunix.net: 2000 First line, defined any message redirection to Beijing. ChinaUnix.net to Shanghai. Chinaunix.net Row, forced QMAIL for any DNS query on any address ending with CHINAUNIX.NET. Third lines, by do not specify the first parameters, any messages within the first two lines will be forwarded to the mail server tianjin.96633.net. At the same time, it also replaces the standard SMTP TCP 25 port with the 2000 port. This technique is often used in connecting to the Internet email through a firewall. Note: SMTProutes can define many specific SMTP routes. The host is your address list, QMail will process these addresses in the order in the SMTPRoutes file. Sometimes it is wrong, it will cause a message to loop, remember! ---- TimeoutConnect used to specify the number of times the Qmail-Remote will wait for a number of times. That is to say waiting for the remote SMTP server to accept a local SMTP request response, the default is 60 seconds. For networks with bad quality, you can adjust it properly. ---- TimeoutRemote is used to specify the timeline of qmail-smtpd waits for the remote SMTP host to send data. By default, if no information accepted by the remote SMTP host after 1200 seconds after the connection is established, then this connection will be closed. ---- timeoutsmtpd used to specify the number of times the qmail-smtpd waits for the remote SMTP client connection. The default is 1200, exceeding this time, the connection is canceled. ---- VirtualDomains Let QMAIL have accepted local emails and accept the domain or email address specified in this file, which is often the virtual domain support. Some control files mentioned above, qmail are not available by default, only some must have. Based on your different usage of your mail, choose to create and set it yourself. 3.6 System alias Qmail system alias and Sendmail are not the same, without having a big file to contain all. Instead, there are many independent alias files. In / var / qmail / alias, the format is as follows:. Qmail-alias --- Alias ​​is the alias to build. Example: I want to build a separate name file for Postmaster, enabling mail sent to Postmaster to Peng Echo Peng> /var/qmail/alias/.qmail-postmaster 3.7 user alias In addition to the system file,. QMAIL can also support independent user system profiles. In the user's home directory.

For example, in the user's peng directory, create a PENG-SALES's mailing list to create .qmail-sales files, add mail addresses to files, each line. This will give any one address COPY to the message sent to PENG-SALES. 3.8 Change the MUA Program Interface Qmail program contains an executable program that replaces the Unix standard Sendmail program. You have to use qmail as your mail server, you must replace existing Sendmail programs with QMAIL's Sendmail packages. # mv / usr / sbin / sendmail /usr/sbin/sendmail.bak # chmod 0 /usr/sbin/sendmail.bak # ln -s / var / qmail / bin / sendmail / usr / sbin / sendmail 3.9 established qmailsmtp function tradition Use the inetd program to listen to the network, but there are a lot of disadvantages. This article uses the TCPServer service of the UCSPI-TCP package instead of it. Refer to the script file of Iceblood's qmail-setup.1.5.3, I am done like this: 1. Create a / etc / qmail directory, build SMTP.SH AND POP3.SH Startup script 2, established TCP.SMTP and TCP .smtp.cdb file. I do this: #echo "/ etc / qmail / start" >> /etc/rc.d/rc.locad --- boot execution / etc / qmail / start # touch / etc / qmail / start - - Establish execution file # Touch / etc / qmail / smtp --- Create SMTP script file # Touch / etc / qmail / pop --- create POP script file # touch /etc/qmail/tcp.smtp - to establish TCPServer Connection rule file # echo "csh -cf '/ var / qmail / rc &'"> / etc / qmail / start - boot launch qmail # echo "/etc/qmail/smtp.sh"> (ketc/qmail/ START - Boot execution SMTP.sh SMTP scripting content: / usr / local / bin / tcpserver -h -r -l chinaunix.net -t 1 -c 100 -V -P -X / etc / qmail / tcp.smtp. CDB -U 502 -G 501 0 SMTP / VAR / QMAIL / BIN / QMAIL-SMTPD / HOME / VPOPMAIL / BIN / VCHKPW / BIN / TRUE | / VAR / QMAIL / BIN / SPLOGGER & (Note: 502 and 501) The value of QmAild and Nofiles's UID AND GID.) POP scripting content: / usr / local / bin / tcpserver -c 100 -V -L chinaunix.net -u -h -R 0 POP3 / VAR / QMAIL / BIN / Qmail-popup chinaunix.net / home / vpopmail / bin / vchkpw / var / qmail / bin / qmail-pop3d maildir 2> & 1 | / var / qmail / bin / splogger & tcp.smtp scripting content 127.0.0.1 :Allow ,ylayclient = "": allow # / var / qmail / bin / tcprules /etc/qmail/tcp.smtp.cdb /etc/qmail/tcp.smtp.tmp

转载请注明原文地址:https://www.9cbs.com/read-103691.html

New Post(0)