RedHat + Postfix + Cyrus-sasl + Dovecot + Stunnel check for installation: rpm-qa | greppostfixrpm-qa | grepcyrus & nb
RedHat + Postfix + Cyrus-sasl + Dovecot + Stunnel
Check for installation:
Rpm-qa | grep postfix
Rpm-qa | grep cyrus
Rpm-qa | grep dovecot
Rpm-qa | grep stunnel
If not, you can install it from the system disk.
Generally, sendmail is automatically installed in the system, so you must disable or uninstall the service first.
/Etc/init. d/postfix stop // close the service
Rpm-e sendmail // uninstall
Disable sendmail
Chkconfig sendmail off
Enable Cyrus-sasl for password verification
/Etc/init. d/saslauthd start
Chkconfig saslauthd on
Test:
Testsaslauthd-u username-p password prompt succcess indicates the test is successful
Configure SMTP
Vi/etc/postfix/main. cf
Edit the following lines in the file:
Alias_database = hash:/etc/aliases
Alias_maps = hash:/etc/aliases
Command_directory =/usr/sbin
Config_directory =/etc/postfix
Daemon_directory =/usr/libexec/postfix
Debug_peer_level = 2
Header_checks = regexp:/etc/postfix/header_checks
Html_directory = no
Mailbox_size_limit = 102400000
Mailq_path =/usr/bin/mailq. postfix
Manpage_directory =/usr/share/man
Mydomain = Domain Name
Mydestination = $ myhostname, localhost. $ mydomain, localhost, $ mydomain
Myhostname = mail. Domain Name
Mynetworks = 192.168.1.0/24,127.0 .0.0/8, 192.168.1.100/32
Myorigin = $ mydomain
Newaliases_path =/usr/bin/newaliases. postfix
Readme_directory =/usr/share/doc/postfix-1.1.11/README_FILES
Relay_domains = nanoconcept.net
Sample_directory =/usr/share/doc/postfixed-1.1.11/samples
Sendmail_path =/usr/sbin/sendmail. postfix
Setgid_group = postdrop
By default, the SMTP authentication mechanism is not configured in the postfix configuration file. Therefore, you must add the following content in main. cf to implement SMTP authentication:
Smtpd_sasl_auth_enable = yes # user authentication is required for this smtp
Smtpd_sasl_local_domain =''
Export = export permit_auth_destination permit_mynetworks check_relay_domain reject_rbl_client yahoo.com.tw reject_rbl_client cbl.anti-spam.org.cn reject_rbl_client cdl.anti-spam.org.cn into your own reject
Broken_sasl_auth_clients = yes
Smtpd_client_restrictions = permit_sasl_authenticated
Smtpd_sasl_security_options = noanonymous # reject all anonymous authentication
Unknown_local_recipient_reject_code = 550
Note:
1) mydomain
Specify your domain name:
Mydomain = xx.com
2) myorigin
The myorigin parameter specifies the domain name of the sender:
Myorigin = $ mydomain
3) inet_interfaces
Inet_interfaces = all listen to all ports
4) mydestination
The mydestination parameter specifies the Domain Name of the recipient when the postfix receives the mail:
Mydestination = $ mydomain
5) mynetworks_style
Set the network type:
Mynetworks_style = subnet
6) mynetworks
Define the Client IP address that can be used to send emails to this smtp server:
Mynetworks = 192.168.1.0/24
Note: It can also be set to 10.10.1.0 ~ 10.10.1.9, 10.10.3.0 ~ 10.10.3.9
Enable postfix
/Etc/init. d/postfix start
Once the Postfix service is successfully started, you can view port 25 through netstat-ntl | grep 25
Chkconfig postfix on
After the service is enabled successfully, you can send an email through the client.
Pop3 Service
Pop3 is an email service that can be directly enabled without special requirements or configuration.
/Etc/init. d/dovecot start
You can check whether port 110 is enabled through netstat-ntl.
The Stunnel function implements port encryption. By default, the configuration file encrypts smtp and pop3 ports, so you do not need to configure it to directly enable its service:
/Etc/init. d/stunnel start