Sendmail server configuration in RHEL5.7

Source: Internet
Author: User
E-mail is the most commonly used on the Internet, and many enterprise users often use free email systems. As a free mail server software, Sendmail has been widely used in a variety of servers. It has certain characteristics in terms of stability, portability, and bug-free. Sendmail is the most important mail transmission agent. Understanding the working mode of email is very important. Generally, the email program is divided into user agents, transmission agents, and delivery agents. The user agent is used to receive user instructions and

E-mail is the most commonly used on the Internet, and many enterprise users often use free email systems. As a free mail server software, Sendmail has been widely used in a variety of servers. It has certain characteristics in terms of stability, portability, and bug-free. Sendmail is the most important mail transmission agent. Understanding the working mode of email is very important. Generally, the email program is divided into user agents, transmission agents, and delivery agents. The user agent is used to receive user instructions and send users' emails to the mail Transmission proxy, such as outlook express and foxmail. The shipping agent obtains the mail from the mail transmission agent and sends it to the end user's mailbox, for example, procmail.
Now let's take a look at how the sendmail mail server is configured.
1. Check whether the software package is installed
Rpm-q sendmail
Rpm-q m4
Rpm-q sendmail. cf
2. Configure the DNS domain name of the email server
IN the previous DNS server configuration, there is a domain name format specifically used for the mail server, that is, in mx. You can set DNS and mail to the same server, and set the Domain Name of the email server in the DNS configuration file. In this example, the IP addresses of the DNS server and email server are 192.168.10.1.
Edit the original hujw.com. zone forward parsing file and add two records

Edit the original hujw.com. rev reverse resolution file and add a record

Restart the named Server
Service named restart 
Test the resolution result. The email server domain name can be resolved normally.
 
3. Configure the sendmail server configuration file 
Next, let's take a look at the configuration process of sendmail. The configuration files of sendmail are stored in the/etc/mail directory.
There are several main files in this directory:
Sendmail. cfThe main configuration file of sendmail, which is difficult to configure, is not recommended. Make the following description at the beginning of the sendmail. cf file: (do not configure this file. You can only edit sendmail. mc) 
Sendmail. mcA relatively simple configuration file. After modification, use the m4 command to generate a new sendmail. rf file.
First, modify the content of the sendmail. mc file:
Vi sendmail. mc 
Search for "127.0.0.1" and change it to 0.0.0.0. Otherwise, you can only enable SMTP listening locally. 0.0.0.0 is equivalent to enabling listening on all local addresses.
 
Search for "TRUST" and delete the dnl and space. Otherwise, smtp authentication cannot be enabled. Without smtp authentication, you can log on to your mailbox without an account or password. The security of your mailbox is not guaranteed.
 
Modify the access file under/etc/mail and add the CIDR block that allows sending and receiving emails.
 
After saving, hash the file to generate a new access. db file.
Makemap hash access. db <access 
Then modify the local-host-names and add hujw.com to make the domain hujw.com as the email server.
 
Use the m4 command to generate a new sendmail. rf File
M4 sendmail. mc> sendmail. cf 
Create two users
Useradd mailtest1
Passwd mailtest1
Useradd mailtest2-s/sbin/nologin
Passwd mailtest2 
The difference between mailtest1 and mailtest2 is that mailtest1 can log on to the system, while mailtest2 cannot log on to the system. Therefore, when creating a user, you can determine whether the user can log on to the system.

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.