Install postfix on CentOS6 and set sasl

Source: Internet
Author: User

Install postfix on CentOS6 and set sasl

Postfix is a popular smtp server. The default port of the smtp server is 25 (ssl/tls encryption is not used ).
The following describes how to install postfix on CentOS6.

1. postfix is installed in CentOS6 by default. if the system does not have a postfix, run the following command to install it.

[root@mail ~]# yum -y install postfix

2. Configure main. cf of postfix and use sasl of dovecot for smtp-auth.

[Root @ mail ~] # Vi/etc/postfix/main. cf # Row 75th: remove the comment and set the host name. Myhostname = mail. opsky. top # Row 83rd: remove the comment and set the domain name. Mydomain = opsky. top # 99th rows: Remove comments. Myorigin = $ mydomain # Row 116th: inet_interfaces = all # Row 119th: If only ipv4 is used, set as follows. Inet_protocols = ipv4 # Row 164th: configure the domain name for receiving emails. Mydestination = $ myhostname, localhost. $ mydomain, localhost, $ mydomain # Line 264th: remove the comment and set the local network number segment. mynetworks = 127.0.0.0/8, 10.0.0.0/24 # Row 419th: remove the comment and use Maildir format. Home_mailbox = Maildir/# 571st rows: smtpd_banner = $ myhostname ESMTP # Add the following configuration to the end of the file # the size of an email is limited to 10Mmessage_size_limit = 10485760 # the size of one email is limited to 1Gmailbox_size_limit = 1073741824 # configure SMTP smtpd_sasl_type = dovecotsmtpd_sasl_path = private/authsmtpd_sasl_auth_enable = yessmtpd_sasl_security_options = Authorization = $ authorization = permit_mynetworks, permit_auth_destination, permit_sasl_authenticated, reject

After main. cf is configured, start postfix and set automatic start.

[root@mail ~]# /etc/rc.d/init.d/postfix start Starting postfix: [  OK  ][root@mail ~]# chkconfig postfix on

3. If iptables is enabled, set iptables to open port 25 of smtp.

[root@dlp ~]# iptables -I INPUT 5 -p tcp -m state --state NEW -m tcp --dport 25 -j ACCEPT 

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.