CentOS System install postfix replace SendMail step

Source: Internet
Author: User
Tags centos

Although said SendMail use is good, but for some reason I still like a fast and convenient mail sending server, very honored I found postfix, so I resolutely unloaded my dear SendMail used Postfix, remember the installation process as follows.
Install Postfix

There is an essential process before installation, uninstall SendMail, of course, if you have not installed before sendmail do not have to uninstall. Execute the command in the shell window:

Yum Remove SendMail

After the implementation of the uninstall SendMail, how is it convenient ah, and then we execute another command to install Postfix

Yum install Postfix

After the installation is complete, we also need to replace the default MTA SendMail with Postfix to perform

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

Then we execute the following code to start the configuration postfix


Vi/etc/postfix/main.cf

Press I to enter edit mode,? Content return lookup and modified to resemble the following. Note that the content is not in one place.
Myhostname = mail.cxsir.com
MyDomain = cxsir.com
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/

Then press ESC to exit edit, press shift+: Enter Wq save. After this, we need to check the boot postfix.


service Postfix status//detection, if started will list its PID, as follows:
Master (PID 25579) is running ...
If it is not started, execute the following command:
Service Postfix start

We also need to add postfix to boot.

Chkconfig Postfix on
After this we can happily use Postfix to send the mail. Of course, if you have not previously configured php.ini then we also need to modify php.ini sendmail. Perform:

Vi/etc/loca/php/etc/php.ini//change according to your path
Then find the edit Sendmail_path

Sendmail_path =/usr/sbin/sendmail-t-I.

Save and exit, and then restart PHP

/etc/init.d/php restart

Configuration resolution

MyDomain
MyDomain parameter refers to the email server's domain name, please ensure that the official domain name (cxsir.com)
Myhostname:
The Myhostname parameter refers to the host name of the system (such as my server host name is mail.cxsir.com)
Myorigin:
The Myorigin parameter specifies the name of the source and delivery display in the local send message. In our example, MyDomain is cxsir.com and my domain name.
For the following line, our email address is no_reply@cxsir.com instead of no_reply@mail.cxsir.com.
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.
Summary

This article is based on CentOS completion, other systems please do not try. If you need to install sendmial, you can search senmdial the blog sidebar to get sendmail installation tutorials.

Related Article

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.