Application of email relay on Linux Server

Source: Internet
Author: User
Tags email account
Article Title: Application of mail relay on a Linux server. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

Yesterday I received a help call from the apprentice. He said that he deployed the Sendmail mailbox server on the Linux server. However, we encountered a strange problem. You cannot use the client software to send or receive emails. However, if you log on to the host using Telnet, you can send emails normally. It can be seen that the email server is correctly deployed. So what is the problem? This makes him unable to start.

I. Fault reproduction.

The Sendmail server software is the most widely used mail server in the Linux operating system. Therefore, it is compatible with the Linux operating system. Therefore, this fault cannot be caused by the defects of the email server. After the Sendmail mail server is deployed, if you use Outlook or other client software to connect to the server, the client reports an error. According to the client error message, the message "error occurred while logging on to the email server, incorrect user name" is displayed ". However, the user name and password are correct When configuring the client.

Is this user name blacklisted on the email server? I created another email account for test, but the error persists. It indicates that this problem is not related to the account. The error message provided by the client software is misleading to us. In fact, not only the mail client, but the error information provided by many applications is not very consistent. For this reason, we can only use these error messages for reference, rather than trust them by a hundred percent. Later, I logged on to the mail server via SSH and found that the mail was sent normally. This indicates that the email server configuration is correct. Because Telent is not secure, the user name and password are transmitted in plaintext on the network. Therefore, we do not recommend that you use it.

  Ii. Cause Analysis.

After some efforts, we finally found that the relay function was at fault. When the Sendmail server is deployed, the email duplication function from the external host is disabled. In other words, the email server allows sending emails sent from the local machine. Emails sent on the client will be rejected. In fact, there is no way to impose similar restrictions on the Sendmail server. Because there are too many advertisement emails and virus emails on the Internet. The designer of Sendmial intended to restrict the negative impact of these problematic emails on the enterprise's network environment and operating system in this way, but did not expect it to cause trouble for users to deploy email applications. This is the foot of a rock. After the mail relay function is disabled, users must remotely log on to the mail host when sending and receiving emails, or do not use the mail client to send emails, which will arouse users' dislike. Because it will increase the workload for sending and receiving emails. Therefore, the email relay function is disabled no matter which one is sent or not. I don't think this can solve the problem from the root cause.

 3. moderately develop the mail relay function.

The relay function is required when you deploy an email application in an enterprise. You can enable the mail server relay function in the following ways.

1. Modify the sendmail. cf configuration file.

Run the command "vi/etc/mail/sendmail. cf "open the configuration file, and a record will be found in the middle of the file: O DaemounPortOpti = Port = smtp, Addr = 127.0.0.1. if this record is found in the configuration file, it indicates that only the email host can send emails. That is to say, no host except the local machine can use this email server to send emails. To allow email clients deployed on other hosts to send emails, you must change this record. The modification method is also very simple. You only need to change this IP address to the valid IP address of the host. Note that it is better not to change the address to the domain name of the server, but to the IP address directly. This can reduce unnecessary domain name resolution actions.

 2. Modify the ACCESS configuration file.

Use the command "vi/etc/mail/access" to open the access configuration file. By default, the content of this configuration file is shown in. From this file, we can see that by default, only the ultimate functions of the local machine are allowed, and other hosts are not allowed to use the relay function. To enable clients on other hosts to use the relay function on the mail server, you need to modify this configuration file. The specific modification method is as follows:


First, you need to understand the record format.From this, we can see that the basic format of this configuration file record is "the address that allows the relay function type ". Note that you can use the TAB symbol to separate the root, instead of using the colon or other separators. This is a little different from some configuration files.

[1] [2] Next page

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.