The test environment is a Aliyun Centos 5.4 32-bit system.
1, if installed SendMail, the first uninstall.
The code is as follows |
Copy Code |
Yum Remove SendMail
|
2, install Postfix
The code is as follows |
Copy Code |
Yum install Postfix
|
3, change the default MTA to Postfix:
The code is as follows |
Copy Code |
/usr/sbin/alternatives--set Mta/usr/sbin/sendmail.postfix
|
4, after the event, again check whether the MTA changed to Postfix:
The code is as follows |
Copy Code |
Alternatives--display MTA
|
5, configure Postfix,vi edit MAIN.CF
The code is as follows |
Copy Code |
Vi/etc/postfix/main.cf
|
After opening, find the following items, remove the # in front of it, and do the configuration:
The code is as follows |
Copy Code |
Myhostname = mail.wpdaxue.com MyDomain = wpdaxue.com Myorigin = $mydomain Inet_interfaces = All mydestination = $myhostname, localhost $mydomain, localhost, $mydomain Mynetworks = 192.168.100.10/28, 127.0.0.0/8 Relay_domains = Home_mailbox = maildir/
|
The above several settings are not in the same location, need to find separately, and make changes, where the corresponding domain name, please change their address, mynetworks I did not make changes, automatically have. I was also misconfigured at first to cause the installation to fail, and later found the answer in the @ Zhu Maohai Blog, which explains the meaning of these items from the website, thanks to the author.
Profile Explanation:
MyDomain:
mydomain parameter refers to the domain name of the email server, please ensure that the official domain name (such as CENTOS.BZ)
Myhostname:
The Myhostname parameter refers to the host name of the system (such as my server host name is mail.centos.bz)
Myorigin:
Myorigin parameter specifies the source of the local send message and the domain name to pass the display. In our example, MyDomain is centos.bz and my domain name.
for the following line, our mailing address is user@centos.bz instead of user@mail.centos.bz.
Myorigin = $mydomain
Mynetworks:
Mynetworks parameter specifies the list of trusted SMTP, specifically, trusted SMTP clients allow messages to be delivered through postfix. The
Mydestination:
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. The
Inet_interfaces:
inet_interfaces parameter sets the network interface so that postfix can receive messages.
Relay_domains:
This parameter is a list of the destination domain names that the system delivers 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, Detect and start postfix
The code is as follows |
Copy Code |
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 |
7, set boot up
The code is as follows |
Copy Code |
Chkconfig Postfix on
|
The end of my own installation is over, because all I need is the mail feature, not the mail server. At this point the test message is sent, OK.