The Linux system constructs the mail service, realizes to send and receive the mail function.

Source: Internet
Author: User
Tags imap dovecot

build Postfix mail system service
The e-mail system in the Internet is not an isolated system, it needs the DNS server to provide the resolution of the Mail domain, mail collection, delivery and other functions are provided by different components.
The role of the messaging system
MTA (mail transfer agent), commonly referred to as mail server software, is responsible for mail transfer, just like a courier company site. Server software such as Exchange,sendmail,postfix is part of the MTA
MUA (mail user agent), generally referred to as the client software, is the equivalent of the sender customer. MUA software commonly used in Windows includes Outlook Express,outlook,foxmail, and so on. Nua software commonly used in Linux systems includes thunderbird,kmail,evolution, etc.
MDA (mail Distribution Agent) Courier, now set up on the MTA, equivalent to courier company belongs to Courier.
Mail Communication Protocol
SMTP; Simple Mail Transfer Protocol, mainly used for sending and transmitting protocols. Port 25
POP: Post Office Protocol, mainly used to collect mail from mail server, port 110, currently the latest version is POP3
IMAP: Internet Message Access Protocol, also used to collect mail, Port protocol 143, the latest version is IMAP4.

Only the e-mail client and the server support both the SMTP,POP and IMAP protocols to enable complete mail sending and receiving functions

Commercial mail system
Exchange:windows system of the most famous mail service software, the company's internal mailbox system
Notes/domino: Commercial e-mail and Office collaboration software products produced by IBM

Open Source messaging System
Sendmail: The mail server running in the Unix/linux environment, the oldest, the stability is good, the security is poor.
Postfix: A mail server running in a unix/linux environment. Excellent performance in terms of delivery efficiency, stability, service performance and safety performance
Qmail: Another mail server running in the Unix/linux environment is more efficient than sendmail, and configuration management is more convenient.

This article mainly introduces the construction of Postfix and the related configuration. The redhat6.5 system is the experimental object.

1, the first need to build a DNS service, and modify the configuration file. Provides resolution of the mail domain.
Master configuration file,/etc/named.conf access port and Access host address log file location, etc.
TCP 53 Port is responsible for connecting to the DNS service
UDP 53 Port is responsible for resolving domain names
Zone profile/etc/named.rfc1912.zones define the domain name space, set forward parsing or reverse parsing, etc.
Zone Data Profile/var/named.localhost resolve address

1) Make sure the CD is mounted and install the BIND software package with the RPM command.

First modify the main configuration file/etc/named.conf, (modify the file using the VIM command)


Then modify the Zone profile/etc/named.rfc1912.zones define the domain name space and set the forward parsing mail domain.


To create and modify a DNS forward parsing file


Turn on the DNS service, turn off the firewall, turn off enhanced features, and test to see if the DNS service resolves the mail domain

The DNS service is built and can provide parsing services to the mail domain.

2, set up the Postfix service, the system has installed the software package and opened the service, we mainly modify its main configuration file and restart the service.
Master configuration file/etc/postfix/main.cf, where changes are required;
Inet_interfaces = ALL//The IP address of the listening service
Myhostname = mail.benet.com//mail server host name
Mydomain = benet.com//mail domain
Myorigin = $mydomain//sender address mail domain
Mydestination = $myhostname, $mydomain//recipient address mail domain
Home_mailbox = maildir///Mail storage location






Edit the/etc/hosts file (can be ignored), the IP and localhost correspondence to resolve the problem of not listening on the network card IP


Restart Postfix Service

3, build Dovecot service, install Dovecot software package with RPM,
To modify a configuration file (vim/etc/dovecot/dovecot.conf):
1), protocols = IMAP POP3 IMTP//Open protocol
2) Login_trusted_networks = 192.168.30.0/24//The network segment of the specified server


Modifying a child configuration file


Open Dovecot Service

Add two user mailboxes to test a user

Test sending messages in Linux

Receive mail

The Linux system constructs the mail service, realizes to send and receive the mail function.

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.