CentOS5安装配置ExtMail Web邮件收发系统Word文档下载推荐.docx

上传人:b****3 文档编号:16661033 上传时间:2022-11-25 格式:DOCX 页数:12 大小:20.06KB
下载 相关 举报
CentOS5安装配置ExtMail Web邮件收发系统Word文档下载推荐.docx_第1页
第1页 / 共12页
CentOS5安装配置ExtMail Web邮件收发系统Word文档下载推荐.docx_第2页
第2页 / 共12页
CentOS5安装配置ExtMail Web邮件收发系统Word文档下载推荐.docx_第3页
第3页 / 共12页
CentOS5安装配置ExtMail Web邮件收发系统Word文档下载推荐.docx_第4页
第4页 / 共12页
CentOS5安装配置ExtMail Web邮件收发系统Word文档下载推荐.docx_第5页
第5页 / 共12页
点击查看更多>>
下载资源
资源描述

CentOS5安装配置ExtMail Web邮件收发系统Word文档下载推荐.docx

《CentOS5安装配置ExtMail Web邮件收发系统Word文档下载推荐.docx》由会员分享,可在线阅读,更多相关《CentOS5安装配置ExtMail Web邮件收发系统Word文档下载推荐.docx(12页珍藏版)》请在冰豆网上搜索。

CentOS5安装配置ExtMail Web邮件收发系统Word文档下载推荐.docx

#vi/etc/postfix/main.cf

增加如下内容:

#hostname

mynetworks=127.0.0.1

myhostname=mail.centos.bz

mydestination=$mynetworks$myhostname

#banner

mail_name=Postfix-byextmail.org

smtpd_banner=$myhostnameESMTP$mail_name

#responseimmediately

smtpd_error_sleep_time=0s

#Messageandreturncoolcodecontrol

message_size_limit=5242880

mailbox_size_limit=5242880

show_user_unknown_table_name=no

#Queuelifetimecontrol

bounce_queue_lifetime=1d

maximal_queue_lifetime=1d

注:

myhostname改为自己的。

设置postfix开机自启:

#chkconfigpostfixon

配置courier-authlib

1、安装Courier-Authlib

安装以下软件包:

#yum-yinstallcourier-authlib

#yum-yinstallcourier-authlib-mysql

删除并编辑/etc/authlib/authmysqlrc文件:

#cat/dev/null>

/etc/authlib/authmysqlrc

#vi/etc/authlib/authmysqlrc

MYSQL_SERVERlocalhost

MYSQL_USERNAMEextmail

MYSQL_PASSWORDextmail

MYSQL_SOCKET/var/lib/mysql/mysql.sock

MYSQL_PORT3306

MYSQL_OPT0

MYSQL_DATABASEextmail

MYSQL_USER_TABLEmailbox

MYSQL_CRYPT_PWFIELDpassword

MYSQL_UID_FIELDuidnumber

MYSQL_GID_FIELDgidnumber

MYSQL_LOGIN_FIELDusername

MYSQL_HOME_FIELDhomedir

MYSQL_NAME_FIELDname

MYSQL_MAILDIR_FIELDmaildir

MYSQL_QUOTA_FIELDquota

MYSQL_SELECT_CLAUSESELECTusername,password,"

"

uidnumber,gidnumber,\

CONCAT('

/home/domains/'

homedir),\

maildir),\

quota,\

name\

FROMmailbox\

WHEREusername='

$(local_part)@$(domain)'

修改authdaemonrc文件

#vi/etc/authlib/authdaemonrc

修改如下内容:

authmodulelist="

authmysql"

authmodulelistorig="

或者使用如下命令直接修改:

sed-i'

s/authmodulelist=.*/authmodulelist="

/g'

/etc/authlib/authdaemonrc

s/authmodulelistorig=.*/authmodulelistorig="

2、启动courier-authlib:

#servicecourier-authlibstart

修改authdaemonsocket目录权限

#chmod755/var/spool/authdaemon/

配置maildrop

1、安装maildrop

#yum-yinstallmaildrop

配置master.cf为了使Postfix支持Maildrop,必须修改/etc/postfix/master.cf文件,注释掉原来的maildrop的配置内容,并改为:

maildropunix-nn--pipe

flags=DRhuuser=vuserargv=maildrop-w90-d${user}@${nexthop}${recipient}${user}${extension}{nexthop}

注意:

flags前面有“两个空格”

配置main.cf由于maildrop不支持一次接收多个收件人,因此必须在main.cf里增加如下参数:

maildrop_destination_recipient_limit=1

2、测试maildrop对authlib支持

#maildrop-v

看是否出现以下内容:

maildrop2.1.0Copyright1998-2005DoublePrecision,Inc.

GDBM/DBextensionsenabled.

CourierAuthenticationLibraryextensionenabled.

Maildirquotaextensionenabled.

ThisprogramisdistributedunderthetermsoftheGNUGeneralPublic

License.SeeCOPYINGforadditionalinformation.

配置apache

1、安装httpd

#yum-yinstallhttpd

2、虚拟主机设置

编辑httpd.conf文件:

#vi/etc/httpd/conf/httpd.conf

在最后一行加上:

NameVirtualHost*:

80

Includeconf/vhost_*.conf

编辑vhost_extmail.conf

#vi/etc/httpd/conf/vhost_extmail.conf

里面定义虚拟主机的相关内容:

#VirtualHostforExtMailSolution

ServerNamemail.centos.bz

DocumentRoot/var/www/extsuite/extmail/html/

ScriptAlias/extmail/cgi//var/www/extsuite/extmail/cgi/

Alias/extmail/var/www/extsuite/extmail/html/

ScriptAlias/extman/cgi//var/www/extsuite/extman/cgi/

Alias/extman/var/www/extsuite/extman/html/

#Suexecconfig

SuexecUserGroupvuservgroup

把ServerName修改成自己的。

设置apache开机启动并重启apache

#chkconfighttpdon

#servicehttpdrestart

配置webmail-extmail

1、安装ExtMail

#yum-yinstallextsuite-webmail

2、编辑webmail.cf

#cd/var/www/extsuite/extmail

#cpwebmail.cf.defaultwebmail.cf

#viwebmail.cf

主要变动的内容见下:

SYS_MYSQL_USER=extmail

SYS_MYSQL_PASS=extmail

SYS_MYSQL_DB=extmail

更新cgi目录权限由于SuEXEC的需要,必须将extmail的cgi目录修改成vuser:

vgroup权限:

#chown-Rvuser:

vgroup/var/www/extsuite/extmail/cgi/

配置管理后台-extman

1、yum安装ExtMan

#yum-yinstallextsuite-webman

更新cgi目录权限由于SuEXEC的需要,必须将extman的cgi目录修改成vuser:

vgroup/var/www/extsuite/extman/cgi/

链接基本库到Extmail

#mkdir/tmp/extman

vgroup/tmp/extman

注意事项:

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

此处暂以/tmp/extman默认值为例。

2、安装mysql数据库

#yum-yinstallmysqlmysql-server

3、数据库初始化

启动Mysql

#servicemysqldstart

#chkconfigmysqldon

导入mysql数据库结构及初始化数据,root密码默认为空

#mysql-uroot-p<

/var/www/extsuite/extman/docs/extmail.sql

/var/www/extsuite/extman/docs/init.sql

上述导入初始化SQL时,默认的uidnumber/gidnumber都是1000,这和vuser:

vgroup的uid/gid一致,是因为maildrop投递时会从数据库里取uidnumber/gidnumber,而在master.cf里已经定义好了投递时的运行身份(vuser:

vgroup),所以这两个字段的内容必须为1000,否则将出现投递错误,例如报0×

06等错误。

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

#cd/var/www/extsuite/extman/docs

#cpmysql_virtual_alias_maps.cf/etc/postfix/

#cpmysql_virtual_domains_maps.cf/etc/postfix/

#cpmysql_virtual_mailbox_maps.cf/etc/postfix/

#cpmysql_virtual_sender_maps.cf/etc/postfix/

配置main.cf:

增加以下内容:

#extmailconfighere

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:

#servicepostfixrestart

5、测试authlib

#/usr/sbin/authtest-sloginpostmaster@extmail.orgextmail

结果如下:

Authenticationsucceeded.

Authenticated:

postmaster@extmail.org(uid1000,gid1000)

HomeDirectory:

/home/domains/extmail.org/postmaster

Maildir:

/home/domains/extmail.org/postmaster/Maildir/

Quota:

104857600S

EncryptedPassword:

$1$phz1mRrj$3ok6BjeaoJYWDBsEPZb5C0

CleartextPassword:

extmail

Options:

(none)

这样表明ExtMan的正确安装,数据库也正确导入,courier-authlib能正确连接到mysql数据库

