LNMP installation Postfix Steps Tutorial Detailed

Source: Internet
Author: User
Tags mx record

LNMP A key package is my most commonly used environment configuration, the use of more people, encountered problems Baidu is easier. The default LNMP installed is the SendMail component, but SendMail letter is really very slow, especially in the domestic VPS installation more slowly, Ali Tencent I have tried really slow and slow (do not know why ...), so more recommended to install Postfix, It's much faster than SendMail.


This record refers to the host operating system for CentOS, the installation environment for the military brother Lnmp a key package.

1. Uninstall SendMail


Yum Remove SendMail

2. Install Postfix


Yum install Postfix

3. Change default MTA to Postfix


/usr/sbin/alternatives--set Mta/usr/sbin/sendmail.postfix

4. Check to see if the change was successful


Alternatives--display MTA

5. Configure Postfix


Vi/etc/postfix/main.cf

After the open to find the following items, note that these items are not in the same position, to be found to modify each, the front of the # removed, and do configure:

Myhostname = Mail.zrblog.net
MyDomain = Zrblog.net
Myorigin = $mydomain
Inet_interfaces = All
mydestination = $myhostname, localhost $mydomain, localhost, $mydomain
Mynetworks = 192.168.100.10/24, 127.0.0.0/8
Relay_domains =
Home_mailbox = maildir/

Configuration file Explanation:

MyDomain
MyDomain parameter refers to the email server's domain name, please ensure that the official domain name (such as Zrblog.net)
Myhostname:
The Myhostname parameter refers to the host name of the system (such as my server host name is mail.zrblog.net)
Myorigin:
The Myorigin parameter specifies the name of the source and delivery display in the local send message. In our example, MyDomain is zrblog.net and my domain name.
For the following line, our email address is user@zrblog.net instead of user@mail.zrblog.net.
Myorigin = $mydomain
Mynetworks:
The Mynetworks parameter specifies the list of trusted SMTP, specifically, that trusted SMTP clients allow messages to be delivered through postfix.
Mydestination:
The mydestination parameter specifies which mail addresses allow messages to be sent locally. This is a group of trusted IP addresses that allow messages to be sent or delivered through the server. A user attempts to send a message to the original server that has not been listed at this location.
Inet_interfaces:
The inet_interfaces parameter sets the network interface so that postfix can receive messages.
Relay_domains:
This parameter is the list of destination domain names that the system passes messages to. If left blank, we guarantee that our mail server is not open to untrusted networks.
Home_mailbox:
This parameter sets the mailbox path to be related to the user directory, or you can specify the mailbox style to use.

6. Start Postfix


[Root@zrblog ~]# service postfix status #检查状态
Master is stopped
[Root@zrblog ~]# service postfix start #启动
starting Postfix:
[OK]
7. Set Boot up

Chkconfig Postfix on

8. Add resolution records to avoid spam

Add a record of mail, a @ MX record and TXT record to avoid direct mail entry into the Inbox bin.

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.