Postfix email service configuration and application 1

Source: Internet
Author: User
Postfix email service configuration and application 1-Linux Enterprise Application-Linux server application information. The following is a detailed description. The email service is based on the c/s mode. For a complete email system, it consists of three parts: User proxy, email server, and email protocol. Currently, the main protocols used are SMTP, POP3, and IMAP4. POP3 and IMAP4 are used to receive emails. We can regard IMAP4 as a remote file server, and POP as a storage forwarding server.
Mainstream email servers include sendmail, postfix, and Qmail. Among them, sendmail is a very good mail server software, but its security is poor, and the postfix security is better, it can also maintain compatibility with sendmail to meet users' usage habits.
Install the postfix email server
By default, sendmail is installed in the OS. To use postfix, you must stop the sendmail service. Use netstat-nutlp | grep: 25 to check the existence of port 25. If yes, you must disable the sendmail service and enable the Automatic startup command as follows:
/Etc/rc. d/init. d/sendmail stop
Chkconfig sendmail off
Install the postfix service rpm-ivh postfix... rpm
Postfix email server configuration
The most commendable aspect of postfix is its high readability. Its main configuration file is/etc/postfix/main. cf although the configuration file contains a lot of content, most of the content is annotated and there are not many self-defined parameters. Even if these parameters are not defined, they can be run by default, however, it only listens to the 127 interface for sending and receiving mails.
1. Set the mail host name and domain name for running the postfix Service
Myhostname = mail.163.com
Mydomain = 163.com
2. Set the domain name or Host Name of the mail sent by the Local Machine
Myorigin = $ mydomain
Myorigin = $ myhostname
3. The network interface for setting postfix Service Listening is usually to open all network interfaces to receive emails from any network interfaces. Inet_interfaces = all
4. Set the host name or domain name for receiving emails
Mydestination = $ mydomain, $ myhostname
5. set which network emails can be forwarded (Relay)
Mynetworks = 192.168.1.0/24,127.0 .0.1/8
Note: In addition to mynetworks, mynetworks-style is also a parameter used to control network mail forwarding. It is mainly used to set the network type of convertible mail. There are usually three methods.
Class: in this way, the postfix automatically learns the IP address type of the email host.
Subnet: This is the default value of postfix. postfix will know the ip network segment to be opened based on the ip address and subnet mask set on the network interface of the mail host.
Host: In this mode, postfix only opens the local machine.
Generally, you do not set the mynetworks-style parameter, but directly set the mynetworks parameter. If both parameters are set, the mynetworks parameter settings are valid.
6. set which domains can be forwarded for mail
The mynetworks parameter is set for the IP address of the mail source, while the relay_domains parameter is set for the domain name or Host Name of the mail source. Relay_domains = 163.com indicates that any emails sent from the domain 163.com will be considered trusted, and postfix will be automatically forwarded.
After completing the above basic settings, restart the postfix service. This mail host is basically ready. However, it currently only supports sending from the client, and does not support receiving.
In addition, DNS must be configured to enable it to transfer emails in the internal network of the Organization.
When the postfix master configuration file/etc/postfix/main is edited. to facilitate debugging, you can run the/usr/sbin/postconf command to directly read all types of data in the file without opening the file.
Postconf-n

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.