[root@student24 Server]# ls | grep postfix
postfix-2.3.3-2.1.el5_2.i386.rpm
postfix-pflogsumm-2.3.3-2.1.el5_2.i386.rpm
[root@student24 Server]# rpm -ivhpostfix-2.3.3-2.1.el5_2.i386.rpm
Preparing...########################################### [100%]
1:postfix########################################### [100%]
[root@student24 postfix]# vi/etc/postfix/main.cf
69myhostname = mail.vfast.com
70 #myhostname =virtual.domain.tld
71
72 # The mydomainparameter specifies the local internet domain name.
73 # The default isto use $myhostname minus the first component.
74 # $mydomain isused as a default value for many other configuration
75 # parameters.
76 #
77 mydomain =vfast.com
78
79 # SENDING MAIL
80 #
81 # The myoriginparameter specifies the domain that locally-posted
82 # mail appears tocome from. The default is to append $myhostname,
83 # which is finefor small sites.If you run a domainwith multiple
84 # machines, youshould (1) change this to $mydomain and (2) set up
85 # a domain-widealias database that aliases each user to
86 #user@that.users.mailhost.
87 #
88 # For the sake ofconsistency between sender and recipient addresses,
89 # myorigin alsospecifies the default domain name that is appended
90 # to recipientaddresses that have no @domain part.
91 #
92 myorigin =$myhostname
93 #myorigin =$mydomain
94
95 # RECEIVING MAIL
96
97 # Theinet_interfaces parameter specifies the network interface
98 # addresses thatthis mail system receives mail on.Bydefault,
99 # the softwareclaims all active interfaces on the machine. The
100 # parameter also controls delivery of mail touser@[ip.address].
101 #
102 # See also the proxy_interfaces parameter, for networkaddresses that
103 # are forwarded to us via a proxy or network addresstranslator.
104 #
105 # Note: you need to stop/start Postfix when thisparameter changes.
106 #
107 inet_interfaces = all
108 #inet_interfaces = $myhostname
109 #inet_interfaces = $myhostname, localhost
110# inet_interfaces = localhost
………..
155 mydestination = $myhostname, localhost.$mydomain,localhost
156 #mydestination = $myhostname, localhost.$mydomain,localhost, $mydomain
157 #mydestination = $myhostname, localhost.$mydomain, localhost,$mydomain,
158 #mail.$mydomain, www.$mydomain, ftp.$mydomain
……..
255mynetworks= 192.168.1.0/29, 127.0.0.0/8
256 #mynetworks = $config_directory/mynetworks
257 #mynetworks = hash:/etc/postfix/network_table
…….
287 relay_domains = vfast.com
288
289 # INTERNET OR INTRANET
…..
667 readme_directory =/usr/share/doc/postfix-2.3.3/README_FILES
668 virtual_alias_maps = hash:/etc/postfix/virtual
669 virtual_alias_domains = sian.com, ex.com
[root@student24 Server]# rpm -ivhcyrus-sasl-2.1.22-5.el5_4.3.i386.rpm
[root@student24 Server]# saslauthd -v
saslauthd 2.1.22
authentication mechanisms: getpwent kerberos5 pam rimapshadow ldap
[root@student24 Server]# vim /etc/sysconfig/saslauthd
# Mechanism to use when checking passwords.Run "saslauthd -v" to get a list
# of which mechanism your installation was compiled withthe ablity to use.
MECH=shadow
…..
[root@student24 Server]# service saslauthd start
启动saslauthd:[确定]
[root@student24 Server]# chkconfig --level 135 saslauthd on
[root@student24 Server]# useradd jj
[root@student24 Server]# passwd jj
[root@student24 Server]# testsaslauthd -u jj -p '123456'
0: OK "Success."
[root@student24 Server]# vim /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
telnet 127.0.0.1 25
ehlo 127.0.0.1
250-mail.vfast.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
[root@student24 Server]# rpm -ivhperl-DBI-1.52-2.el5.i386.rpm
[root@student24 Server]# rpm -ivhmysql-5.0.77-4.el5_4.2.i386.rpm
[root@student24 Server]# rpm -ivhdovecot-1.0.7-7.el5.i386.rpm
[root@student24 Server]# vim /etc/dovecot.conf
28 # these settingsinside the protocol imap/pop3 { ... } section, so you can
29 # specifydifferent ports for IMAP/POP3. For example:
30 #protocol imap {
31 #listen = *:10143
32 #ssl_listen = *:10943
33 #..
34 #}
35protocol pop3 {
36listen = *:10100
37 #..
38}
39 #listen = [::]
[root@student24 Server]# service dovecot start
启动Dovecot Imap:[确定]
[root@student24 Server]# chkconfig --level 135 dovecot on
Cyrus-imaod服务的实现
[root@student24 Server]# rpm -ivhcyrus-imapd-perl-2.3.7-7.el5_4.3.i386.rpm
Preparing...########################################### [100%]
1:cyrus-imapd-perl########################################### [100%]
[root@student24 Server]# rpm -ivhcyrus-imapd-utils-2.3.7-7.el5_4.3.i386.rpm
Preparing...########################################### [100%]
1:cyrus-imapd-utils########################################### [100%]
[root@student24 Server]# rpm -ivhdb4-utils-4.3.29-10.el5.i386.rpm
Preparing...########################################### [100%]
1:db4-utils###########################################[100%]
[root@student24 Server]# rpm -ivhlm_sensors-2.10.7-9.el5.i386.rpm
Preparing...########################################### [100%]
1:lm_sensors########################################### [100%]
[root@student24 Server]# rpm -ivhcyrus-imapd-2.3.7-7.el5_4.3.i386.rpm
Preparing...########################################### [100%]
1:cyrus-imapd########################################### [100%]
[root@student24 Server]# rpm -ivhcyrus-imapd-devel-2.3.7-7.el5_4.3.i386.rpm
Preparing...########################################### [100%]
1:cyrus-imapd-devel########################################### [100%]
[root@student24 Server]# vim /etc/postfix/main.cf
mailbox_transport= lmtp:unix:/var/lib/imap/socket/lmtp
[root@student24 Server]# service cyrus-imapd start
导入cyrus-imapd 数据库:[确定]
启动cyrus-imapd:[确定]
[root@student24 Server]# chkconfig --level 35cyrus-imapd on
[root@student24 Server]# passwd cyrus
Changing password for user cyrus.
New UNIX password:123456
BAD PASSWORD: it is too simplistic/systematic
Retype new UNIX password:123456
passwd: all authentication tokens updated successfully.
[root@student24 Server]# cyradm -u cyrus localhost
Password:123456
IMAP Password:123456
createmailbox user.haidi
createmailbox user.haidi.Send
createmailbox user.haidi.Trash
createmailbox user.haidi.Drafts
setquota user.haidi5210
若出现“/var/lib/imap/socket/lmtp]: Permission denied”的告警,这个问题一般会到导致能发不能收。
解决方法:将postfix用户加至cyrus用户所在组mail即可。同时还有就是:chown postfix.postfix/var/spool/postfix。