The erection of sendmail Enterprise mail server

Source: Internet
Author: User
Tags final mail exchange mx record

Email is the most common use of people on the Internet, and many corporate users often use e-mail systems. In Unix systems, SendMail is the most widely used e-mail server. This article will provide a more detailed description of how to build a sendmail e-mail server to meet the basic needs of the enterprise.

I. SendMail mode of work

SendMail is the most important message transfer agent. It is important to understand the working mode of e-mail. In general, e-mail system can be divided into user agent, transport agent and delivery agent several parts. The user agent is used to accept the user's instructions, sending the user's letters to the letter transfer agent, such as Outlook Express and Foxmail. The delivery agent obtains the letter from the letter transfer agent to the end user's mailbox, such as Procmail.

When a user tries to send an e-mail message, he cannot send the letter directly to the other's machine, and the user agent must try to find a letter transfer agent and submit the message to it. After the letter transfer agent gets the message, it first saves it in its own buffer queue, and then, depending on the destination address of the message, the letter transport agent finds the message transfer proxy that should be responsible for the destination address, and then transmits the message to it over the network. After the other's server receives the message, it stores the buffer locally until the recipient of the email is viewing its e-mail.

Obviously, the message transfer is from the server to the server, and each user must have the space (called the mailbox) where the information is stored on the server to accept the message (the message is not sent by this restriction). As you can see, the primary job of a message transfer agent is to monitor the user agent's request, locate the corresponding mail server based on the destination address of the e-mail message, transfer the mail between the servers, and buffer or submit the received message to the final delivery program. There are many programs that can be used as message transfer agents. SendMail is one of the most widely used UNIX systems, and it is a freeware software that can support thousands of or even more users and consumes very little system resources. However, the configuration of SendMail is very complex, so some other tools, such as QMail or postfix, are also used.

When the SendMail program gets a message to be sent, it needs to determine the delivery of the letter to the corresponding server based on the destination address, which is implemented through the DNS service. For example, the destination address of an e-mail message is ideal@linuxaid.com.cn, then SendMail first determines that the address is a username (ideal) + The format of the machine name (linuxaid.com.cn), and then query DNS to determine the need to post the letter to a server.

In DNS data, e-mail-related messages are EXCHANGE,MX records, such as the following settings in DNS data files for linuxaid.com.cn this domain:

In MX ten Mail

In MX Mail1

Mail in A 202.99.11.120

Mail1 in A 202.99.11.121

Obviously, in DNS, linuxaid.com.cn has 2 MX servers, so SendMail is trying to send a message to either of them. In general, the previous MX server has a higher priority, so the server will attempt to connect the mail.linuxaid.com.cn 25 port, trying to forward the message to it. If successful, the SMTP server's task is complete. After that, the task will be completed by mail.linuxaid.com.cn. In general, the MX server automatically forwards the contents of the letter to the target host. However, there are cases where the target host (such as linuxaid.com.cn) may not exist or do not perform the SMTP service, but rather by its MX server to perform the management of the letter, the final letter will be saved on the MX machine until the user is able to view it.

If a DNS query cannot find an MX record for an address (usually because the other person does not have a mail exchange host), SendMail will attempt to talk directly to the host from the mail address and send the message. For example, there is no corresponding MX record in Test@aidgroup.linuxaid.com.cn,dns, so SendMail will obtain the IP address from DNS and attempt to send the message directly to the other party after determining that the MX server has failed.

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.