Linux Network services --Postfix mail System (i)
Messaging System Overview
1.MTA(mail Transferagent) Mail Transfer agent
commonly referred to as mail server software. the MTA software is responsible for receiving messages sent by the client software and transferring the messages to other MTA programs, which are a core part of the e-mail system. Common MTA Software has the Windows system for Exchange and Linux Sendmail,Postfix , etc. under the system .
2,MUA(Mail user agent) mail users Agent
commonly referred to as mail client software. MUAsoftware features provide users with an interface for sending, receiving, and managing e-mail. In theWindowscommon in the platformMUASoftware includesOutlook Express,Outlook,Foxmailand so on. In theLinuxcommon in the platformMUASoftware includesThunderbird,Kmail,Evolutionand so on.
3,MDA(mail Deliveryagent) mail Distribution Agent
The MDA software is responsible for distributing messages to the user's mailbox directory in the server. MDA software is relatively special, it does not directly face the mail user, but the background silently work. Sometimes The MDA function can be directly integrated in the MTA software, so it is often ignored.
Mail Communication Protocol
1.SMTP(Simple MailTransfer Protocol) Easy message Transfer Protocol
The SMTP protocol uses the TCP port number
used primarily for sending and transmitting messages. the MUA uses the SMTP protocol to send messages to the MTA Server, and the MTA transmits the messages to other MTA server is also used SMTP agreement.
2.POP(Post Office Protocol) Post Office Protocol
The TCP port number used by the POP3 protocol is
primarily used to collect mail from the mail server. Currently , the latest version of the POP protocol is POP3.
3.IMAP(internetMessage Access Protocol) Internet Messaging Access Protocol
The TCP port number used by the IMAP4 protocol is 143
with the POP is also used to receive mail, compared to the IMAP4 Protocol provides more flexible and powerful mail collection, mail management functions. The current version of the IMAP protocol is IMAP4.
iii. Common mail server Software
1. Commercial mail system:Exchange,notes/domino , etc.
The Postfix is developed by Wietse and is designed to provide a better alternative to Sendmail. Postfix has a remarkable performance in delivery efficiency, stability, service performance and safety.
,Postfix compiled installation and service control
1.Postfix mail Server overview
The Postfix Mail server uses a modular design, which is made up of a number of different programs that are used to implement different functions. Postfix starts with a process called master , which is handled by the master process, and automatically load other programs as needed to work together.
2. Compile and install and service control
SOURCE Package postfix-2.11.7.tar.gz
(1) compile and install
1> Environment Preparation
Configuration DNS Domain Name resolution server (detailed process, configuration list below)
Set the default DNS Server
Uninstalling the system default installation of Postfix
Confirm The installation package required for Cyrus certification
2> confirm postfix Mail Service installation required users and groups (if you have previously installed postfix, there is no need to establish)
if the above groups and users do not exist, they must be established in advance .
[Email protected] ~]# groupadd-g Postdrop
[Email protected] ~]# groupadd-g postfix
[Email protected] ~]# useradd-m-u 1000-g postfix-g postdrop-s/sbin/nologin postfix
Source Package Installation Postfix
Where: Compilation parameters The roles of Ccargs and auxlibs are as follows:
Ccargs: Provides additional extension parameters for the compiler, for example: Enable SASL authentication. and refers to the CYRUS_SASL certification program's header file located in /USR/INCLUDE/SASL
Auxlibs: indicates to the compiler that an additional library of functions is located outside of the standard location.
[email protected]mail postfix-2.11.7]# make makefiles ' Ccargs=-duse_sasl_auth-duse_ Cyrus_sasl-i/usr/include/sasl ' AUXLIBS=-L/USR/LIB64/SASL2-LSASL2 ' && make && make install
View The authentication methods supported by the Postfix service
Start the service and view
2> main directory:
/etc/postfix: Includes The main configuration file of Postfix service, various kinds of scripts, query tables, etc.
/usr/libexec/postfix/: each server program file including the Postfix service
/var/spool/postfix/: Includes sub-directories related to the mail queue of the postfix Service, each team list directory because of the different messages saved
Incoming(incoming): Store the message you just received
Active(Active): Store messages that are being posted
Deferred(deferred): Store messages that failed to post previously
hold (Constraint): Stores messages that are blocked from being sent
Corrupt(Error): Storing unreadable or non-parsed messages
/usr/sbin/: Includes Various administrative tools for the Postfix service, these program file names begin with post
Postalias: Constructing, modifying, and querying alias tables
postconf: Displaying and editing the main.cf configuration file
Postfix: Start, stop Postfix Mail Service, require root user Rights
Postmap: Constructs, modifies, or queries a table file (a file that records mappings such as aliases)
Postqueue: View message queues, which are also available to general users
Postsuper: Managing message queues, requiring root user Rights
/usr/sbin/post*: Execute script
/var/log/maillog: Log file
3> Thin mail.conf Configuration Items
postconf: View all currently enabled configurations
Postconf-n: List only configurations that use non-default values
Inet_interfaces = 192.168.6.106, 127.0.0.1// Listening service IP, default is all
Myhostname = host name of mail.benet.com//mail server
MyDomain = benet.com// mail domain
Myorigin = mail field in the sender's address when $mydomain//outgoing messages
Mydestination = $mydomain, $myhostname// Allow Posting to local destination mail domain
Home_mailbox = maildir/// Set message storage location and format
Add Mail user account
send a message test using SMTP source code
To see if the message was sent successfully
Pop/imap receiving service
1.dovecot receiving service Overview
Pop3/imap Server Software, the impact of fast and good scalability. dovecot By default also uses Linux system users, and through the PAM mechanism for identity authentication, Users are allowed to receive mail only after they have passed the certification.
2. Compile and install the dovecot Package dovecot-2.0.21.tar.gz
1> Create service run user
[Email protected] ~]# useradd-m-s/sbin/nologin dovecot
[Email protected] ~]# useradd-m-s/sbin/nologin dovenull
2> Source Package compilation Installation
Create a configuration file and start the service
Add PAM Authentication Function
start the dovecot service
POP3 receiving mail test
Use Outlook Beta
Tools -Account Settings-new-Manually configure server settings or other server types
Linux Network Service 07--postfix mail system