Configure the postfix email system in fedora7

Source: Internet
Author: User
Configure the postfix email system under fedora7-Linux Enterprise Application-Linux server application information. For details, see the following. What is MUA, MTA, MDA, and how to deliver a letter

MUA (Mail User Agent): software used by the User's computer to receive and send messages, such as Outlook Express

MDA (Mail Delivery Agent): distributes the messages received by the MTA to the email boxes of each account.

MTA (Mail Transfer Agent): MTA is the Mail server, which is used to send emails to users. The message sent and received by users must be sent through MTA!

Main functions:

1. send the mail to be sent by the user: the MTA first identifies the internal or external mail to be sent by the user, and the internal mail is forwarded to the recipient's mailbox (mailbox ), an external email is sent to the destination MTA.

2. receive emails from external hosts: all accounts above the MTA will be received.

3. Ask the user to recall his/her email: the user can send the email host's email to MUA and receive it on his/her computer.

After learning about MUA, MTA, and MDA, let's take a look at the mail sending process.

Step 1. The sender uses MUA to send messages to the MTA.

Step2. the local MTA will collect its own mail and send it to the mail box of the account by MDA.

Step3. forward external emails.

Step 4. The remote MTA receives messages from the local MTA.

Step 5. Send the remote MTA to the email box sent by MDA to the account, waiting for the user to download.

Step6. the recipient uses MUA to collect the mail.

Ii. communication protocols used

1. mail: Most mail hosts use the SMTP protocol, port number is 25, and MUA uses the SMTP protocol to connect to the MTA to send the mail.

2. External mail transfer: the local MTA can communicate with the destination MTA through the SMTP protocol.

3. receive mail: The most common protocol for receiving mail is the POP3 protocol, and the port number is 110. Therefore, MUA uses the POP3 protocol to connect to the MTA mail box to read mail.

Knowledge about Relay and Authentication Mechanism
In step 3 of the above mail sending process, after the MTA analyzes the received mail, if it is not the account of the host itself, the mail will be sent to the target MTA host. So anyone can send emails through your host, so that your host will become slow and slow, and your network bandwidth will be filled with advertising messages! This type of host is called the "Open Relay" email host, which will soon be rejected by other MTA hosts!

To avoid this problem, we must only enable the Relay function for our own host (localhost). In this way, the MTA will only accept emails from the Internet indicating that the recipient is an internal account of our host, however, after Relay is disabled, although the MTA host can be used as an advertising message sending site, this will cause some troubles. How can this problem be solved? Because we usually only open the Relay function to the host or some standard IP addresses, but there is no open IP address, there is no way to send a message, if you are a salesman or often have to go on a business trip in different places, there is no way to use it, so at this time there will be an "email authentication mechanism" to help us solve this problem.

The email authentication mechanism is to check the sender's account and password in the MTA. The common mail authentication is SMTP mail authentication, which is a mechanism of hands-on SMTP, that is, when sending a mail, from MUA to MTA, the MTA host will check the account and password of the MUA sender. After successful authentication, the sender is allowed to send emails, so that the sender can send emails anywhere.

Si, installation kit

Install the required kits cyrus-sasl, dovecot, and postfix in Fedora Core 2.

1. installation and configuration of cyrus-sasl:
1. Check whether cyrus-sasl is installed:
# Rpm? Qa | grep cyrus-sasl
Cyrus-sasl-2.1.18-2

2. Modify smtpd. conf settings
# Vi/usr/lib/sasl2/smtpd. conf
Change content
Pwcheck_method: saslauthd
Mech_list: plain login

3. Restart sasl daemon and test the verification function.
#/Etc/init. d/saslauthd restart
#/Usr/sbin/testsaslauthd? U account? P' password'
0: OK "Success ."

2. Install and set dovecot (imap and pop3:
1. Check whether dovecot is installed
# Rpm? Qa | grep dovecot
Dovecot-0.99.10.5-0.FC2

2. Set pop3 and imap to receive emails.
# Vi/etc/dovecot. conf
Protocols = pop3 imap

3. Restart and Test
#/Etc/init. d/dovecot restart

# Telnet to localhost 110
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
+ OK dovecot ready.
User Account
+ OK
Pass password
+ OK Logged in.

3. Install and set postfix:
1. Check whether postfix is installed.
# Rpm-qa | grep postfix
Postfix-2.0.18-4

2. Add the postfix to the root permission.
# Usermod-G root postfix

3. Modify smtpd. conf settings
# Vi/etc/postfix/main. cf
Only localhost relay is commented out.
# Inet_interfaces = localhost

Modify the accepted destination location
Mydestination = $ myhostname, localhost. $ mydomain, $ mydomain

Add sasl email Authentication
Smtpd_sasl_auth_enable = yes
Smtpd_delay_reject = yes
Smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated
Permit_auth_destination reject
Smtpd_client_restrictions = permit_mynetworks, permit_sasl_authenticated
Broken_sasl_auth_clients = yes
Smtpd_sasl_security_options = noanonymous

4. Disable sendmail and start postfix
#/Etc/init. d/sendmail stop
#/Etc/init. d/postfix start

5. Add postfix to the started service
# Chkconfig -- add postfix

6. Start ntsysv and replace sendmail with postfix, so that the system will have a postfix when it is restarted, instead of sendmail.
# Ntsysv

7. Test whether sasl email authentication is enabled
The test method is also telnet. Use the telnet command to connect to the Postfix host. Run the following command:
# Telnet localhost 25
Enter the following commands:
Ehlo localhost

Pay attention to the message returned by Postfix. If your settings are correct, a message similar to the following should be displayed:
250-master.planetnet.net
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-AUTH LOGIN PLAIN

250-AUTH = LOGIN PLAIN

250-XVERP
250 8 BITMIME

The two most important lines show the authentication protocols currently supported by the Postfix System in rows 6 and 7. If these two lines are displayed in the result, your Postfix can be authenticated using SASL.
 
4. Test whether your Outlook Express can send and receive emails normally.
Check "my servers need verification! In this way, the mail can be sent smoothly.

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.