Configure the Mail service on the RHEL6 Server

Source: Internet
Author: User
There are three types of software for configuring the Mail server on the Mail server in linux: sendmail, postfix, and qmail. Use postfix to set up Mail Server 1: related Knowledge MUAmailuseragent The Mail User Agent is used by the client to send mails and read mails. MTAmailtranferagent the mail Transmission proxy server software is equivalent to a post office that receives mails sent by MUA. If it is not a local mail, send to the next M

Mail Server Configuration
There are about three types of software for configuring the mail server on linux servers: sendmail, postfix, and qmail.
The following code uses postfix to build an email server:
I. Related Knowledge
MUA mail user agent The mail user agent is used by the client to send and read emails.
MTA mail tranfer agent mail Transmission proxy server software, equivalent to a post office that receives the mail sent by MUA. If it is not a local mail, it is sent to the next MTA.
The MDA mail delivery agent delivers the email received by the MTA to the local account according to the email destination.

-------------- SMTP allows relay ----------
MTA Netease ---------- MTA Sina
| ----------------------------------------- |
| ------------------------------------------- |
| SMTP ----------------------------------- | MDA POP3
| ------------------------------------------- |
Abc@126.com ---------------------- efg@sina.com
Protocol:
Sender: zhangsan@126.com
Recipient: lisi@sina.com

Mail:
SMTP simple mail transfer protocol port: TCP 25
Smtps = smtp + ssl/tls port: 465

Receive email:
POP3 post office protocol, connect to MTA, read or download mail port: 110
Pop3s = pop3 + ssl/tls port: 995

IMAP internet message access protocal Network message access Protocol can download the mail header information before downloading the mail for the user to download the port number: 143
Imap3s = imap3 + ssl/tls port: 993


Ii. Software involved
(1) postfix
(2) povecot
# Yum install postfix povecot-y
#/Etc/init. d/postfix start ------- start

# Netstat-ntlup | grep: 25 ------- view the startup Port

Tcp 0 0 127.0.0.1: 25 0.0.0.0: * LISTEN 13999/master
Tcp 0 0: 1: 25: * LISTEN 13999/master

Or
# Lsof-I: 25
Command pid user fd type device size/OFF NODE NAME
Master 2993 root 12u IPv4 14370 0t0 TCP *: smtp (LISTEN)
Master 2993 root 13u IPv6 14372 0t0 TCP *: smtp (LISTEN)


3. Send an email
(1)

# Mail-s 'hello' root@36.web.com -- the s parameter is the definition topic
1111111111111111 -- mail body
. -- Point number indicates end
Cc: -- Cc. Here, I press enter to end the process.

(2)
# Mail a -- it also calls the mail command
Subject: hello
I am root
.
Cc: B

(3) view emails
# Cat/var/spool/mail/root
# Cat/var/mail/root

(4)
# Mail-s 'hello2' root@36.web.com </etc/fstab
-- Send the content of/etc/fstab as the body of the email.

(5)
# Telnet 127.0.0.1 25 -- verify port 25, that is, smtp protocol
Trying 127.0.0.1...
Connected to localhost. localdomain (127.0.0.1 ).
Escape character is '^]'.
220 li.cluster.com ESMTP Sendmail 8.13.8/8.13.8; Fri, 3 Sep 2010 10:31:00 + 0800
Helo abc -- Introduction, greeting (You Don't Have To Say hello directly to mail from)
250 li.cluster.com Hello localhost. localdomain [127.0.0.1], pleased to meet you
Mail from: abc@qq.com -- defines the sender, which is defined here
250 2.1.0 abc@qq.com... Sender OK
Rcpt to: root@rootbug.com -- defines the receiver, where it is the root user of the Local Machine
250 2.1.5 root@rootbug.com... Recipient OK
Data -- indicates that the email content is followed
354 Enter mail, end with "." on a line by itself
Test mail from qq.com -- mail body
. -- Point number indicates that the content has ended
250 2.0.0 o832V0tl004576 Message accepted for delivery
Quit -- quit
221 2.0.0 li.cluster.com closing connection

(6) send an email through mutt
# Yum install mutt-y
# Mutt user1@rootbug.com-use the root user to send emails to user1 users, and have the ability to send attachments
# Su-user1 -- switch the user to view the email

(7) you can install other software to send and receive emails, which will not be listed here.

For more details, please continue to read the content on page 1: Http://www.linuxidc.com/Linux/2013-10/91254p2.htm

Recommended reading:

RHCE-certified RHEL6 system installation, installation of VM Tools and configuration of YUM local source http://www.linuxidc.com/Linux/2013-10/91214.htm

Install and configure http://www.linuxidc.com/Linux/2013-10/91139.htm for Nagios under RHEL6

Ganglia installation configuration http://www.linuxidc.com/Linux/2013-10/91138.htm under RHEL6

RHEL6.4 changed to CentOS source http://www.linuxidc.com/Linux/2013-10/90932.htm

RHEL6 platform rpm installation MySQL database http://www.linuxidc.com/Linux/2013-09/90435.htm

RHEL6.4 configure the source http://www.linuxidc.com/Linux/2013-09/90192.htm for local yum

Introduction to RHEL6 server time task http://www.linuxidc.com/Linux/2013-09/89820.htm

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.