RedHatLinux AS3中APACHE+SendMail+OpenWebMail整合
注:
1. openwebmail是一个webmail程序,不同与微软的owa及imail的web方式,它不包含服务器端服务(本例中邮件服务器为sendmail);因此在运行openwebmail的机器上需要安装apache和sendmail.
2. openwebmail多数程序是由perl语句编写的,所以必须安装perl及perl相关包
3.下载所需软件包:在redhatlinux as3中安装openwebmail需要以下软件包
>>1. perl-cgi-2.81-88.4.i386.rpm
http://www.openwebmail.com/openwebmail/download/redhat/rpm/packages/rhel3/perl-cgi-2.81-88.4.i386.rpm
>>2.
perl-compress-zlib-1.21-rh9.i386.rpm
http://www.openwebmail.com/openwebmail/download/redhat/rpm/packages/rhel3/perl-compress-zlib-1.21-rh9.i386.rpm
>>3.
perl-text-iconv-1.2-rh80.i386.rpm
http://www.openwebmail.com/openwebmail/download/redhat/rpm/packages/rhel3/perl-text-iconv-1.2-rh80.i386.rpm
>>4.
perl-suidperl-5.8.0-88.i386.rpm
>>5.
openwebmail-2.41-20041126.i386.rpm
下面就开始安装配置:
step 1:安装下载包
[root@as3 software]#rpm –ivh
perl-cgi-2.81-88.4.i386.rpm
[root@as3 software]#rpm –ivh
perl-compress-zlib-1.21-rh9.i386.rpm
[root@as3 software]#rpm –ivh
perl-text-iconv-1.2-rh80.i386.rpm
[root@as3 software]#rpm –ivh
perl-suidperl-5.8.0-88.i386.rpm
step 2:初始化openwebmail
[root@as3 software]#cd /var/www/cgi-bin/openwebmail
[root@as3 openwebmail]# ls -l
total 1192
drwxr-xr-x 2 root mail 4096 nov 27 14:44 auth
drwxr-xr-x 12 root mail 4096 nov 27 21:17 etc
drwxr-xr-x 6 root mail 4096 nov 27 14:44 misc
drwxr-xr-x 2 root mail 4096 nov 27 14:44 modules
-rwsr-xr-x 1 root mail 260341 nov 26 12:16 openwebmail-abook.pl
-rwsr-xr-x 1 root mail 23817 nov 26 12:16 openwebmail-advsearch.pl
-rwsr-xr-x 1 root mail 114322 nov 26 12:16 openwebmail-cal.pl
-rwsr-xr-x 1 root mail 23855 nov 26 12:16 openwebmail-folder.pl
-rwsr-xr-x 1 root mail 68418 nov 26 12:16 openwebmail-main.pl
-rwsr-xr-x 1 root mail 34984 nov 26 12:16 openwebmail.pl
-rwsr-xr-x 1 root mail 139830 nov 26 12:16 openwebmail-prefs.pl
-rwsr-xr-x 1 root mail 66851 nov 26 12:16 openwebmail-read.pl
-rwsr-xr-x 1 root mail 110724 nov 26 12:16 openwebmail-send.pl
-rwsr-xr-x 1 root mail 24813 nov 26 12:16 openwebmail-spell.pl
-rwsr-xr-x 1 root mail 52749 nov 26 12:16 openwebmail-tool.pl
-rwsr-xr-x 1 root mail 48796 nov 26 12:16 openwebmail-vdomain.pl
-rwsr-xr-x 1 root mail 18457 nov 26 12:16 openwebmail-viewatt.pl
-rwsr-xr-x 1 root mail 112975 nov 26 12:16 openwebmail-webdisk.pl
-rwxr-xr-x 1 root mail 4859 aug 12 13:06 preload.pl
drwxr-xr-x 2 root mail 4096 nov 27 14:44 quota
drwxr-xr-x 2 root mail 4096 nov 27 14:44 shares
-rwxr-xr-x 1 root mail 4117 sep 4 15:04 userstat.pl
-rwxr-xr-x 1 root mail 19305 nov 16 22:42 vacation.pl
[root@as3 openwebmail]#./openwebmail-tool.pl --init //这步骤很关键会出现如下的提示:change the following 3 options in openwebmail.conf from dbm_ext .db dbmopen_ext none dbmopen_haslock no to dbm_ext .db dbmopen_ext %dbm_ext% dbmopen_haslock no安回车键忽略提示,继续配置//进入openwebmail下面的etc目录进行相关配置,需要修改以下
1./var/www/cgi-bin/openwebmail /etc/openwebmail.conf
2./var/www/cgi-bin/openwebmail/etc/defaults/openwebmail.conf
3./var/www/cgi-bin/openwebmail/etc/defaults/dbm.conf
修改后的文件为
>>1./var/www/cgi-bin/openwebmail/etc/openwebmail.conf[只需修改1处domainnames supermaster.com //默认是auto],完整的内容如下:
#
# open webmail configuration file
#
# this file contains just the overrides from defaults/openwebmail.conf
# please make all changes to this file.
#
# this file sets options for all domains and all users.
# to set options on per domain basis, please put them in sites.conf/domainname
# to set options on per user basis, please put them in users.conf/username
#
releasedate 20041126
domainnames supermaster.com //默认是auto
auth_module auth_unix.pl
mailspooldir /var/spool/mail
ow_cgidir /var/www/cgi-bin/openwebmail
ow_cgiurl /cgi-bin/openwebmail
ow_htmldir /var/www/data/openwebmail
ow_htmlurl /data/openwebmail
logfile /var/log/openwebmail.log
# to sysadmin,
# please install clamav rpm package from in order to
# enable viruscheck with open webmail. otherwise set it to no.
# see ... howto/virus/clamav/
# for a step-by-step instruction.
enable_viruscheck yes
viruscheck_pipe /usr/bin/clamdscan --mbox --disable-summary --stdout -
viruscheck_source_allowed all
enable_spamcheck no
enable_learnspam no
%name%
version %version%
%help_text%?
logo_url %ow_htmlurl%/images/openwebmail.gif
logo_link
help_url @@@help_url@@@
help_text @@@help_text@@@
spellcheck /usr/bin/aspell -a -s -w "-" -d @@@dictionary@@@ -p @@@pdicname@@@
spellcheck_pdicname .aspell.@@@dictionary@@@.pws
spellcheck_dictionaries english, american
auto_createrc yes
############################################
# buttons :
# editfroms | editstationary | pop3setup | changepassword | history | info
enable_editfrombook yes
enable_stationery yes
enable_pop3 yes
enable_changepwd yes
enable_history yes
enable_about yes
##############################################
# personal information
default_language en
default_timeoffset auto
default_daylightsaving auto
default_realname auto
default_fromemails auto
default_autoreplysubject this is an autoreply...[re: $subject]
hello,
i will not be reading my mail for a while.
your mail regarding '$subject' will be read when i return.
--
open webmail project ()
##############################################
# display preference
default_style default
default_iconset cool3d.english
default_bgurl %ow_htmlurl%/images/backgrounds/globe.gif
default_bgrepeat yes
default_fontsize 10pt
default_dateformat mm/dd/yyyy
default_hourformat 12
############################################
# folder browsing
default_ctrlposition_folderview bottom
default_msgsperpage 20
default_fieldorder date from subject size
default_sort date
default_useminisearchicon yes
############################################
# message operation
default_confirmmsgmovecopy no
default_defaultdestination saved-messages
default_smartdestination yes
default_viewnextaftermsgmovecopy yes
default_autopop3 yes
default_autopop3wait 0
default_bgfilterwait 10
default_moveoldmsgfrominbox no
############################################
# message reading options
default_ctrlposition_msgread bottom
default_headers simple
default_usefixedfont no
default_usesmileicon no
default_showhtmlastext yes
default_showimgaslink yes
default_disablejs yes
default_disableembcode yes
default_disableemblink cgionly
default_sendreceipt ask
############################################
# message replying options
default_msgformat text
default_editcolumns 88
default_editrows 28
default_sendbuttonposition before
default_reparagraphorigmsg yes
default_replywithorigmsg at_beginning
default_backupsentmsg yes
default_sendcharset sameascomposing
############################################
# virus check
default_viruscheck_source all
default_viruscheck_maxsize 10000
default_viruscheck_minbodysize 1
############################################
# message filtering options
default_filter_repeatlimit 10
default_filter_badaddrformat no
default_filter_fakedsmtp no
default_filter_fakedfrom no
default_filter_fakedexecontenttype no
############################################
# addressbook options
default_abook_width 600
default_abook_height max
default_abook_buttonposition after
default_abook_defaultfilter no
default_abook_defaultsearchtype name
default_abook_addrperpage 24
default_abook_collapse 1
default_abook_sort fullname
default_abook_listviewfieldorder fullname, email, note
############################################
# calendar options
default_calendar_defaultview calmonth
default_calendar_holidaydef auto
default_calendar_monthviewnumitems 5
default_calendar_weekstart 0
default_calendar_starthour 0600
default_calendar_endhour 2300
default_calendar_interval 30
default_calendar_showemptyhours yes
default_calendar_reminderdays 7
default_calendar_reminderforglobal yes
############################################
# webdisk options
default_webdisk_dirnumitems 10
default_webdisk_confirmmovecopy yes
default_webdisk_confirmdel yes
default_webdisk_confirmcompress yes
default_webdisk_fileeditcolumns 96
default_webdisk_fileeditrows 24
############################################
# misc options
default_uselightbar yes
default_regexmatch yes
default_hideinternal yes
default_newmailsound none
default_newmailwindowtime 3
default_mailsentwindowtime 0
default_dictionary english
default_trashreserveddays 0
default_spamvirusreserveddays 3
default_refreshinterval 5
default_sessiontimeout 24
############################################
# security settings
webdisk_rootpath /webdisk
webdisk_lsmailfolder no
webdisk_lshidden no
webdisk_lsunixspec no
webdisk_lssymlink yes
webdisk_allow_symlinkout yes
webdisk_symlinkout_display @
enable_sshterm no
# ps: to completely disable the ssh terminal support, you have to remove
# the file data/openwebmail/applet/mindterm/mindtermfull.jar
############################################
# quota system (limit in kb and threshold in %)
# 1 mb = 1,024 kb
# 10 mb = 10,240 kb
# 100 mb = 102,400 kb
# 1 gb = 1,024 mb = 1,048,576 kb
# uncomment following lines if you wish to enable quota system for 10 mb
#quota_module quota_du.pl
#spool_limit 10240
#quota_limit 10240
#quota_threshold 0
#delmail_ifquotahit no
#delfile_ifquotahit no
>>2./var/www/cgi-bin/openwebmail/etc/defaults/openwebmail.conf [只需修改2处,把smtpserver和authpop3_server改为相应的ip],完整的内容如下:
#
# open webmail configuration file default
#
# this is openwebmail.conf.default - a file full of useful variables that
# you can set for the openwebmail system. you should not edit this file!
# put any overrides into openwebmail.conf instead. the openwebmail.conf
# should only contain values which override values set in this file.
# this eases the upgrade when defaults are changed or new features are added.
#
# please refer to openwebmail.conf.help for description of each option
#
# ps: this file will be loaded only once if open webmail is running in
# persistent mode. to force open webmail reread this file, please do
#
# touch openwebmail*pl
#
name open webmail
version 2.41
releasedate 20041126
##############################################################################
# host dependent configuration
##############################################################################
domainnames auto
smtpserver 192.168.0.111
smtpport 25
smtpauth no
virtusertable /etc/mail/virtusertable
auth_module auth_unix.pl
auth_withdomain no
auth_domain auto
quota_module none
mailspooldir /var/mail
use_hashedmailspools no
use_syshomedir yes
create_syshomedir no
use_homedirspools no
homedirspoolname mailbox
homedirfolderdirname mail
homedirdotdirname .openwebmail
use_syshomedir_for_dotdir yes
deliver_use_gmt no
##############################################################################
# openwebmail system configuration
##############################################################################
ow_cgidir /usr/local/www/cgi-bin/openwebmail
ow_cgiurl /cgi-bin/openwebmail
ow_htmldir /usr/local/www/data/openwebmail
ow_htmlurl /openwebmail
ow_etcdir %ow_cgidir%/etc
ow_stylesdir %ow_etcdir%/styles
ow_langdir %ow_etcdir%/lang
ow_templatesdir %ow_etcdir%/templates
ow_holidaysdir %ow_etcdir%/holidays
ow_mapsdir %ow_etcdir%/maps
ow_sitesconfdir %ow_etcdir%/sites.conf
ow_usersconfdir %ow_etcdir%/users.conf
ow_usersdir %ow_etcdir%/users
ow_sessionsdir %ow_etcdir%/sessions
start_url %ow_cgiurl%/openwebmail.pl
ico_url %ow_htmlurl%/images/openwebmail.ico
logo_url %ow_htmlurl%/images/openwebmail.gif
logo_link
help_url @@@help_url@@@
help_text @@@help_text@@@
logfile /var/log/openwebmail.log
global_addressbook %ow_etcdir%/address.book
global_filterbook %ow_etcdir%/filter.book
global_calendarbook %ow_etcdir%/calendar.book
g2b_map %ow_mapsdir%/g2b.map
b2g_map %ow_mapsdir%/b2g.map
lunar_map %ow_mapsdir%/lunar.map
header_pluginfile none
header_pluginfile_charset none
footer_pluginfile none
footer_pluginfile_charset none
webmail_middle_pluginfile none
webmail_middle_pluginfile_charset none
spellcheck /usr/local/bin/ispell -a -s -w "-" -d @@@dictionary@@@ -p @@@pdicname@@@
spellcheck_pdicname .ispell_words
spellcheck_dictionaries english, american
vacationinit %ow_cgidir%/vacation.pl -i
vacationpipe %ow_cgidir%/vacation.pl -t60s
error_with_debuginfo no
allowed_serverdomain all
allowed_clientdomain all
allowed_clientip all
allowed_receiverdomain all
allowed_autologinip all
allowed_rootloginip none
case_insensitive_login no
forced_ssl_login no
stay_ssl_afterlogin yes
enable_domainselectmenu no
domainselmenu_list auto
enable_strictvirtuser no
enable_changepwd yes
enable_strictpwd yes
passwd_minlen 6
session_multilogin yes
session_checkcookie yes
session_checksameip no
session_count_display yes
cache_userinfo yes
auto_createrc no
domainnames_override no
symboliclink_mbox yes
enable_webmail yes
enable_userfolders yes
enable_spellcheck yes
enable_advsearch yes
enable_addressbook yes
enable_calendar yes
enable_webdisk yes
enable_sshterm yes
enable_vdomain no
enable_preference yes
enable_history yes
enable_about yes
about_info_software yes
about_info_scriptfilename no
about_info_protocol yes
about_info_server yes
about_info_client yes
x-mailer: %name% %version% %releasedate%
x-originatingip: @@@clientip@@@ (@@@userid@@@)
enable_loadfrombook yes
enable_editfrombook yes
frombook_for_realname_only no
enable_autoreply yes
enable_setforward yes
enable_strictforward no
enable_stationery yes
enable_savedraft yes
enable_backupsent yes
enable_globalfilter yes
enable_userfilter yes
enable_smartfilter yes
smartfilter_bypass_goodmessage yes
log_filter_detail no
enable_viruscheck no
viruscheck_pipe /usr/local/bin/clamdscan --disable-summary --stdout -
viruscheck_source_allowed pop3
viruscheck_maxsize_allowed 50000
virus_destination virus-mail
has_virusfolder_by_default yes
enable_spamcheck no
spamcheck_pipe /usr/local/bin/spamc -c -x -t60 -u @@@username@@@
spamcheck_source_allowed pop3
spamcheck_maxsize_allowed 1000
spam_destination spam-mail
has_spamfolder_by_default yes
enable_learnspam no
learnspam_pipe /usr/local/bin/sa-learn --spam
learnham_pipe /usr/local/bin/sa-learn --ham
learnspam_destination spam-mail
learnham_destination inbox
enable_pop3 yes
pop3_disallowed_servers your_server, your_server.domain
pop3_delmail_by_default yes
pop3_delmail_hidden no
pop3_usessl_by_default no
authpop3_server 192.168.0.111
authpop3_port 110
authpop3_getmail no
authpop3_delmail yes
authpop3_usessl no
loginerrordelay 10
fetchpop3interval 15
calendar_email_notifyinterval 120
enable_strictfoldername no
foldername_maxlen 32
maxbooksize 32
attlimit 50000
abook_maxsizeallbooks 100
abook_globaleditable yes
abook_importlimit 250
abook_attlimit 25
webdisk_rootpath /
webdisk_readonly no
webdisk_uploadlimit 50000
webdisk_lsmailfolder yes
webdisk_lshidden yes
webdisk_lsunixspec yes
webdisk_lssymlink yes
webdisk_allow_symlinkcreate yes
webdisk_allow_symlinkout yes
webdisk_symlinkout_display path
webdisk_allow_thumbnail yes
webdisk_allow_untar yes
webdisk_allow_unzip yes
webdisk_allow_unrar yes
webdisk_allow_unarj yes
webdisk_allow_unlzh yes
spool_limit 0
quota_limit 0
quota_threshold 75
delmail_ifquotahit no
delfile_ifquotahit no
vdomain_admlist sysadm
vdomain_maxuser 100
vdomain_maxalias 100
vdomain_vmpop3_pwdpath /etc/virtual
vdomain_vmpop3_pwdname passwd
vdomain_vmpop3_mailpath /var/spool/virtual
vdomain_postfix_aliases /etc/postfix/aliases
vdomain_postfix_virtual /etc/postfix/virtual
vdomain_postfix_postalias /usr/sbin/postalias
vdomain_postfix_postmap /usr/sbin/postmap
vdomain_mailbox_command none
localusers none
%name%
version %version%
%help_text%?
##############################################################################
# default setting for new user's preference
##############################################################################
default_language auto
default_charset auto
default_timeoffset auto
default_daylightsaving auto
default_realname auto
default_fromemails auto
default_autoreplysubject this is an autoreply...[re: $subject]
hello,
i will not be reading my mail for a while.
your mail regarding '$subject' will be read when i return.
--
open webmail project ()
default_style default
default_iconset default
default_bgurl %ow_htmlurl%/images/backgrounds/globe.gif
default_bgrepeat yes
default_fontsize 10pt
default_dateformat mm/dd/yyyy
default_hourformat 12
default_ctrlposition_folderview top
default_msgsperpage 10
default_fieldorder date from subject size
default_sort date
default_useminisearchicon yes
default_confirmmsgmovecopy yes
default_defaultdestination saved-messages
default_smartdestination yes
default_viewnextaftermsgmovecopy yes
default_autopop3 yes
default_autopop3wait 0
default_bgfilterwait 10
default_moveoldmsgfrominbox no
forced_moveoldmsgfrominbox no
default_ctrlposition_msgread top
default_headers simple
default_showhtmlastext no
default_showimgaslink no
default_usefixedfont no
default_usesmileicon yes
default_disablejs yes
default_disableembcode yes
default_disableemblink cgionly
default_sendreceipt ask
default_msgformat auto
default_editcolumns 78
default_editrows 24
default_sendbuttonposition before
default_reparagraphorigmsg yes
default_replywithorigmsg at_beginning
default_backupsentmsg yes
default_sendcharset sameascomposing
default_fscharset none
default_uselightbar yes
default_regexmatch yes
default_hideinternal yes
default_refreshinterval 20
min_refreshinterval 3
default_newmailsound yougotmail.english.wav
default_newmailwindowtime 7
default_mailsentwindowtime 5
default_dictionary english
default_trashreserveddays 7
default_spamvirusreserveddays 3
default_sessiontimeout 60
default_viruscheck_source pop3
default_viruscheck_maxsize 10000
default_viruscheck_minbodysize 1
default_spamcheck_source pop3
default_spamcheck_maxsize 250
default_spamcheck_threshold 10
default_filter_repeatlimit 10
default_filter_badaddrformat no
default_filter_fakedsmtp no
default_filter_fakedfrom no
default_filter_fakedexecontenttype no
default_abook_width 600
default_abook_height 400
default_abook_buttonposition after
default_abook_defaultfilter no
default_abook_defaultsearchtype none
default_abook_defaultkeyword none
default_abook_addrperpage 10
default_abook_collapse 1
default_abook_sort fullname
default_abook_listviewfieldorder fullname,email,phone,note
default_calendar_defaultview calmonth
default_calendar_holidaydef auto
default_calendar_monthviewnumitems 5
default_calendar_weekstart 0
default_calendar_starthour 0800
default_calendar_endhour 1700
default_calendar_interval 30
default_calendar_showemptyhours yes
default_calendar_reminderdays 7
default_calendar_reminderforglobal yes
default_webdisk_dirnumitems 10
default_webdisk_confirmmovecopy yes
default_webdisk_confirmdel yes
default_webdisk_confirmcompress yes
default_webdisk_fileeditcolumns 96
default_webdisk_fileeditrows 24
>>3./var/www/cgi-bin/openwebmail/etc/defaults/dbm.conf[只需修改3处],完整的内容如下:
#
# config file for dbm.pl
#
# dbm_ext
# -----------------------------------------------------------------------
# this is the extension name for the dbm file on your system
#
# ps: you can run 'perl openwebmail/misc/test/dbmtest.pl' to get value for this
# dbmopen_ext
# -----------------------------------------------------------------------
# this is the db extension passed to the dbmopen() call.
# it should be set to 'none' in most case. you need to set it to %dbm_ext%
# only if you use any db file module in script explicitly
#
# ps: it is said this option needs to be set to '%dbm_ext%' on the sun
# cobal server or slackware 8.x.
# you can run 'perl openwebmail/misc/test/dbmtest.pl' to get value for this
# dbmopen_haslock
# -----------------------------------------------------------------------
# if your perl dbm system will do filelock in dbmopen() by itself,
# set this option to 'yes' so openwebmail won't do unnecessary filelock
# before dbmopen. on most systems, this option should be set to 'no'.
#
# ps: if your openwebmail hangs after login or saving preference,
# you probablely need to set this option to 'y, es'
dbm_ext .db
dbmopen_ext .db
dbmopen_haslock yes
smtpserver 192.168.0.111 //添加smtp服务器的ip地址
ok,上面的文件修改完后,再运行./openwebmail-tool.pl –init执行初始化脚本
[root@as3 openwebmail]#./openwebmail-tool.pl --init
有关openwebmail的配置就完成了
step 3.修改apache的配置文件(httpd.conf)
[root@as3 openwebmail]#vi /etc/httpd/conf/httpd.conf
//添加如下语句
#===the start===
scriptalias /openwebmail "/var/www/cgi-bin/openwebmail/openwebmail.pl"
allowoverride none
options execcgi -indexes
order allow,deny
allow from all
alias /data "/var/www/data"
#===the end====
[root@as3 openwebmail]#service httpd restart //重启apache
现在所以的工作都完成了,新建用户去测试吧
step 4.进行owm测试