Friday, October 19, 2007

Install Openwebmail

OpenWebMail Installation


The latest stable release of OpenWebMail is 2.52. You can download it here:

http://openwebmail.acatysmoof.com/download/release/openwebmail-2.52.tar.gz

As we are using Fedora Core 5 Linux distribution, this installation howto is primarily for Fedora Core 5. But this can also be applied to RedHat and other Fedora versions.

Openwebmail is written in perl. So it requires that the perl package should be installed. Besides the perl package, OpenWebMail also requires the following perl modules:

perl-CGI
perl-Digest
perl-Digest-MD5
perl-MIME-Base64
perl-libnet

Fortunately, the perl package offered by Fedora Core 5 already contains all the above perl modules.

Openwebmail also requires the following programs:

perl-suidperl
aspell

Fedora Core 5 has the above 2 programs. So if you have not installed them, you can find them in the installation CD.

Text-Iconv
Text-Iconv: you can download the latest version at:

http://search.cpan.org/dist/Text-Iconv/

untar, compile, install:

tar xvfz Text-Iconv-x.x.tar.gz (x.x is the version number)
cd Text-Iconv-x.x
perl Makefile.PL
make
make test
make install

or, if you want, you can also build your own rpm. To do this, you need to install the latest cpan2rpm, then execute the command:

cpan2rpm Text-Iconv-x.x.tar.gz (This will produce perl-Text-Iconv-x.x-1.i386.rpm)

Now we will begin the OpenWebMail installation. I presume that the OpenWebMail program file is at:

/root/openwebmail-2.52.tar.gz

o First change to the apache root directory:

cd /var/www

o Untar openwebmail-2.52.tar.gz (note the options used).

tar -zxvBpf /root/openwebmail-2.52.tar.gz

o Two directories are created after untar:

data
cgi-bin/openwebmail

o Move the openwebmail sub-directory under data to html/

mv data/openwebmail html/

o Delete the already empty sub-drectory data:

rmdir data

o Now we have to edit the OpenWebMail configuration file:

Edit /var/www/cgi-bin/openwebmail/etc/openwebmail.conf, and change the following parameters:

mailspooldir /var/mail
== > /var/spool/mail
ow_cgidir /usr/local/www/cgi-bin/openwebmail
== > /var/www/cgi-bin/openwebmail
ow_htmldir /usr/local/www/data/openwebmail
== > /var/www/html/openwebmail

Add: spellcheck /usr/bin/aspell -a -S -w "-" -d @@@DICTIONARY@@@ -p @@@PDICNAME@@@
spellcheck_pdicname .aspell_words


To display the email message in the charset defined in the email header, add:

default_readwithmsgcharset yes
If your server has quota, then add:

quota_module quota_unixfs.pl

Note that if you want OpenWebMail to use quota, you need to install the perl quota module. You can download the latest source program at:

http://search.cpan.org/~tomzo/

Execute the following commands:


cd /var/www/cgi-bin/openwebmail/etc/
cp defaults/dbm.conf .
Edit dbm.conf and change:

dbm_ext .db
dbmopen_ext none ==> .db
dbmopen_haslock no

Execute the following commands:


cd /var/www/cgi-bin/openwebmail/etc/
cp defaults/auth_unix.conf .
Edit auth_unix.conf

passwdfile_encrypted /etc/master.passwd
==> /etc/shadow
passwdmkdb /usr/sbin/pwd_mkdb
==> none
check_shell no ==> yes

After editing the configuration files, execute:

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

This program will initialize openwebmail and will check if "dbm_ext, dbmopn_ext and dbmopen_haslock" are correct. If there is any error, follow the instructions given.

That's all. Now you can link to:

http://your.domain.edu.tw/cgi-bin/openwebmail/openwebmail.pl


If you find the URI a little too long and just want to type:

http://your.domain.edu.tw/openwebmail

then do the following:

cd /var/www/html/openwebmail
rm -f index.html
mv redirect.html index.html

If you find that openwebmail is a little too slow, I suggest that you use SpeedyCGI instead of suidperl.

o First, download the source program CGI-SpeedyCGI-2.22.tar.gz at:

http://daemoninc.com/SpeedyCGI/download.html

o Untar, compile, install:

tar xvfz CGI-SpeedyCGI-2.22.tar.gz
cd CGI-SpeedyCGI-2.2
perl Makefile.PL

When the message appear: Compile mod_speedycgi (default no)? just press Enter.
Edit speedy/Makefile. In line 150 (DEFINE = -DSPEEDY_PROGRAM) add -DIAMSUID at the end of the line.

make
make test

If there is no error:

make install

Or you may want to build an rpm instead. Before building the rpm, edit util/build_rpms.

Line 80: Serial: $serial ==> delete this line
Line 81: Change Copyright ==> License

make package

Warning! 'rpm' may core dump if you are not root.
Hit enter to continue:
Linux distribution [RedHat]: fedora
Distribution version [package redhat-release is not installed]: 5
RPM Release [1]:


This will produce binaries/fedora-5-speedycgi-2.22-1.i386.rpm. Install:

rpm -Uvh fedora-5-speedycgi-2.22-1.i386.rpm

o Openwebmail requires a suid root speedy program. So after installing SpeedyCGI:

cd /usr/bin
cp speedy speedy_suidperl
chmod 4555 speedy_suidperl

Now you will want OpenWebMail to use speedy_suidperl instead of suidperl. Change directory to:

cd /var/www/cgi-bin/openwebmail

o To use SpeedyCGI you need to change all openwebmail*.pl shebang from:

#!/usr/bin/suidperl -T

and change to:

#!/usr/bin/speedy_suidperl

You can do this manually, of course. But it will take a little time. I suggest that you write a script (named ch2speedy):

#!/bin/bash
for name in open*.pl; do
if [ "$name" != "openwebmail-tool.pl" ]
then
cp -a $name ${name}.old
sed -e "s@suidperl -T@speedy_suidperl@" < ${name}.old > ${name}
fi
done

Please refer to: http://www.bluelavalamp.net/owmspeedycgi/

Make ch2speedy executable:

chmod 700 ch2speedy

Execute ch2speedy:

./ch2speedy

o Test your openwebmail installation using SpeedyCGI. If everything is working fine, you may delete all *.old files:

rm -f *.old


--------------------------------------------------------------------------------

Thanks for the tutorial :
Fr. Visminlu Vicente L. Chua, S.J.
2002/12/29
Updated: 2007/10/15

No comments:

Post a Comment