Introduction to Sendmail mail server configuration in Linux

Source: Internet
Author: User
For details about how to configure Sendmail mail server in Linux, refer to "Linux Enterprise Application"> "Linux server application. 1. First of all, it is critical to set up DNS to enable LINUX to send and receive emails. Without DNS, it is impossible for LINUX to send and receive emails normally. My service DNS configuration is as follows:

The IP address of the server is a. B. c. d.

Assume that my domain name is domain.com.

Machine name: my

Forward resolution file name: db.domain.com

Content:

@ In soa ns.mydomain.com. root.ns.mydomain.com .(

2001061405; serial

3600; refresh

900; retry

1209600; expire

43200; default_ttl)

@ In mx 5 ns

@ In ns ns

@ IN a. B. c. d

Mail in a. B. c. d

My in a a. B. c. d

Localhost in a 127.0.0.1

Test in a a. B. c. d

Mail in cname my.mydomain.com.

Reverse resolution file name: db. A. B .C

@ In soa my.mydomain.com. root.ns.mydomain.com .(

2001061405; serial

3600; refresh

900; retry

1209600; expire

43200; default_ttl)

@ In ns my

38 in ptr my.mydomain.com.

After these two parsing files are set, the remaining files, such as/etc/named. conf,/etc/named. boot, will be set. The following describes how to configure the email server.

Files that may be used:/etc/sendmail. mc,/etc/sendmail. cf, and files under/etc/mail.

First, check whether sendmail and POP3 are started. The command is as follows:

Ps-auwx | grep sendmail. If sendmail is started, some information is displayed,

Netstat-a | grep pop. If the POP3 port is enabled, the following message is displayed:

Tcp 0 0 *: pop3 *: * LISTEN; otherwise, no message is displayed.

If you choose to install LINUX completely, you do not need to generate the sendmail. cf file. The sendmail version of Linux6.2 is 8.9.3, which is safe and easy to use.

1. Modify sendmail. cf

Add the name of the server to which you want to receive the email after the Cwlocalhost line. For example:

Cwlocalhost mail.mydomain.com

If you have already set up the email server in DNS, you do not need to change it here.

Fw/etc/sendmail. cw indicates the file where sendmail is located to find sendmail. cw. This file is very important.

You may also need to modify the following line:

R$ * $ # error $ @ 5.7.1 $: "550 Relaying denied" changed

R$-$ @ OK

Note: you must use the "Tab" key to separate them.

2. Modify the sendmail. cw file and set the name of the host on which the email server is used to send the email. You can use your domain name or host name.

# Sendmail. cw-include all aliases for your machine here.

Mydomain.com

Mail.mydomain.com

Ns.mydomain.com

3. access File

Localhost. localdomain RELAY

Localhost RELAY

127.0.0.1 RELAY

192.168.0 RELAY

A. B. c. d RELAY

Mydomain.com RELAY

Run the following command:

Makemap hash access. db <access

This file allows other machines in this domain to send emails through it.

Now it is complete. Restart sendmail for testing. In this linux system, adding a user will have an email address without special settings.

This article is not comprehensive. There are many omissions and you may encounter many problems. However, because sendmail is too complicated to write, please forgive me. If you have any questions, contact me and I will try my best to solve them.
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.