操作系统 |
CentOS |
CentOS和RHEL是一样的,而且升级免费 |
邮件传输代理(MTA) |
Postfix |
最新 |
WebMail |
Extmail |
支持多语言、全部模板化,功能基本齐全 |
Web |
Extman |
支持无限域名、无限用户 |
邮件投递代理(MDA) |
maildrop |
支持过滤和强大的功能 |
其它数据认证库 |
courier-authlib |
负责courier-imap,maildrop |
SMTP |
cyrus-sasl |
标准的SASL实现库,支持courier |
POP3 |
courier-imap |
Pop3 |
一、安装前准备
1.安装时加上mysql
2.关闭防火墙;
3.关闭SELINUX
4.删除系统原来安好的sendmail
5.vi
6.建立EMOS1.5
#
#
# #
# [EMOS-base] name=EMOS-Base baseurl=http://mirror.extmail.org/yum/emos/1.5/os/$basearch/ gpgcheck=0 priority=0 protect=0 [EMOS-update] name=EMOS-Updates baseurl=http://mirror.extmail.org/yum/emos/1.5/updates/$basearch/ gpgcheck=0 priority=0 protect=0 |
#
二、配置MTA—postfix
#
#
#
#
#
增加以下内容
#
myhostname
mydestination
#
mail_name
smtpd_banner
#
smtpd_error_sleep_time
#
message_size_limit
mailbox_size_limit
show_user_unknown_table_name
#
bounce_queue_lifetime
maximal_queue_lifetime |
三、配置courier-authlib
#
修改authlib
#
#
MYSQL_SERVER
MYSQL_PASSWORD
MYSQL_SOCKET
MYSQL_PORT
MYSQL_OPT
MYSQL_DATABASE
MYSQL_USER_TABLE
MYSQL_CRYPT_PWFIELD
MYSQL_UID_FIELD
MYSQL_GID_FIELD
MYSQL_LOGIN_FIELD
MYSQL_HOME_FIELD
MYSQL_NAME_FIELD
MYSQL_MAILDIR_FIELD
MYSQL_QUOTA_FIELD
MYSQL_SELECT_CLAUSE
|
修改authmysqlrc
#
#
修改authdaemonrc
authmodulelist=”authmysql”authmodulelistorig=”authmysql” |
启动
#
Starting
修改authdaemon
#
四、配置maildrop
#
配置master.cf
maildrop |
配置main.cf
maildrop_destination_recipient_limit |
注意flag 和maildrop_前面有二个空格
测试maildrop对authlib支持
#
注意事项:
1、如需重新编译Maildrop软件包,必须先获得其源码rpm包,并且必须先行安装courier-authlib及其devel软件包,否则编译后的maildrop将无法打开authlib支持。
2、
maildrop
五、配置apache
修改apache配置文件
#
在最后一行加上
|
新建vhost_extmail.conf
#
#
ServerName
DocumentRoot
ScriptAlias
Alias
ScriptAlias
Alias
#
SuexecUserGroup
|
设置apache开机启动
#
六、配置
安装extmail
#
#
#
修改以下两项
SYS_MYSQL_USER |
更新cgi目录权限
#
#
链接基本库到Extmail
#
#
由
于RedHat发行版中包含了一个叫tmpwatch的工具,该工具会定期扫描/tmp/下的文件,如果这些文件很久都没被使用,将被删除,因此如果后台
长期不使用,/tmp/extman目录有可能被tmpwatch删除,所以要么定期登陆后台,要么修改
数据库库初始化
#
设置开机启动
#
导入数据且初始化(默认的mysql都没有密码的,所以以下命令都不需要认证密码)
#
把里面所有
#
#
上
述导入初始化SQL时,默认的uidnumber/gidnumber都是1000,这和vuser:vgroup
设置虚拟域和虚拟用户的配置文件
#
#
#
#
#
增加以下内容
virtual_mailbox_domains
virtual_mailbox_maps
重启postfix
#
测试authlib
#
如输出以下结果证明extman
Encrypted
Cleartext
配置图形化日志
#
启动cmdserver(在后台显示系统信息)
#
加入开机自启动
#
#
注:
Extmail
Extman
Extman
Extmail
七、配置cyrus-sasl
删除系统自带的
#
rpm -qa |grep cyrus-sasl |xargs rpm -e ?nodeps
安装EMOS1.5里的
#
修改postfix
#
增加以下内容
#
smtpd_sender_restrictions
smtpd_sender_login_maps
#
broken_sasl_auth_clients
smtpd_sasl_auth_enable
smtpd_sasl_local_domain
smtpd_sasl_security_options
配置smtpd.conf
#
清空后改为以下内容
mech_list:
重启postfix后测试SMTP认证
#
通过以下命令获得postmaster@extmail.org的用户名及密码的BASE64编码:
#
)’
结果:
cG9zdG1hc3RlckByb29raWUu
#
结果:
ZXh0bWFpbA==
开始测试
#
Escape
220
ehlo
250-mail.rookie.com
250-PIPELINING
250-SIZE
250-VRFY
250-ETRN
250-AUTH
250-AUTH=LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250
auth
334
cG9zdG1hc3RlckByb29raWUu
334
ZXh0bWFpbA== <<输入内容
235
Quit <<输入内容
221
Connection
八、配置courier-imap
默认的courier-authlib及courier-imap都会增加系统自启动设置,因此下一次服务器启动将自动启动相应的authlib及POP3服务
#
由于Courier-imap的IMAP目录是按UTF-7编码的,ExtMail目前还没有正式支持IMAP目录,因此需要屏蔽IMAP,只提供pop3服务。而就目前的使用情况来看,IMAP使用的非常少,绝大部分OutLook/Foxmail用户都习惯使用POP3而非IMAP。
#
修改以下内容
#
修改以下内容
启动courier-imap
#
#
Escape
+OK
user
+OK
pass
+OK
list <<输入内容
+OK
.
Quit <<输入内容
+OK
Connection
OK,SMTP和POP3的认证都通过,就意谓着邮件服务器能正常收发了,也就是邮件服务器能正常使用了~YEAH~~~~
http://wiki.extmail.org/extmail_solution_for_linux_centos-5
继续其他配置
2..
gcc 编译器
问题:
问题:
解决:
问题:
问题:
查看日志信息:
# echo “/usr/local/mailgraph_ext/mailgraph-init start” >>
/etc/rc.d/rc.local
perl -e ‘use MIME::Base64; print
encode_base64(“postmaster\@extmail.org”)’
问题:
日志信息:
解决:
问题:
解决:
http://download.chinaunix.net/do … eID=1789&site=1
#
Authentication
#
pwcheck_method:
Trying
Trying
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路径
install_driver(mysql) failed: Can’t locate DBD/mysql.pm in
@INC (@INC contains: /data/www/extsuite/extmail/libs
/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl
/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl
/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi
/usr/lib/perl5/5.8.8)
at (eval 15) line 3. Perhaps the DBD::mysql perl module hasn’t been
fully installed, or
perhaps the capitalisation of ‘mysql’ isn’t right. Available
drivers: DBM, ExampleP, File, Proxy, Sponge.
at /data/www/extsuite/extmail/libs/Ext/Auth/MySQL.pm line 45
yum install perl-DBD-MySQL
DBI
connect(‘database=extmail;host=localhost;mysql_socket=/tmp/mysql.sock’,'extmail’,…)
failed:
Can’t connect to local MySQL server through socket
‘/tmp/mysql.sock’ (2)
at /data/www/extsuite/extmail/libs/Ext/Auth/MySQL.pm line 45
解决:
数据库连接有问题
[root@CentOSX64 extmail]# /usr/sbin/authtest -s login
postmaster@extmail.org extmail
Authentication FAILED: Input/output error
[root@CentOSX64 extmail]#
Aug
Aug
Aug
Aug
Aug
Aug
vim /etc/authlib/authmysqlrc
MYSQL_SOCKET
# echo “/var/www/extsuite/extman/daemon/cmdserver -v -d” >>
/etc/rc.d/rc.local
perl -e ‘use MIME::Base64; print encode_base64(“extmail”)’
Connection closed by foreign host.
[root@CentOSX64 ~]# telnet localhost 25
Trying 127.0.0.1…
Connected to localhost.localdomain (127.0.0.1).
Escape character is ‘^]’.
220 mail.extmail.org ESMTP Postfix ? by extmail.org
ehlo demo.domain.tld
250-mail.extmail.org
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
cG9zdG1hc3RlckBleHRtYWls
334 UGFzc3dvcmQ6
ZXh0bWFpbA==
535 5.7.8 Error: authentication failed: generic failure
Aug
Aug
/usr/lib/sasl2/smtpd.conf
/var/spool/authdaemon
/etc/authlib/authdaemon
关于很多日志报拒绝情况下,检查权限的问题,多数情况 是SELinux搞的鬼,将SELinux关闭,重新启动机器再看一切运行正常
[root@CentOSX64 yum.repos.d]# yum install courier-imap
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Setting up Install Process
Resolving Dependencies
?> Running transaction check
—> Package courier-imap.x86_64 0:4.6.0-1 set to be updated
?> Processing Dependency: courier-authlib-devel >=
0.60.6.20080629 for package: courier-imap
?> Processing Dependency: libcourierauthsasl.so()(64bit) for
package: courier-imap
?> Processing Dependency: libcourierauth.so()(64bit) for
package: courier-imap
?> Finished Dependency Resolution
courier-imap-4.6.0-1.x86_64 from EMOS-base has depsolving
problems
courier-imap-4.6.0-1.x86_64 from EMOS-base has depsolving
problems
courier-imap-4.6.0-1.x86_64 from EMOS-base has depsolving
problems
Error: Missing Dependency: libcourierauth.so()(64bit) is needed by
package courier-imap-4.6.0-1.x86_64 (EMOS-base)
Error: Missing Dependency: libcourierauthsasl.so()(64bit) is needed
by package courier-imap-4.6.0-1.x86_64 (EMOS-base)
Error: Missing Dependency: courier-authlib-devel >=
0.60.6.20080629 is needed by package courier-imap-4.6.0-1.x86_64
(EMOS-base)
The program package-cleanup is found in the yum-utils package.
[root@CentOSX64 yum.repos.d]#
不在使用courier-imap rpm 安装,尔使用tar.gz 安装
[root@CentOSX64 yum.repos.d]# find / -name
libcourierauthsasl.so
/usr/lib64/courier-authlib/libcourierauthsasl.so
[root@CentOSX64 yum.repos.d]# find / -name
courier-authlib-devel
[root@CentOSX64 yum.repos.d]# find / -name libcourierauth.so
/usr/lib64/courier-authlib/libcourierauth.so
[root@CentOSX64 yum.repos.d]#
yum ?y install courier-authlib-devel
tar -jxvf courier-imap-4.1.2.tar.bz2
cd courier-imap-4.1.2
./configure ?prefix=/usr/local/courier-imap ?with-redhat
?enable-unicode ?disable-root-check \
?with-trashquota ?without-ipv6
CPPFLAGS=’-I/usr/courier-authlib/include’ \
COURIERAUTHCOnFIG=’/usr/bin/courierauthconfig’ \
CPPFLAGS=’-I/usr/courier-authlib/include’
make
make install
cp /usr/local/courier-imap/etc/imapd.dist
/usr/local/courier-imap/etc/imapd
cp /usr/local/courier-imap/etc/imapd-ssl.dist
/usr/local/courier-imap/etc/imapd-ssl
cp /usr/local/courier-imap/etc/pop3d.dist
/usr/local/courier-imap/etc/pop3d
cp /usr/local/courier-imap/etc/pop3d-ssl.dist
/usr/local/courier-imap/etc/pop3d-ssl
配置Courier-IMAP,为用户提供pop3服务:
vi /usr/local/courier-imap/etc/pop3d
POP3DSTART=yes
注:如果你想为用户提供IMAP服务,可以在”/usr/local/courier-imap/etc/imapd”文件中设置”IMAPDSTART=yes”。
设置courier-imap开机自动运行:
cp courier-imap.sysvinit /etc/rc.d/init.d/imapd
chmod 755 /etc/rc.d/init.d/imapd
chkconfig ?add imapd
service imapd start