OpenWebMail

Open WebMail on CentOS

As usual, adding Repoforge repository is always recommended. The official repository for Open WebMail is added as well.

# cd /etc/yum.repos.d

# wget http://openwebmail.org/openwebmail/download/redhat/rpm/release/openwebmail.repo

Now, Open WebMail can be easily set up using yum command.

# yum install openwebmail perl-CGI httpd

Configuring Open WebMail

First of all, the file /var/www/cgi-bin/openwebmail/etc/dbm.conf is updated with the following parameters.

# vim /var/www/cgi-bin/openwebmail/etc/dbm.conf

## the previous values are overwritten ## dbm_ext                 .pag dbmopen_ext             none dbmopen_haslock         no

Then Open WebMail can be initialized with an installed script as follows.

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

The index.html file for Open WebMail is also prepared by using a soft link.

# ln -s /var/www/data/openwebmail/redirect.html /var/www/html/index.html

[Optional] The domain name for the mail server is defined manually to avoid any future mistakes in the @domain part of the mail address.

# vim /var/www/cgi-bin/openwebmail/etc/openwebmail.conf

domainnames             example.tst

The Apache web server is restarted.

# service httpd restart

# chkconfig httpd on

Finally, Open WebMail can be accessed by pointing the browser to the URL of the mail server: http://mail.example.tst OR http://IP-Address-of-Mail-Server

Some screenshots are provided below.

Open WebMail login page:

Open WebMail interface:

Open WebMail preferences:

Troubleshooting Open WebMail

Open WebMail may generate errors or behave abnormally if specific versions of some Perl packages are not installed. Fortunately, the packages are available in Open WebMail repository and are very easy to install. The following demonstrates how to install problematic Perl packages.

A folder is created to store the packages. It could be any folder.

# mkdir /var/www/data/openwebmail/packages

# cd /var/www/data/openwebmail/packages

Packages are downloaded.

# wget http://openwebmail.org/openwebmail/download/packages/CGI.pm-3.05.tar.gz

# wget http://openwebmail.org/openwebmail/download/packages/MIME-Base64-3.01.tar.gz

# wget http://openwebmail.org/openwebmail/download/packages/Text-Iconv-1.2.tar.gz

Install CGI.

# tar zxvf CGI.pm-3.05.tar.gz

# cd CGI.pm-3.05

# perl Makefile.PL; make; make install

Install MIME.

# tar zxvf MIME-Base64-3.01.tar.gz

# cd MIME-Base64-3.01

# perl Makefile.PL; make; make install

Install Text-Iconv.

# tar zxvf Text-Iconv-1.2.tar.gz

# cd Text-Iconv-1.2

# perl Makefile.PL; make; make install

