一、环境
系统 centos 6.4x64最小化安装
IP 192.168.3.26
二、解析并关闭postfix服务
[[email protected] ~]# nslookup mial.weyeenet.net Server: 192.168.0.36 Address: 192.168.0.36#53 Name: mial.weyeenet.net Address: 192.168.3.26 [[email protected] ~]# nslookup > set type=mx > weyeenet.net Server: 192.168.0.36 Address: 192.168.0.36#53 weyeenet.net mail exchanger = 10 mail.weyeenet.net. [[email protected] ~]# service postfix stop Shutting down postfix: [ OK ] [[email protected] ~]# chkconfig postfix off
三、安装zimbra
[[email protected] ~]# yum -y install libidn11 curl fetchmail libpcre3 libgmp3c2 libxml2 libstdc++6 openssl perl sysstat libtool-ltdl compat-libstdc* nc file unzip libaio [[email protected] ~]# tar xf zcs-8.5.0_GA_3042.RHEL6_64.20140828192005.tgz [[email protected] ~]# cd zcs-8.5.0_GA_3042.RHEL6_64.20140828192005 [[email protected] zcs-8.5.0_GA_3042.RHEL6_64.20140828192005]# ./install.sh --platform-override
调整zimbra配置参数
Zimbra软件安装完成后,在默认的情况下是不能通过pop3协议收发邮件的,因为zimbra将pop3默认端口修改成了7110,而110被用来做pop3的代理端口,因此用默认的110端口并不能收取邮件,为符合大众习惯,将zimbra中pop3的端口7110改成110,因110已被绑定在pop3代理端口,因此要先修改代理端口,具体步骤如下:
[[email protected] root]$ su zimbra [[email protected] root]$ zmprov ms weyeenet.net zimbraPop3ProxyBindPort 111 [[email protected] root]$ zmprov ms weyeenet.net zimbraPop3BindPort 110 [[email protected] root]$ zmprov ms weyeenet.net zimbraPop3ProxyBindPort 7110 [[email protected] root]$ zmcontrol restart
配置SMTP认证
zimbra邮件系统安装完成后开启的是TLS认证功能,没有开始postfix的SMTP认证功能。open relay对公网上所有的用户开放,意味着垃圾邮件制造者可以使用我们的邮件服务器做中转站达到发送垃圾邮件的目的,我们的邮件服务器有可能会被反垃圾邮件联盟组织列入黑名单,导致互联网上的邮件服务器拒收我们的邮件,因此我们需要关闭服务器的open relay功能,启用SMTP认证,只给通过认证的用户进行邮件的转发。
测试服务器是否开始SMTP认证,在CMD命令行执行telnet 命令 如下:
[d:\~]$ telnet 192.168.3.26 25 Connecting to 192.168.3.26:25... Connection established. To escape to local shell, press ‘Ctrl+Alt+]‘. 220 weyeenet.net ESMTP Postfix ehlo weyeenet.net 250-weyeenet.net 250-PIPELINING 250-SIZE 10240000 250-VRFY 250-ETRN 250-STARTTLS 250-ENHANCEDSTATUSCODES 250-8BITMIME 250 DSN quit221 2.0.0 Bye
在以上命令结果中,没有看到任何有关AUTH认证的参数,表明服务器是没有开启SMTP认证功能的。
[[email protected] root]$ zmprov modifyServer mail.weyeenet.net zimbraMtaTlsAuthOnly FALSE [[email protected] root]$ zmcontrol restart
查看调整以后的参数结果
[[email protected] root]$ zmprov getServer mail.weyeenet.net | grep Auth zimbraAuthTokenNotificationInterval: 60000 zimbraLowestSupportedAuthVersion: 2 zimbraMtaAuthEnabled: TRUE zimbraMtaAuthHost: weyeenet.net zimbraMtaAuthTarget: TRUE zimbraMtaAuthURL: https://weyeenet.net:8443/service/soap/ zimbraMtaBrokenSaslAuthClients: yes zimbraMtaSaslAuthEnable: yes zimbraMtaSmtpSaslAuthEnable: no zimbraMtaSmtpdSaslAuthenticatedHeader: no zimbraMtaTlsAuthOnly: FALSE #这项值要FALSE才能进行SMTP认证 zimbraShareNotificationMtaAuthRequired: FALSE
再次测试SMTP开始是否成功
[d:\~]$ telnet 192.168.3.26 25 Connecting to 192.168.3.26:25... Connection established. To escape to local shell, press ‘Ctrl+Alt+]‘. 220 weyeenet.net ESMTP Postfix ehlo weyeenet.net 250-weyeenet.net 250-PIPELINING 250-SIZE 10240000 250-VRFY 250-ETRN 250-STARTTLS 250-AUTH LOGIN PLAIN #和SMTP认证相关的参数 250-AUTH=LOGIN PLAIN #和SMTP认证相关的参数 250-ENHANCEDSTATUSCODES 250-8BITMIME 250 DSN quit221 2.0.0 Bye #验证结果中出现了2行AUTH的参数,表明服务器的SMTP认证功能已经开启。
配置zimbra用户只能在指定的域内发送邮件
可参考http://wenku.baidu.com/link?url=T4o0MMnVX9oJDPtJy26IzcLfcJnG4Tbl4MxZNnkelAfjO9jOrcvrYshPSxUI1C8Af1rIRkTst9Ps6Flq9oH9JbLqQFvUip2orVAjnMfJOIK
可参考http://wiki.zimbra.com/wiki/Restrict_users_to_certain_domain
[[email protected] root]$ head -1 /opt/zimbra/conf/zmconfigd/smtpd_recipient_restrictions.cf check_sender_access hash:/opt/zimbra/postfix/conf/restricted_senders [[email protected] root]$ vim /opt/zimbra/conf/zmconfigd.cf #在SECTION mta标签下增加下面2行 SECTION mta DEPENDS amavis POSTCONF smtpd_restriction_classes local_only POSTCONF local_only FILE postfix_check_recipient_access.cf [[email protected] root]$ cat /opt/zimbra/conf/postfix_check_recipient_access.cf check_recipient_access hash:/opt/zimbra/postfix/conf/local_domains, reject [[email protected] root]$ cat /opt/zimbra/postfix/conf/restricted_senders [email protected] local_only [[email protected] root]$ cat /opt/zimbra/postfix/conf/local_domains weyeenet.net OK [[email protected] root]$ postmap /opt/zimbra/postfix/conf/restricted_senders [[email protected] root]$ postmap /opt/zimbra/postfix/conf/local_domains [[email protected] root]$ zmmtactl stop /postfix-script: stopping the Postfix mail system Stopping saslauthd...done. [[email protected] root]$ zmmtactl start Rewriting configuration files...done. Starting saslauthd...done. /postfix-script: starting the Postfix mail system