This is an installation of OpenWebmail to Ensim (RedHat), but these steps can be easily adapted to other boxes with very little modifications.
- Install Openwebmail
You will need the following perl modules:
CGI
MIME::Base64
libnet
Text::Iconv
Login as root.
To install it, you can use the command:
# perl -MCPAN -e 'install CGI'
# perl -MCPAN -e 'install MIME::Base64'
# perl -MCPAN -e 'install Bundle::libnet'
# perl -MCPAN -e 'install Text::Iconv'
Or (if you havenīt cpan installed):
Download the following packages (or their newer versions) and copy them to /tmp directory:
CGI.pm-2.74.tar.gz
MIME-Base64-2.12.tar.gz
libnet-1.0901.tar.gz
Text-Iconv-1.2.tar.gz
For CGI.pm do the following:
cd /tmp
tar -zxvf CGI.pm-2.74.tar.gz
cd CGI.pm-2.74
perl Makefile.PL
make
make install
For MIME-Base64 do the following:
cd /tmp
tar -zxvf MIME-Base64-2.12.tar.gz
cd MIME-Base64-2.12
perl Makefile.PL
make
make install
For libnet do the following:
cd /tmp
tar -zxvf libnet-1.0901.tar.gz
cd libnet-1.0901
perl Makefile.PL
make
make install
For Text-Iconv-1.2 do the following:
cd /tmp
tar -zxvf Text-Iconv-1.2.tar.gz
cd Text-Iconv-1.2
perl Makefile.PL
make
make test
make install
(Any problems?: see the README)
Now download and install your openwebmail software.
# cd /var/www
# wget http://openwebmail.org/openwebmail/downloa...ail-current.tgz
# tar -zxvBpf openwebmail-current.tgz
Alternatively, you can install rpm package:
# rpm -ivh http://openwebmail.com/openwebmail/downloa...2.51-1.i386.rpm
1)Check this address, or
2)If rpm is claiming about some dependencies in perl modules, try to install rpm versions of these perl modules, instead of install manually from cpan;
3)If upgrading, use "-Uvh" parameters to rpm, instead "-ivh".
Install auth_unix_ensim.pl file in /var/www/cgi-bin/openwebmail/ directory.
This is the heart of the Ensimīs OpenWebmail installation.
(Deprecated download for 1.x versions. although if really needed, pm me)
Download auth_unix_ensim.txt
###################
For Version 2.0+ only
###################
Was reported the howto works for version 2.0 or superior, with the installation of a different authentication file: auth_unix_ensim.v2.pl
###################
###################
For Version 2.30+ only
###################
Was reported the howto works for version 2.30 or superior, with the installation of a different authentication file: auth_unix_ensim.v2-30.pl
###################
Remember: Rename/save it to auth_unix_ensim.pl in /var/www/cgi-bin/openwebmail/ directory.
# mv data/openwebmail html
# rmdir data
# cd cgi-bin/openwebmail/etc
edit openwebmail.conf:
set mailspooldir to /var/spool/mail
ow_cgidir to /var/www/cgi-bin/openwebmail
ow_htmldir to /var/www/html/openwebmail
spellcheck to /usr/bin/aspell
auth_module to auth_unix_ensim.pl
include the following:
auth_withdomain yes
timeoffset +0800
(change the timeoffset to your taste)
OpenWebmail is feature rich, so you can change any other feature you like.
- Setup openwebmail.log rotation. (optional)
/var/log/openwebmail.log {
postrotate
/usr/bin/killall -HUP syslogd
endscript
}
to /etc/logrotate.d/syslog to enable logrotate on openwebmail.log
- Install domain files in /var/www/cgi-bin/openwebmail/etc/sites.conf
*** ATTENTION ***
In this installation, at this point your customer could until already to use Openwebmail
with no specific customization to a domain.
But the problem is the disk space will count to user 'root', group 'apache',
this is not good. The program will use the directory
/var/www/cgi-bin/openwebmail/etc/users to their folders. So, you must not
let your customer use Openwebmail without this domain file.
Comunicate them only AFTER installed this file. So, the userīs files will
be in /home/virtual/DOMAIN/home/USER directory, and the user quotas are always respected.
You need install one file DOMAIN per domain you need installed.
(The file name is *only* the domain, doesnīt append any suffix)
# cd /var/www/cgi-bin/openwebmail/etc/sites.conf
# pico DEFAULT
Copy and paste the following text:
***** Cut here (donīt include this line) *******************************
#
# Open WebMail configuration file
#
# This file contains just the overrides from openwebmail.conf.default
# 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
#
domainnames NEWDOMAIN
auth_module auth_unix_ensim.pl
mailspooldir /home/virtual/NEWDOMAIN/var/spool/mail
dbm_ext .db
dbmopen_ext none
dbmopen_haslock no
timeoffset +0800
ow_cgidir /var/www/cgi-bin/openwebmail
ow_cgiurl /cgi-bin/openwebmail
ow_htmldir /var/www/html/openwebmail
ow_htmlurl /openwebmail
logfile /var/log/openwebmail.log
spellcheck /usr/bin/aspell
# Virtual Space Configuration
use_homedirspools no
use_homedirfolders yes
enable_changepwd no
enable_autoreply no
enable_setforward yes
enable_setfromemail yes
getmail_from_pop3_authserver no
autopop3_at_refresh yes
auth_withdomain yes
default_language en_US
spellcheck_dictionaries english, american
default_dictionary english
default_dateformat mm/dd/yyyy
default_autoreplysubject This is an automatic response...[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 (http://openwebmail.org)
***** Cut here (donīt include this line) *******************************
Define the file of your specific domain:
(obviously substitute with domain.com with the domain you want configured)
# sed -e 's/NEWDOMAIN/domain.com/g'
When you need configure more domains, you could repeat only the step above to other domains.
Use OpenWebmail
You already can access in your browser:
https://www.DOMAIN/cgi-bin/openwebmail/openwebmail.pl
Login with 'user@domain.com', and your password.
*** Optional ***
- You could create aliases in /etc/httpd/conf/siteXX for each domain.
First discover what is the site number of your domain:
(obviously substitute DOMAIN with your domain)
# sitelookup -d DOMAIN|awk -F, '{print $3;}'
This will identificate what is the string you must substitute in 'XX' part, in siteXX:
(Check before if you donīt already have a file /etc/httpd/conf/siteXX/webmail)
echo "Redirect /webmail https://www.DOMAIN/cgi-bin/openwebmail/openwebmail.pl">>/etc/httpd/conf/siteXX/webmail
Restart httpd:
# service httpd restart
Use OpenWebmail
You already can access in your browser:
http://www.domain.com/webmail
You will redirected to:
https://www.DOMAIN/cgi-bin/openwebmail/openwebmail.pl
Login with 'user@domain.com', and your password.
Note:
This really will redirect to default cgi-bin directory installation,
as in "https://IP_ADDRESS/cgi-bin/openwebmail/openwebmail.pl", if DOMAIN have
none certificate installed. If you need to use a different certificate, other than
localhost.localdomain cert to a domain, you need to create a ScriptAlias directive
to '/var/www/cgi-bin/openwebmail' directory in apache in your domain configuration.
# echo "ScriptAlias /var/www/cgi-bin/webmail/ /var/www/cgi-bin/openwebmail/">>/etc/httpd/conf/siteXX/webmail
In this case (only), then you need create the redirect:
# echo "Redirect /webmail https://www.DOMAIN/cgi-bin/webmail/openwebmail.pl">>/etc/httpd/conf/siteXX/webmail
Benefits of install OpenWebmail:
-Many people think itīs better than Squirrelmail;
-Possible to only one installation globally on the server (localdomain.localhost cert)
-Saves the 9MB of Squirrelmail, per domain.
-Apropriates the disk space used to userīs quota
-Secure access via https for all
-Donīt affect Imap server
-Many language translations
-Work with speedycgi for better performance
Regards,
Netino