How to install Open Webmail 2.54 on CentOS 7 ============================================ By Thomas Chung <tchung@openwebmail.org> Last Update 2018.12.03  ## CentOS 7 Release ## 2018.12.03 - Confirmed CentOS 7.6.1810 is compatible with OWM 2.54 2018.05.16 - Confirmed CentOS 7.5.1804 is compatible with OWM 2.54 2017.09.15 - Confirmed CentOS 7.4.1708 is compatible with OWM 2.54 2016.12.18 - Confirmed CentOS 7.3.1611 is compatible with OWM 2.54 2015.12.14 - Confirmed CentOS 7.2.1511 is compatible with OWM 2.54 2015.03.31 - Confirmed CentOS 7.1.1503 is compatible with OWM 2.54 2014.07.07 - Confirmed CentOS 7.0.1406 is compatible with OWM 2.54  Open Webmail 2.54 is a special release with 'suidperl C wrapper' to support CentOS 7 as  it does not include 'perl-suidperl' package any more.  Following tutorial is based on CentOS 7.0.1406 with 'Basic Web Server' Install Group.  Prerequisites: * Web Service (httpd) is running * Firewall Service (firewalld) with port 80 (http) and 25 (smtp) opened * C Compiler (gcc) for 'suidperl C wrapper' * SELinux permissive or disabled  References: * https://en.wikipedia.org/wiki/CentOS#CentOS_releases * https://wiki.centos.org/About/Product * https://wiki.centos.org/Manuals/ReleaseNotes * https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/ch-Web_Servers.html * https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Security_Guide/sec-Using_Firewalls.html  0) Enable and Start Web Service if not enabled # systemctl enable httpd # systemctl start httpd # systemctl status httpd   1) Enable and Start Firewall Service if not enabled # systemctl enable firewalld # systemctl start firewalld # systemctl status firewalld   2) Open port 80 (http) and 25 (smtp) if not opened # firewall-cmd --get-default-zone # firewall-cmd --zone=public --list-all # firewall-cmd --zone=public --permanent --add-service=http # firewall-cmd --zone=public --permanent --add-service=smtp # firewall-cmd --reload # firewall-cmd --zone=public --list-all   3) Install a Repostory File for CentOS 7 # cd /etc/yum.repo.d # wget ftp://openwebmail.org/pub/openwebmail/el7/openwebmail-el7.repo   4) Install Open Webmail 2.54 for CentOS 7 # yum install openwebmail ... Dependencies Resolved  ======================================================================================================  Package                           Arch                  Version Repository               Size ====================================================================================================== Installing:  openwebmail                       noarch                2.54-1.el7 openwebmail-el7          1.3 M Installing for dependencies:  openwebmail-data                  noarch                2.54-1.el7 openwebmail-el7          4.7 M  perl-Compress-Raw-Bzip2           x86_64                2.061-3.el7 base                      32 k  perl-Compress-Raw-Zlib            x86_64                1:2.061-4.el7 base                      57 k  perl-Digest                       noarch                1.17-245.el7 base                      23 k  perl-Digest-MD5                   x86_64                2.52-3.el7 base                      30 k  perl-IO-Compress                  noarch                2.061-2.el7 base                     260 k  perl-Text-Iconv                   x86_64                1.7-18.el7 base                      23 k  Transaction Summary ======================================================================================================= Install  1 Package (+7 Dependent packages)  Total download size: 6.5 M Installed size: 24 M Is this ok [y/d/N]: y .... Running transaction   Installing : perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64 1/8    Installing : perl-Digest-1.17-245.el7.noarch 2/8    Installing : perl-Digest-MD5-2.52-3.el7.x86_64 3/8    Installing : 1:perl-Compress-Raw-Zlib-2.061-4.el7.x86_64 4/8    Installing : perl-IO-Compress-2.061-2.el7.noarch 5/8    Installing : perl-Text-Iconv-1.7-18.el7.x86_64 6/8    Installing : openwebmail-2.54-1.el7.noarch 7/8  See post install instruction at: /usr/share/doc/openwebmail-2.54/openwebmail-post.txt   Installing : openwebmail-data-2.54-1.el7.noarch 8/8  .... Installed:   openwebmail.noarch 0:2.54-1.el7      5) Install C Compiler (gcc) if you haven't already # yum install gcc  UPDATE: perl-CGI and gcc will be installed as dependent packages now.   6) Configure Open Webmail 2.54 for CentOS 7 with 'openwebmail-tool' # openwebmail-tool --init  The version of Perl on your system (5.016003) does not support set user id. Attempting to wrap the openwebmail perl files in a C wrapper to enable set user id capability...     Found C compiler /usr/bin/cc    wrapping file: openwebmail-abook.pl...done    wrapping file: openwebmail-advsearch.pl...done    wrapping file: openwebmail-cal.pl...done    wrapping file: openwebmail-folder.pl...done    wrapping file: openwebmail-main.pl...done    wrapping file: openwebmail-prefs.pl...done    wrapping file: openwebmail-read.pl...done    wrapping file: openwebmail-saprefs.pl...done    wrapping file: openwebmail-send.pl...done    wrapping file: openwebmail-spell.pl...done    wrapping file: openwebmail-tool.pl...done    wrapping file: openwebmail-vdomain.pl...done    wrapping file: openwebmail-viewatt.pl...done    wrapping file: openwebmail-webdisk.pl...done    wrapping file: openwebmail.pl...done  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 3.10.0-123.el7.x86_64 x86_64 Perl: 5.016003 WebMail: OpenWebMail 2.54 20141206  7) Login following URL with a regular user account.    http://{{hostname}}/cgi-bin/openwebmail/openwebmail.pl   8) If you see following error, run 'openwebmail-tool --fix'    "/var/www/cgi-bin/openwebmail/.openwebmail.pl' must setuid to root"     If you see broken image, try restarting httpd     # systemctl restart httpd     If you following error, disable selinux    "Couldn't write /var/log/openwebmail.log! (Permission denied)"      # sestatus | grep ^Current     Current mode:                   enforcing      To disable temporarily, just run following:     # setenforce 0     # sestatus | grep ^Current     Current mode:                   permissive         To disable permanently, edit folowing file then reboot:      # vi /etc/selinux/config     SELINUX=disabled     # reboot (!!warning!! - this will reboot your system)     # sestatus (after system reboot)     SELinux status:                 disabled  If everything works, please consider making donation to support our project! http://openwebmail.org/support/

--------------------------------xxxxxxxxxxxxxxxxxxxX-----------------------------------------------------------------------

install Openwebmail.

Reference file: https://openwebmail.org/openwebmail/download/centos/el7/00.README.txt

Download repo

cd /etc/yum.repos.d/

wget ftp://openwebmail.org/pub/openwebmail/el7/openwebmail-el7.repo

Archive /etc/yum.repos.d/openwebmail-el7.repo

[openwebmail-el7] 

name = Open WebMail for EL7 

baseurl = ftp: //openwebmail.org/pub/openwebmail/el7 

enabled = 1 

gpgcheck = 1 

gpgkey = ftp: //openwebmail.org/pub/openwebmail/RPM-GPG- KEY-openwebmail

Install directly using yum

yum install openwebmail

initialization

openwebmail-tool –init

Fix permissions

openwebmail-tool –fix

Install mod_ssl, go https encrypted connection

yum install mod_ssl

systemctl restart httpd

firewall-cmd –permanent –add-service=https

firewall-cmd –reload

Force entry into the encrypted connection, prepare the redirected home page /var/www/html/index.html

<html>

<head>

<meta http-equiv="refresh" content="0; url=https://mail.vclass.local/cgi-bin/openwebmail/openwebmail.pl">

</head>

</html>

Browser only needs to enter a simple URL

Automatically redirect to Openwebmail's encrypted connection

You're done!

Updating the Repository and Installing Open WebMail on CentOS

As usual, adding Repoforge repository is always recommended. The official repository for Open WebMail is added as well.

# cd /etc/yum.repos.d

# wget http://openwebmail.org/openwebmail/download/redhat/rpm/release/openwebmail.repo

Now, Open WebMail can be easily set up using yum command.

# yum install openwebmail perl-CGI httpd

Configuring Open WebMail

First of all, the file /var/www/cgi-bin/openwebmail/etc/dbm.conf is updated with the following parameters.

# vim /var/www/cgi-bin/openwebmail/etc/dbm.conf

## the previous values are overwritten ## dbm_ext                 .pag dbmopen_ext             none dbmopen_haslock         no

Then Open WebMail can be initialized with an installed script as follows.

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

The index.html file for Open WebMail is also prepared by using a soft link.

# ln -s /var/www/data/openwebmail/redirect.html /var/www/html/index.html

[Optional] The domain name for the mail server is defined manually to avoid any future mistakes in the @domain part of the mail address.

# vim /var/www/cgi-bin/openwebmail/etc/openwebmail.conf

domainnames             example.tst

The Apache web server is restarted.

# service httpd restart

# chkconfig httpd on

Finally, Open WebMail can be accessed by pointing the browser to the URL of the mail server: http://mail.example.tst OR http://IP-Address-of-Mail-Server

Some screenshots are provided below.

Open WebMail login page:

ad

Open WebMail interface:

Open WebMail preferences:

Troubleshooting Open WebMail

Open WebMail may generate errors or behave abnormally if specific versions of some Perl packages are not installed. Fortunately, the packages are available in Open WebMail repository and are very easy to install. The following demonstrates how to install problematic Perl packages.

A folder is created to store the packages. It could be any folder.

# mkdir /var/www/data/openwebmail/packages

# cd /var/www/data/openwebmail/packages

Packages are downloaded.

# wget http://openwebmail.org/openwebmail/download/packages/CGI.pm-3.05.tar.gz

# wget http://openwebmail.org/openwebmail/download/packages/MIME-Base64-3.01.tar.gz

# wget http://openwebmail.org/openwebmail/download/packages/Text-Iconv-1.2.tar.gz

Install CGI.

# tar zxvf CGI.pm-3.05.tar.gz

# cd CGI.pm-3.05

# perl Makefile.PL; make; make install

Install MIME.

# tar zxvf MIME-Base64-3.01.tar.gz

# cd MIME-Base64-3.01

# perl Makefile.PL; make; make install

Install Text-Iconv.

# tar zxvf Text-Iconv-1.2.tar.gz

# cd Text-Iconv-1.2

# perl Makefile.PL; make; make install

To sum up, Open WebMail interface may be a bit old school, but it is a complete package pre-built with often needed features. Besides, the installation process is easy, and the interface is very lightweight. Open WebMail is certainly a worthy candidate when a simple webmail interface is needed.