最后访问http:

//mail.centos.bz/extmail/,如无意外,将看到webmail的登陆页,不过此时还没有加正式的用户,所以不能登陆,包括postmaster@extmail.org也不行。

必须要登陆到http:

//mail.centos.bz/extman/里增加一个新帐户才能登陆。

ExtMan的默认超级管理员帐户:

root@extmail.org,初始密码:

extmail*123*,登陆成功后,建议将密码修改,以确保安全。

6、配置图形化日志

启动mailgraph_ext

#/usr/local/mailgraph_ext/mailgraph-initstart

启动cmdserver(在后台显示系统信息)

#/var/www/extsuite/extman/daemon/cmdserver--daemon

加入开机自启动:

#echo"

/usr/local/mailgraph_ext/mailgraph-initstart"

>

/etc/rc.d/rc.local

/var/www/extsuite/extman/daemon/cmdserver-v-d"

>

使用方法:

等待大约15分钟左右,如果邮件系统有一定的流量,即可登陆到extman里,点“图形日志”即可看到图形化的日志。

具体每天,周,月,年的则点击相应的图片进入即可。

配置cyrus-sasl

1、安装cyrus-sasl

删除系统的cyrus-sasl:

#rpm-ecyrus-sasl--nodeps

安装新的支持authdaemon的软件包

#yum-yinstallcyrus-saslcyrus-sasl-plain

2、配置main.cf文件

Postfix的SMTP认证需要透过Cyrus-SASL,连接到authdaemon获取认证信息。

编辑main.cf

#smtpdrelatedconfig

smtpd_recipient_restrictions=

permit_mynetworks,

permit_sasl_authenticated,

reject_non_fqdn_hostname,

reject_non_fqdn_sender,

reject_non_fqdn_recipient,

reject_unauth_destination,

reject_unauth_pipelining,

reject_invalid_hostname,

#SMTPsenderloginmatchingconfig

smtpd_sender_restrictions=

reject_sender_login_mismatch,

reject_authenticated_sender_login_mismatch,

reject_unauthenticated_sender_login_mismatch

smtpd_sender_login_maps=

mysql:

/etc/postfix/mysql_virtual_sender_maps.cf,

#SMTPAUTHconfighere

broken_sasl_auth_clients=yes

smtpd_sasl_auth_enable=yes

smtpd_sasl_local_domain=$myhostname

smtpd_sasl_security_options=noanonymous

3、编辑smtpd.conf文件

#vi/usr/lib/sasl2/smtpd.conf

确保其内容为:

pwcheck_method:

authdaemond

log_level:

3

mech_list:

PLAINLOGIN

authdaemond_path:

/var/spool/authdaemon/socket

重新启动postfix:

4、测试SMTP认证

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

#perl-e'

useMIME:

:

Base64;

printencoolcode_base64("

postmaster\@extmail.org"

)'

内容如下:

cG9zdG1hc3RlckBleHRtYWlsLm9yZw==

extmail"

ZXh0bWFpbA==

然后本机测试:

#telnetlocalhost25

其过程如下:

Trying127.0.0.1…

Connectedtolocalhost.localdomain(127.0.0.1).

Escapecharacteris'

^]'

.

220mail.extmail.orgESMTPPostfix–byextmail.org

ehlodemo.domain.tld<

<

输入内容

250-mail.extmail.org

250-PIPELINING

250-SIZE10240000

250-VRFY

250-ETRN

250-AUTHLOGINPLAIN

250-AUTH=LOGINPLAIN

250-ENHANCEDSTATUScoolcodeS

250-8BITMIME

250DSN

authlogin<

输入内容

334VXNlcm5hbWU6

cG9zdG1hc3RlckBleHRtYWlsLm9yZw==<

334UGFzc3dvcmQ6

ZXh0bWFpbA==<

2352.0.0Authenticationsuccessful

quit<

2212.0.0Bye

最后出现235AuthenticationSuccessful表明认证成功了。

配置courier-imap

1、安装Courier-imap

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

#yum-yinstallcourier-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

IMAPDSSLSTART=NO

然后重新启动courier-imap:

#servicecourier-imapstart

测试POP3请按如下步骤输入pop3命令测试其是否正常工作,注意蓝色的信息是我们输入到POP3服务器的(请首先登录extman自行建立test@extmail.org用户,密码:

extmail)

#telnetlocalhost110

Escap

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 高等教育 > 文学

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1