CentOS下 Sendmail+Openwebmail 精简快速搭建
时间:2014-03-04 00:13 来源:linux.it.net.cn 作者:IT网
-
系统版本:Centos 5.3 64位
-
-
Sendmail版本:sendmail-8.13.8-8.el5
-
-
Openwebmail版本:openwebmail-2.53-3、openwebmail-data-2.53-3
-
下载所需版本:去sendmail官网下载对应自己服务器的版本饼安装。
-
-
yum install sendmail* -y && yum install -y perl-Compress-Zlib perl-suidperl
-
-
&& rpm -ivh openwebmail-data-2.53-3.i386.rpm openwebmail-2.53-3.i386.rpm perl-Text-Iconv-1.7-1.el5.rf.x86_64.rpm 即可。
-
-
本站点收藏下载:wget http://blog.mgcrazy.com/download/{openwebmail-data-2.53-3.i386.rpm,openwebmail-2.53-3.i386.rpm,perl-Text-Iconv-1.7-1.el5.rf.x86_64.rpm}推荐到官网下载
-
cp /etc/mail/sendmail.mc /etc/mail/sendmail.mc.back &&cp /etc/mail/sendmail.cf /etc/mail/sendmail.cf.back && echo “mgcrazy.com” >>/etc/mail/local-host-names
-
-
【* 最终实现http://mail.mgcrazy.com/ 登陆邮箱访问】
-
-
配置监听所有地址:
-
-
sed -i ‘s/Addr=127.0.0.1/Addr=0.0.0.0/g’ /etc/mail/sendmail.mc
-
-
配置用户认证:
-
-
修改vi /etc/mail/sendmail.mc 如下两行:
-
-
Dnl TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
-
-
Dnl define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl修改成
-
-
TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
-
-
define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl 即去掉首行的dnl 。这样sendmail配置完毕。
-
-
修改完后用M4命令生成mail配置文件 m4 sendmail.mc >sendmail.cf
-
saslauthd服务作用:提供smtp验证
-
-
service saslauthd restart
-
-
安装dovecot服务,yum install –y dovecot*
-
-
去掉/etc/dovecot.conf 如下行前面的#号即可:
-
-
protocols = imap imaps pop3 pop3s
-
邮箱用户的建立,可以用客户端收发邮件即正常
-
-
groupadd mailgroup
-
-
useradd -g mailgroup –s /sbin/nologin wugk
-
-
passwd wugk 设置好密码即可。
-
-
Service sendmail restart ;service dovecot restart ;service saslauthd restart 重启所有sendmail相关服务
-
dbm_ext .db
-
-
dbmopen_ext .db
-
-
dbmopen_haslock no
-
-
然后初始化 ./var/www/cgi-bin/openwebmail/openwebmail-too.pl –init 按Y即可
-
dbm_ext .db
-
-
dbmopen_ext .db
-
-
dbmopen_haslock yes
-
domainnames mgcrazy.com
-
-
default_language zh_CN.GB2312
-
-
default_iconset Cool3D.Chinese.Simplified
-
domainnames mgcrazy.com
-
-
smtpserver mail.mgcrazy.com
-
-
authpop3_server mail.mgcrazy.com
-
-
然后再执行./var/www/cgi-bin/openwebmail/openwebmail-too.pl –init 按Y即可
-
<VirtualHost *:80>
-
-
ServerAdmin wugk@mgcrazy.com
-
-
ServerName mail.mgcrazy.com
-
-
DocumentRoot /usr/local/apache-2.2.13/
-
-
ScriptAlias /cgi-bin/ "/usr/local/apache-2.2.13/cgi-bin/"
-
-
<Directory /usr/local/apache-2.2.13/>
-
-
Options Indexes FollowSymLinks
-
-
AllowOverride None
-
-
Order allow,deny
-
-
Allow from all
-
-
</Directory>
-
-
RewriteEngine On
-
-
ProxyPreserveHost On
-
-
RewriteRule ^/$ http://mail.mgcrazy.com/cgi-bin/openwebmail/openwebmail.pl [P,L,NC]
-
-
</VirtualHost>
(责任编辑:IT)
|