[centos下yum安装配置]Centos下yum安装配置OpenWebMail

更新时间:2019-02-13    来源:Perl    手机版     字体:

【www.bbyears.com--Perl】

OpenWebMail 2.53 配置

检查perl版本是否大于5.8.5-9

perl -version

yum的安装方法

先修改后rpmforge.repo,Centos5执行yum更新有有一些?突,先避开掉

vi /etc/yum.repos.d/rpmforge.repo

exclude = perl-Compress*,perl-IO-Compress*

连接国外网路,下载安装速度更快!

proxy = http://proxy.edu.tw:3128
timeout = 300

cd /etc/yum.repos.d
lftpget http://openwebmail.org/openwebmail/download/redhat/rpm/release/openwebmail.repo

yum -y install perl-suidperl perl-Compress-Zlib perl-Text-Iconv openwebmail

预设路径

主程式:/var/www/cgi-bin/openwebmail
资料夹:/var/www/data/openwebmail

最新openwebmail软体

http://openwebmail.org/openwebmail/download/current/openwebmail-current.tar.gz
http://openwebmail.org/openwebmail/download/redhat/rpm/packages/centos5/
 

tar的安装方法

cd /var/www(www.111cn.net)
tar -zxvf openwebmail-X.XX.tar.gz
mv data/openwebmail html/
rmdir data

vi /var/www/cgi-bin/openwebmail/etc/auth_unix.conf (由 etc/defaults/auth_unix.conf copy 过来改)
passwdfile_encrypted 设成 /etc/shadow
passwdmkdb 设成 none

vi /var/www/cgi-bin/openwebmail/etc/openwebmail.conf
mailspooldir 设成 /var/spool/mail
ow_htmldir 设成 /var/www/html/openwebmail
ow_cgidir 设成 /var/www/cgi-bin/openwebmail
spellcheck 设成 /usr/bin/ispell


/var/www/cgi-bin/openwebmail/openwebmail-tool.pl --init


将下列文字加到 /etc/logrotate.d/syslog 让系统定期砍掉过去的 log
/var/log/openwebmail.log {
postrotate
/usr/bin/killall -HUP syslogd
endscript
}
 
openwebmail相关设定

cp /var/www/cgi-bin/openwebmail/etc/openwebmail.conf /var/www/cgi-bin/openwebmail/etc/openwebmail.conf.bak
vi /var/www/cgi-bin/openwebmail/etc/openwebmail.conf

ow_htmldir /var/www/html/openwebmail
ow_htmlurl /openwebmail


default_language zh_TW.Big5
#default_language zh_TW.utf8 网路建议
#default_language zh_TW.UTF-8 我自己研究111cn.Net
default_iconset Cool3D.Chinese.Traditional
default_fontsize 12pt
default_msgformat both
newmailsound YouGotMail.English.wav

202行 webdisk_rootpath /webdisk 修改成--> webdisk_rootpath /

修改dbm.conf

cp /var/www/cgi-bin/openwebmail/etc/defaults/dbm.conf /var/www/cgi-bin/openwebmail/etc/defaults/dbm.conf.bak
vi /var/www/cgi-bin/openwebmail/etc/defaults/dbm.conf

dbm_ext .db
dbmopen_ext .db
dbmopen_haslock no

使用 Open WebMail 变更密码的时候,顺便修改 samba 密码

cp /var/www/cgi-bin/openwebmail/etc/auth_unix.conf /var/www/cgi-bin/openwebmail/etc/auth_unix.conf.bak
vi /var/www/cgi-bin/openwebmail/etc/auth_unix.conf

change_smbpasswd yes

执行安装

/var/www/cgi-bin/openwebmail/openwebmail-tool.pl --init

简化网址

vi /etc/httpd/conf/httpd.conf

ScriptAlias /mail "/var/www/cgi-bin/openwebmail/openwebmail.pl"

openwebmail 自动建立目录参数

vi /var/www/cgi-bin/openwebmail/openwebmail.pl
if (mkdir($homedir, 0700)) 改成 if (mkdir($homedir, 0755))

重新启用httpd

service httpd restart
 
perl-CGI-SpeedyCGI 加速效能
yum -y install perl-CGI-SpeedyCGI
从speedy主程式再??一份,root-suid执行权限的执行档speedy_suid

cd /usr/bin
cp speedy speedy_suidperl
chmod u+s speedy_suidperl
将/var/www/cgi-bin/openwebmail/底下所有的执行档中的第一行,将suidperl改成speedy_suid

vi chspeedy.sh

for name in open*.pl ; do
cp -a $name ${name}.old
sed -e "s/suidperl -T/speedy_suidperl/" < ${name}.old > ${name}
done

执行 ./chspeedy.sh
 
公用规则 filter.book
先删除公用帐号global个人信件管理档案www.111Cn.nEt

cd /home/global/.openwebmail/webmail/
rm filter.book

在公用帐号global底下建立与共用信件管理档案filter.book的连结,权限为640

ln -s /var/www/cgi-bin/openwebmail/etc/filter.book filter.book
chown global.group /var/www/cgi-bin/openwebmail/etc/filter.book
chmod 640 /var/www/cgi-bin/openwebmail/etc/filter.book


 
公用通讯录 addressbooks
公用通讯录


在公用帐号global底下建立与共用信件管理档案连结,权限为640


将档案/var/www/cgi-bin/openwebmail/etc/addressbooks/global改为公用帐号

接下来,就用公用帐号stxxxxx登入openwebmail,就可以新增联络人在共用通讯录了。

cd /var/www/cgi-bin/openwebmail/etc/addressbooks/
chown user.group global
chmod 640 global

新增多个公用通讯录

在/var/www/cgi-bin/openwebmail/etc/addressbooks/目录底下新增一个档案,,该档案就是共用通讯录名称。

范例:singsong社团群组专用的通讯录

touch singsong
chown stxxxxx.st singsong
chmod 640 singsong

完成后,登入到openwebmail后就会在通讯录?面看到一个 singsong *
 
过滤伪造 EXE 附件型态的信件: (fakedexecontenttype filter)
电子邮件病毒原本只有在使用者打开信件中属于可执行档的附件时,才会感染病毒。但是新近出现的一些电子邮件病毒却能作到只要使用者开启这封邮件就会中毒,让使用者闻毒色变 . 这个 filter 会过滤这类的信件, 将其移到垃圾桶.
vi /var/www/cgi-bin/openwebmail/etc/defaults/openwebmail.conf

四个 filter 在 defaults/openwebmail.conf 中内定是关闭的, 分别是

default_filter_badformatfrom no
default_filter_fakedsmtp no
default_filter_fakedfrom no
default_filter_fakedexecontenttype no


建议开启 default_filter_fakedexecontenttype 以过滤掉大部分的邮件病毒

本文来源:http://www.bbyears.com/jiaocheng/47985.html