The working principle of the Exim4 email server

Source: Internet
Author: User

Exim4It is designed to run on the Internet efficiently and continuously, and can process various mixed mails. How does Exim4 deliver and receive emails? What security mechanisms can ensure Email Security? This section briefly introduces how Exim4 works.

Each message processed by Exim4 is identified by a 16-character name, which consists of three parts separated by a "-" number, for example, 1gs3yu-rjzg-nd. These characters are base encoded. The first part of the original information is the time when the email is received, and the second part is the process id of the email receiving, the information in part 3 is related to the settings of localhost_number in the configuration file. The Identification name is related to the time and process, which effectively ensures the uniqueness of the Identification name.

Exim4 collects emails from other hosts through the TCP/IP-based SMTP protocol. After receiving the email, Exim4 divides the email into two files and stores them in the spool directory, which is the/var/spool/exim4/input/directory on my machine. The naming rules for these two files are-D and-H after the email id. The file ending with-D stores the message body information, and the file ending with-H stores the mail header information. In some operating systems, too many files in the same directory may cause performance problems, so Exim4 can also set the split_spool_directory option, create 62 subdirectories under the input directory to save the mail information. These 62 sub-directories are named after a single letter and number (26 lower-case letters + 26 upper-case letters + 10 digits Total 62 digits and letters ). This setting enables the queuing of emails to be performed only in sub-directories, rather than all emails in a directory. Therefore, the efficiency of the email system is improved even when the number of emails is small.

The received email stays in the spool directory until it is delivered to the recipient or deleted by the Administrator. If the email cannot be delivered, the email will be marked with "frozen" and will not try again. However, the administrator can set ignore_bounce_errors_after and timeout_frozen_after options to release the "frozen" Status of the email after a certain period of time.

When Exim4 processes the email, it stores the logs in the/var/log/exim4 directory. The mainlog records a large amount of information, from which we can track the process of Exim4 processing emails. On a server with a large load, generating a large amount of log information will affect the server's performance. Therefore, we can use the no_message_logs parameter to disable the log function.

Router and transport are two important links in the mail delivery process of Exim4. router is responsible for processing the mail address and passing the mail to different transport for further processing, transport is responsible for transferring emails in spool to the destination to complete the delivery process. There are two types of transport: local transport, which is a file or local pipeline (pipe); remote transport, which is a remote host. If an email has multiple recipients, it may be delivered through multiple transport.

Both router and transport have different drivers for different functions.

Router drivers:

*

Accept,

*

Dnslookup,

*

Ipliteral,

*

Iplookup,

*

Manualroute,

*

Queryprogram,

*

Redirect,

Transport drivers:

*

Appendfile,

*

Autoreply,

*

Lmtp,

*

Pipe

*

Smtp

After reading the working principles of the Exim4 email server, I believe you have a full understanding of the Exim4 email server. I will explain it to you later.

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.