Details about installing the mail system Postfix + CyrusSASL + dovecot in RHEL5

Source: Internet
Author: User
Tags dovecot
By default, RHEL5 is installed without selecting any types of servers (such as WEB servers, development servers, and virtual servers) to install postfix [root @ rhel5 ~] #/Etc/rc. d/init. d/sendmailstop close sm-client: [OK] Disable sendmail: [OK] [root @ rhel5 ~] # Chkconfigsendmailoff [root @ rhel5Server] # RHEL5 is installed in rpm-I by default, and no type of server is selected (such as WEB server, development server, and virtual server)

Install postfix

[Root @ rhel5 ~] #/Etc/rc. d/init. d/sendmail stop

Close sm-client: [OK]

Disable sendmail: [OK]

[Root @ rhel5 ~] # Chkconfig sendmail off

[Root @ rhel5 Server] # rpm-ivh postfix-2.3.3-2.i386.rpm

[Root @ rhel5 Server] # vi/etc/postfix/main. cf

Myhostname = mail.mailidc.cn # Set the Host Name and domain name of the email host running the postfix Service

Mydomain = mailidc.cn

Myorigin = $ mydomain # Set the domain name or Host Name of the mail sent by the Local Machine

Inet_interfaces = all # Set the network interface of the postfix service listener

Mydestination = $ myhostname, $ mydomain, localhost. $ mydomain, localhost # Set the host name or domain name for receiving emails

Mynetworks = 127.0.0.1 # sets which network mails can be forwarded

Relay_domains = $ mydestination # sets which domains can forward emails

Save the file.

Check the postfix Configuration:

[Root @ rhel5 Server] # postconf-n

[Root @ rhel5 ~] # Chkconfig postfix on

Add postfix to the root group:

# Usermod-G root postfix

SMTP authentication Configuration

Install cyrus-sasl

1. Check whether cyrus-sasl is installed.

[Root @ rhel5 Server] # rpm-qa | grep cyrus

Cyrus-sasl-plain-2.1.22-4

Cyrus-sasl-lib-2.1.22-4

Cyrus-sasl-2.1.22-4

Password Verification Mechanism Of Cyrus-SASL V2

[Root @ rhel5 ~] # Saslauthd-v

Saslauthd 2.1.22

Authentication mechanisms: getpwent implements os5 pam rimap shadow ldap

We are going to use the password verification mechanism of shadow.

Vi/etc/sysconfig/saslauthd

MECH = shadow

Start daemon of sasl and test:

# Service saslauthd start

#/Usr/sbin/testsaslauthd-u account-p 'Password'

0: OK "Success." => the account has been verified successfully.

[Root @ rhel5 ~] # Chkconfig saslauthd on

Set postfix to enable SMTP authentication

[Root @ rhel5 Server] # vi/etc/postfix/main. cf

Smtpd_sasl_auth_enable = yes

Smtpd_sasl_local_domain =''

Smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated,

Reject_unauth_destination

Broken_sasl_auth_clients = yes

Smtpd_client_restrictions = permit_sasl_authenticated

Smtpd_sasl_security_options = noanonymous

Wq! Save


In addition, when postfix requires SMTP authentication, it will read/usr/lib/sasl2/smtpd. the content of the conf file is used to determine the authentication method used. Therefore, the/usr/lib/sasl2/smtpd must be ensured. the content of the conf file is:

Pwcheck_method: saslauthd
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.