sendmail+openwebmail的配置测试
对于sendmail的测试只是较为简单的RPM方式安装。
本来是在freebsd上测试的,因为山野中人的机器要装redhat所以在rh9的环境下测试。
sendmail的安装包:
sendmail-cf-8.11.6-3
sendmail-8.11.6-3
m4-1.4.1-5
imap-devel-2001a-1.72.0
imap-2001a-1.72.0
简单设置实现收发信功能:
编辑sendmail.mc
divert (-1)
define(`ALIAS_FILE', `/etc/aliases') 定义别名
FEATURE(`access_db',`hash -o /etc/mail/access.db') 设置是relay列表
MAILER(smtp)
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')
将他改成
DAEMON_OPTIONS(`Port=smtp,Addr=0.0.0.0, Name=MTA')
smtp认证设置:
安装Cyrus SASL
vi sendmail.mc
# 找到这几行:
dnl TRUST_AUTH_MECH(`DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
dnl define(`confAUTH_MECHANISMS', `DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')
# 将他修改成底下这样:
TRUST_AUTH_MECH(`DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
define(`confAUTH_MECHANISMS', `DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
DAEMON_OPTIONS(`Port=smtp,Addr=0.0.0.0, Name=MTA')
其他设置:
aliases
access
~/.forward
反垃圾邮件:procmail
接下来是配置openwebmail
需要的工具包:
1、CGI.pm-2.74.tar.gz
2、MIME-Base64-2.12.tar.gz
3、libnet-1.0901.tar.gz
4.Text-Iconv-1.2.tar.gz
我这里是以openwebmail-2.4.1版本为例的。目前网上多以1.x为主,本人觉得版本太旧了,所以选择使用2.4.1
配置方法:(注:apache的配置我懒得讲了,各种版本都有些差别)
将openwebmail解压缩到/usr/src目录下,生产cgi-bin和data目录
mv cgi-bin/openwebmail usr/local/apache2/cgi-bin
mv data/openwebmail usr/local/apache2/htdocs
将/cgi-bin/openwebmail/etc/default/auth_unix.conf拷贝到/etc目录下,并修改
a. passwdfile_encrypted /etc/shadow
b. passwdmkdb none
在/cgi-bin/openwebmail/etc目录下新建dbm.conf文件,内容如下:
dbm_ext .db
dbmopen_ext .db
dbmopen_haslock yes
在/cgi-bin/openwebmail/etc目录下修改openwebmail.conf文件,内容如下:
a. mailspooldir /var/spool/mail
b. ow_cgidir /usr/local/apache2/cgi-bin/openwebmail
c. ow_cgiurl /cgi-bin/openwebmail
d. ow_htmldir /usr/local/apache2/cgi-bin/openwebmail
e. ow_htmlurl /data/openwebmail
f. default_language zh_CN.GB2312
g. default_iconset Cool3D.Chinese.Simplified
然后运行/home/www/httpd/cgi-bin/openwebmail/openwebmail-tool.pl --init
5. 修改/cgi-bin/openwebmail/etc/sessionss属性,增加写权限。
基本上大功告成了!
遇到的问题:
1.openwebmail-tool.pl --init出现suidperl: bad interpreter
发现是没有安装perl-suid包,在cd2里找到rpm包,装上即可。
2.测试openwebmail-tool.pl --init接着出现script is not setuid/setgid in suidperl
chmod 4755 -R openwebmail |