完整CentOS-Postfix邮件服务器建设 - 图文(2)

2019-03-28 23:10

hac_ker@126.com

# mkdir /tmp/extman

# chown -R vuser:vgroup /tmp/extman/

由 于RedHat发行版中包含了一个叫tmpwatch的工具,该工具会定期扫描/tmp/下的文件,如果这些文件很久都没被使用,将被删除,因此如果后台 长期不使用,/tmp/extman目录有可能被tmpwatch删除,所以要么定期登陆后台,要么修改 webman.cf将临时目录修改到另一个地 方。此处暂以/tmp/extman默认值为例。

数据库库初始化

# service mysqld start 设置开机启动

# chkconfig mysqld on

导入数据且初始化(默认的mysql都没有密码的,所以以下命令都不需要认证密码) # vi /var/www/extsuite/extman/docs/init.sql 把里面所有 extmail.org 的改为 rookie.com

# mysql

设置虚拟域和虚拟用户的配置文件

# cp /var/www/extsuite/extman/docs/mysql_virtual_alias_maps.cf /etc/postfix/ # cp /var/www/extsuite/extman/docs/mysql_virtual_domains_maps.cf /etc/postfix/ # cp /var/www/extsuite/extman/docs/mysql_virtual_mailbox_maps.cf /etc/postfix/ # cp /var/www/extsuite/extman/docs/mysql_virtual_sender_maps.cf /etc/postfix/

# vi /etc/postfix/main.cf 增加以下内容 # extmail config here virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf virtual_transport = maildrop:

重启postfix

# service postfix restart

测试authlib

# /usr/sbin/authtest -s login postmaster@rookie.com extmail

hac_ker@126.com

如输出以下结果证明extman 正确安装,数据库也正确导入,courier-authlib 正确连接mysql数据库 Authentication succeeded. Authenticated: postmaster@rookie.com (uid 1000, gid 1000) Home Directory: /home/domains/rookie.com/postmaster Maildir: /home/domains/rookie.com/postmaster/Maildir/ Quota: 104857600S Encrypted Password: $1$phz1mRrj$3ok6BjeaoJYWDBsEPZb5C0 Cleartext Password: extmail Options: (none) 配置图形化日志

# /usr/local/mailgraph_ext/mailgraph-init start 启动cmdserver(在后台显示系统信息)

# /var/www/extsuite/extman/daemon/cmdserver --daemon 加入开机自启动

# echo \ # echo \-v -d\>> /etc/rc.d/rc.local

注:

Extmail url: http://ip/extmail Extman url: http://ip/extman

Extman 管理员用户名:root@rookie.com 管理员默认密码: extmail*123*

Extmail 登录时,域名项应改为 rookie.com

七、配置cyrus-sasl

删除系统自带的

# rpm -e --nodeps cyrus-sasl

rpm -qa |grep cyrus-sasl |xargs rpm -e --nodeps 安装EMOS1.5里的

# yum install cyrus-sasl 修改postfix 配置文件

# vi /etc/postfix/main.cf 增加以下内容

# smtpd related config smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_non_fqdn_hostname, hac_ker@126.com

reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unauth_destination, reject_unauth_pipelining, reject_invalid_hostname, # SMTP sender login matching config smtpd_sender_restrictions = reject_sender_login_mismatch, reject_authenticated_sender_login_mismatch, reject_unauthenticated_sender_login_mismatch permit_mynetworks, smtpd_sender_login_maps mysql:/etc/postfix/mysql_virtual_sender_maps.cf, mysql:/etc/postfix/mysql_virtual_alias_maps.cf = # SMTP AUTH config here broken_sasl_auth_clients = yes smtpd_sasl_auth_enable = yes smtpd_sasl_local_domain = $myhostname smtpd_sasl_security_options = noanonymous 配置smtpd.conf

# vi /usr/lib/sasl2/smtpd.conf 清空后改为以下内容 pwcheck_method: authdaemond log_level: 3 mech_list: PLAIN LOGIN authdaemond_path:/var/spool/authdaemon/socket

重启postfix后测试SMTP认证 # service postfix restart

通过以下命令获得postmaster@extmail.org的用户名及密码的BASE64编码:

# perl -e 'use MIME::Base64; print encode_base64(\ )' 结果:

cG9zdG1hc3RlckByb29raWUuY29t

# perl -e 'use MIME::Base64; print encode_base64(\ 结果:

ZXh0bWFpbA==

开始测试

hac_ker@126.com

# telnet localhost 25

Trying 127.0.0.1... Connected to localhost.localdomain (127.0.0.1). Escape character is '^]'. 220 mail.rookie.com ESMTP Postfix - by extmail.org ehlo demo.domain.tld <<输入内容 250-mail.rookie.com 250-PIPELINING 250-SIZE 5242880 250-VRFY 250-ETRN 250-AUTH LOGIN PLAIN 250-AUTH=LOGIN PLAIN 250-ENHANCEDSTATUSCODES 250-8BITMIME 250 DSN auth login <<输入内容 334 VXNlcm5hbWU6 cG9zdG1hc3RlckByb29raWUuY29t <<输入内容 334 UGFzc3dvcmQ6 ZXh0bWFpbA== <<输入内容 235 2.7.0 Authentication successful ##显示这个说明认证成功 Quit <<输入内容 221 2.0.0 Bye Connection closed by foreign host.

八、配置courier-imap

默认的courier-authlib及courier-imap都会增加系统自启动设置,因此下一次服务器启动将自动启动相应的authlib及POP3服务

# yum install courier-imap

由于Courier-imap的IMAP目录是按UTF-7编码的,ExtMail目前还没有正式支持IMAP目录,因此需要屏蔽IMAP,只提供pop3服务。而就目前的使用情况来看,IMAP使用的非常少,绝大部分OutLook/Foxmail用户都习惯使用POP3而非IMAP。

# vi /usr/lib/courier-imap/etc/imapd 修改以下内容 IMAPDSTART=NO

# vi /usr/lib/courier-imap/etc/imapd-ssl 修改以下内容

hac_ker@126.com

IMAPDSSLSTART=NO

启动courier-imap ,测试pop3(先登录extman 新建一个邮件用户,如用户名为staff1,密码为staff1)

# service courier-imap start # telnet localhost 110 Trying 127.0.0.1... Connected to localhost.localdomain (127.0.0.1). Escape character is '^]'. +OK Hello there. user staff1@rookie.com <<输入内容 +OK Password required. pass staff1 <<输入内容 +OK logged in. list <<输入内容 +OK POP3 clients that break here, they violate STD53. . Quit <<输入内容 +OK Bye-bye. Connection closed by foreign host.

OK,SMTP和POP3的认证都通过,就意谓着邮件服务器能正常收发了,也就是邮件服务器能正常使用了~YEAH~~~~ 如需要添加杀毒Clamav、查毒amavisd-new、邮件过滤DSpam 的,可以继续看下一篇教程也可以到

http://wiki.extmail.org/extmail_solution_for_linux_centos-5 继续其他配置

2..

gcc 编译器

yum install gcc-c++

问题:

Can't locate /var/www/extsuite/extmail/lang/en_US in @INC 解决:

配置/data/www/extsuite/extmail/webmail.cf

数据库用户名和密码,mysql 用户名和密码和mysql sock路径


完整CentOS-Postfix邮件服务器建设 - 图文(2).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:2018-2024年中国铜矿行业发展前景预测研究报告(目录) - 图文

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: