1.cd /etc/yum.repos.d
2.wget -q http://openwebmail.org/openwebmail/download/redhat/rpm/release/openwebmail.repo
3.yum install openwebmail
4.執行/var/www/cgi-bin/openwebmail/openwebmail-tool.pl --init
出現訊息
[root@dns mail]# /var/www/cgi-bin/openwebmail/openwebmail-tool.pl --init
Please change '/var/www/cgi-bin/openwebmail/etc/dbm.conf' from
dbm_ext .db
dbmopen_ext .db
dbmopen_haslock no
to
dbm_ext .pag
dbmopen_ext none
dbmopen_haslock no
And execute '/var/www/cgi-bin/openwebmail/openwebmail-tool.pl --init' again!
ps: If you are running openwebmail in persistent mode,
don't forget to 'touch openwebmail*.pl', so speedycgi
will reload all scripts, modules and conf files in --init.
依照訊息修改 /var/www/cgi-bin/openwebmail/etc/dbm.conf 內容為
dbm_ext .pag
dbmopen_ext none
dbmopen_haslock no
再次執行
[root@dns openwebmail]# /var/www/cgi-bin/openwebmail/openwebmail-tool.pl --init
creating db /var/www/cgi-bin/openwebmail/etc/maps/b2g ...done.
creating db /var/www/cgi-bin/openwebmail/etc/maps/g2b ...done.
creating db /var/www/cgi-bin/openwebmail/etc/maps/lunar ...done.
Creating UTF-8 locales...
langconv ar_AE.CP1256 -> ar_AE.UTF-8
langconv ar_AE.ISO8859-6 -> ar_AE.UTF-8
langconv bg_BG.CP1251 -> bg_BG.UTF-8
langconv ca_ES.ISO8859-1 -> ca_ES.UTF-8
langconv cs_CZ.ISO8859-2 -> cs_CZ.UTF-8
langconv da_DK.ISO8859-1 -> da_DK.UTF-8
langconv de_DE.ISO8859-1 -> de_DE.UTF-8
langconv el_GR.ISO8859-7 -> el_GR.UTF-8
langconv en_US.ISO8859-1 -> en_US.UTF-8
langconv es_AR.ISO8859-1 -> es_AR.UTF-8
langconv fi_FI.ISO8859-1 -> fi_FI.UTF-8
langconv fr_FR.ISO8859-1 -> fr_FR.UTF-8
langconv he_IL.CP1255 -> he_IL.UTF-8
langconv hr_HR.ISO8859-2 -> hr_HR.UTF-8
langconv hu_HU.ISO8859-2 -> hu_HU.UTF-8
langconv id_ID.ISO8859-1 -> id_ID.UTF-8
langconv it_IT.ISO8859-1 -> it_IT.UTF-8
langconv ko_KR.eucKR -> ko_KR.UTF-8
langconv lt_LT.CP1257 -> lt_LT.UTF-8
langconv nl_NL.ISO8859-1 -> nl_NL.UTF-8
langconv no_NO.ISO8859-1 -> no_NO.UTF-8
langconv pl_PL.ISO8859-2 -> pl_PL.UTF-8
langconv pt_BR.ISO8859-1 -> pt_BR.UTF-8
langconv pt_PT.ISO8859-1 -> pt_PT.UTF-8
langconv ro_RO.ISO8859-2 -> ro_RO.UTF-8
langconv ru_RU.KOI8-R -> ru_RU.UTF-8
langconv sk_SK.ISO8859-2 -> sk_SK.UTF-8
langconv sl_SI.CP1250 -> sl_SI.UTF-8
langconv sr_CS.ISO8859-2 -> sr_CS.UTF-8
langconv sv_SE.ISO8859-1 -> sv_SE.UTF-8
langconv th_TH.TIS-620 -> th_TH.UTF-8
langconv tr_TR.ISO8859-9 -> tr_TR.UTF-8
langconv uk_UA.KOI8-U -> uk_UA.UTF-8
...done.
Welcome to the OpenWebMail!
This program is going to send a short message back to the developer,
so we could have the idea that who is installing and how many sites are
using this software, the content to be sent is:
OS: Linux 2.6.32-358.23.2.el6.x86_64 x86_64
Perl: 5.010001
WebMail: OpenWebMail 2.53 20080123
Send the site report?(Y/n) n
Thank you.
5.重啟動apache
service httpd restart
6.測試登入
http://ip/webmail 或 http://domain/webmail
登入後發現錯誤訊息..
/var/log/openwebmail.log! (Permission denied)
解決方式:
[root@dns log]# touch /var/log/openwebmail.log
[root@dns log]# chcon -u system_u /var/log/openwebmail.log
[root@dns log]# chcon -t httpd_sys_script_rw_t /var/log/openwebmail.log
[root@dns log]# chcon -t httpd_unconfined_script_exec_t /var/www/cgi-bin/openwebmail/openwebmail*
說明:
touch /var/log/openwebmail.log <==這是產生一個log檔
chcon -u system_u /var/log/openwebmail.log <==這是修改檔案使用者權限
chcon -t httpd_sys_script_rw_t /var/log/openwebmail.log <==這是修改寫入權限
chcon -t httpd_unconfined_script_exec_t /var/www/cgi-bin/openwebmail/openwebmail* <==這是修改檔案由什麼套件專用
這些都是因為SELinux造成的,原本檔案、目錄權限只有使用檔案前面那串(rwxrwxrwx),在使用SELinux後,會多出一種管理context type,context type會限制該目錄、檔案的使用原則,
所以,在使用有安裝SELinux時,常常會出現apach、ftp明明 都設定好了,卻還是不能使用,多半出問題,都是SELinux在做怪。
資料來源:
7.修改/var/www/cgi-bin/openwebmail/etc/openwebmail.conf
#default_language en
default_language zh_TW.Big5
#default_iconset Cool3D.English
default_iconset Cool3D.Chinese.Traditional
#default_fontsize 10pt
default_fontsize 12pt
#default_dateformat mm/dd/yyyy
default_dateformat yyyy/mm/dd
#default_hourformat 12
default_hourformat 24
#domainnames auto
domainnames 你的domain
8.設定郵件過濾規則修改/var/www/cgi-bin/openwebmail/etc/filter.book 在最後面加上
01@@@subject@@@include@@@game@@@move@@@mail-trash@@@1@@@big5
規則說明:
01:郵件規則優先順序.
subject:郵件規則過濾條件在郵件主旨中生效.
include:郵件規則過濾條件包含或不包含下列設定的關鍵字
game:郵件規則的關鍵字.
move:將垃圾信件搬移或複製的目的信匣.
mail-trash:設定垃圾信件的目的信匣.
1:設定的郵件規則過濾條件生效.
big5:設定郵件規則的語系.
其他錯誤解決方式:
問題1.使用帳號itest登入http://網域/webmail後發生下列錯誤:
無法建立 /var/www/cgi-bin/openwebmail/etc/sessions/itest*網域-session-0.817896068652288! (Invalid argument)
解決方式:
依據文件/var/www/cgi-bin/openwebmail/etc/openwebmail.conf.help說明
ow_sessionsdir
-----------------------------------------------------------------------
the directory for openwebmail temporary session files and attachments
currently used by each session.
ps: This directory would become very large if you have many concurrent
webmail users. So please put it in a partition with enough space.
ps: The permission for ow_usersdir and ow_sessionsdir directories should be
mode: 750
owner: the user that OWM script will be running as (root in many cases)
group: mail
執行 [root@dns sessions]# chmod 775 /var/www/cgi-bin/openwebmail/etc/sessions
備註: openwebmail 2.53不支援 Maildir
若etc/postfix/main.cf 設定使用home_mailbox = Maildir/,
而非home_mailbox = Mailbox則會收不到信件,需特別注意
參考資料:
www.openwebmail.org/openwebmail/download/redhat/yum/readme.txt