In CentOS5.564bit, postfix + dovecot + sasl2 + webmail, mail authentication, and email account usageSystem user name.
The Simple Mail Server is not a professional set up of a complete enterprise mailbox. It is not installed on mailcharts, spam, and fprot! Including mysql authentication.
Environment:
CentOS5.564bit
Enterprise Domain Name monoedu.com
Mail.monoedu.com
Mail Server Name: mail.monoedu.com
Ip: 210.14.78.1 *
Note:DNSRequired. See other configuration documents.
1. Install Postfixsasl2dovecot
[Root @ mail ~] # Yuminstallpostfixcycus-sasl * dovecot
2. Configuration
[Root @ mail ~] # Vi/etc/postfix/main. cf
The modification content is as follows:
Myhostname = mail.monoedu.com
Mydomain = monoedu.com
Myorigin = $ mydomain
Inet_interfaces = all
Mydestination = $ myhostname, localhost. $ mydomain, localhost, $ mydomain,
Mail. $ mydomain,Www. $ mydomain,Ftp. $ mydomain
Mynetworks_style = subnet // specify the IP address of the whole network. These two parameter settings are very important (below)
Mynetworks = 127.0.0.0/8, localhost, 210.14.78.0/24 // generally, smtp is not used because no
Relay_domains = $ mydestination
Home_mailbox = Maildir // if the system account is used as the Mail User Name, this directory is the directory under the Account
Add at the end (sasl encryption algorithm supported)
Smtpd_sasl_auth_enable = yes
Smtpd_sasl_security_options = noanonymous
Broken_sasl_auth_clients = yes
Smtpd_recipient_restrictions = permit_sasl_authenticated, reject_unauth_destination, permit_mynetworks
Smtpd_client_restrictions = permit_sasl_authenticated
Select an available MTA from the command line
[Root @ mail ~] # Alternatives -- configmta
Thereare2programswhichprovide 'mta '.
SelectionCommand
-----------------------------------------------
* + 1/usr/sbin/sendmail. postfix
Entertokeepthecurrentselection [+], ortypeselectionnumber:1
[Root @ mail ~] #Vi/etc/sysconfig/saslauthd
SOCKETDIR =/var/run/saslauthd
MECH = shadow // use the system account for verification
[Root @ mail ~] # Vi/usr/lib/sasl2/smtpd. conf
Modify or add
Pwcheck_method: saslauthd
Mech_list: PLAINLOGIN
Log_level: 3
[Root @ mail ~] # Vi/etc/dovecot. conf
Modify or add
Protocols = imappop3pop3s
Listen = *
[Root @ mail ~] #/Etc/init. d/postfixstart | stop | restart
[Root @ mail ~] #/Etc/init. d/dovecotstart | stop | restart
[Root @ mail ~] #/Etc/init. d/saslauthdstart | stop | restart
3. Set auto-start upon startup
[Root @ mail ~] # Chkconfig-level345postfixon
[Root @ mail ~] # Chkconfig-level345dovecoton
[Root @ mail ~] # Chkconfig-level345saslauthdon
4. Add an account
(1) Create a system account first
[Root @ mail ~] # Useradd-s/bin/nologin-mtest
[Root @ mail ~] # Passwdtest //PasswordTest
(2) Add an email account
[Root @ mail ~] #/Usr/sbin/testsaslauthd-utest-ptest
The user name and password used in the preceding step. The system must have this user and the corresponding password; otherwise, an error will be reported.
Return Value:OK,Successd, Executed successfully.
5. foxmail Test
Add an account: pop3stmp must be set to the domain name address (mail.monoedu.com)
Finally, you can test the mail server through clients such as outlook and foxmail.