README for WebMail v0.7.2

I. Contents

  1. Contents
  2. What is WebMail
  3. Installation
  4. Configuration
  5. User Authentication
  6. Usage
  7. Different Languages, Translating WebMail
  8. Notes
  9. SSL Support (standalone installation)
  10. JDK Installation And Other Java Issues
  11. License
  12. Contributed Documentation
  13. Credits
Top of section "Contents"

II. What is WebMail

WebMail is a server application that allows ISPs to provide a WWW interface for each user to his mailbox(es) (similar to the programs YahooMail or HotMail use). WebMail should scale well enough to support large userbases and should be easy enough to be used in a home LAN.

2.1. Features

Features include:

Top of section "Features"

2.2. Whom WebMail is aimed at

Who should use WebMail:
WebMail's primary goal is to provide ISPs, companies and universities with a simple and zero-cost solution to give WWW mailaccess to their users.
Users can read and write their email while they are sitting in an Internet-Cafe, at expositions, etc without having to carry their PC around.
It is not intended as a replacement for the different personal email clients, but as a supplement for an existing mail solution.
The secondary goal is to unify a user's different email accounts under one interface which is easily accomplished using WebMails folder capability.

Top of section "Whom WebMail is aimed at"
Top of section "What is WebMail"

III. Installation

3.1. Introduction

There are two different ways to install WebMail, the standalone installation and the Java Servlet installation. Which one you should choose depends on what you plan to do with WebMail:

Top of section "Introduction"

3.2. Standalone Server

Note:On RedHat and Debian Linux systems you will probably first want to have a look at the RedHat and Debian sections in the Servlet installation instructions

3.2.1. Requirements

To run WebMail properly on your server, you need to have the following software installed:

WebMail has been successfully tested on:

WebMail will make profit of multiprocessor machines (e.g. Sun Enterprise 450) as it is multithreaded in large parts.

Top of section "Requirements"

3.2.2. Binary Installation

  1. Change to the prefix where you want to install WebMail (e.g. /usr/local)
  2. Unpack the tar.gz or zip archive: tar xzvf webmail-0.7.0.tar.gz
  3. Change to webmail/bin
  4. Edit the file webmail.sh if necessary
  5. Start WebMail using the provided script ./webmail.sh >> stdout.log 2>&1 &
  6. See Configuration for further steps to take.

Top of section "Binary Installation"

3.2.3. Source Installation

Note:Source installation will definately only work on Unix systems!
Note:Source installation is only really useful for developers since you don't need to (and cannot) adapt the program to your specific system settings in Java and I already compile with optimization turned on.

Additional requirements:

To install the source distribution of WebMail you will have to take the following steps:

  1. Change to the src/ subdirectory
  2. Set the CLASSPATH environment variable to your classes.zip (JDK 1.1) or rt.jar (JDK 1.2) archives (on Solaris: /usr/java1.1/lib/classes.zip for JDK 1.1 and /usr/java1.2/jre/lib/rt.jar for JDK 1.2)
  3. Have a look at the makefile and edit it if necessary
  4. Call "make" to compile the classfiles and create the archives (containing classfiles, language dependent HTML templates and images).
    You will find the compiled archives in the lib/ directory when the compilation was successful.
  5. See steps 3 to 5 from binary installation then

Top of section "Source Installation"Top of section "Standalone Server"

3.3. Servlet Installation

Running WebMail as a Servlet has several advantages over the standalone installation (and also some disadvantages):

Before trying this, please ensure that you are familiar with your Webserver's Servlet configuration. I provided a sample zone file for Apache, though (but you will have to do many modifications concerning the initArgs at the end of the file).

To make use of this feature you have to:

  1. Configure your webserver to run Java Servlets
  2. Add the net.wastl.webmail.servlet.WebMailServlet servlet to your servlet repository (and add all the jar files provided here to the classpath)
  3. Add the necessary initArgs to the servlet configuration for WebMail. These are:
    webmail.plugin.path Path to the plugin directory
    webmail.auth.path Path to the authenticator directory
    webmail.data.path Path were data will be stored (this has to be writeable by the process owner of the webserver)
    webmail.lib.path Path to WebMail libraries
    webmail.template.path Path to language dependent template files
    webmail.storage Set this to net.wastl.webmail.storage.simple.SimpleStorage for the simple storage. Other storage methods might come in the future
  4. Ensure that all webmail directories are readable for the WWW-user and that the data directory is writeable by the WWW user.

To simplify the above, I provided an Apache JServ zone file called webmail-servlet.properties in the root directory. You will just have to i modify this file to fit your configuration (mainly the initArgs at the bottom of the file), add a new zone to your Apache configuration and then call webmail with http://www.yourdomain.top/[mountpoint]/webmail

Please note that I haven't tested this with a different server than Apache.

3.3.1. RedHat Installation

Installation on RedHat systems should be as easy as possible: You need to have a running Apache installation. Install the following RPM packages (you can find them on the WebMail homepage at http://jwebmail.sourceforge.net) in the following order:

You will then have a running WebMail Servlet at http://yourhost/webmail/webmail when you restart your Apache webserver. Please don't forget to change your configuration by going to http://yourhost/webmail/webmail/admin and logging in with "Secret" (and don't forget to change the password!).

Note:This installation instruction (and the RPMs found on the WebMail homepage) are for RedHat 6.2 only. That means they may or may not work on RedHat versions lower than 6.2
Top of section "RedHat Installation"

3.3.2. Debian Installation

Installation on Debian woody is as simple as on RedHat. You will have to install Apache JServ with apt-get (apt-get install jserv will install the necessary packages) and then install the WebMail package (with dpkg --install webmail*.deb).
You will then have a running WebMail Servlet at http://yourhost/webmail/webmail when you restart your Apache webserver. Please don't forget to change your configuration by going to http://yourhost/webmail/webmail/admin and logging in with "Secret" (and don't forget to change the password!).

You might want to install a more up-to-date JDK to run WebMail properly, I will try to make a Debian package available for JDK 1.2.2, but you can also simply install a tar of the most up-to-date JDK and update the links in /etc/alternatives:

Replace <YOUR_JDK> part with the path of your JDK installation (e.g. jdk1.3) and the "130" with the version information (130 is for jdk 1.3, jdk1.2.2 would get 122).

Note:This installation instruction (and the DEBs found on the WebMail homepage) are for Debian woody only. That means they may or may not work on Debian potato and slink
Top of section "Debian Installation"Top of section "Servlet Installation"

3.4. Storage Methods

By default, WebMail uses a so-called SimpleStorage to store user and system configurations, i.e. the data is stored in separate XML-files.

Note: WebMail used to have a database storage in a 0.7 prerelease. Unfortunately this has become obsolete with the XML user model and needs to be re-implemented. I plan to do this in one of the next releases
Top of section "Storage Methods"
Top of section "Installation"

IV. Configuration

WebMail has an administration interface which allows you to perform several runtime administration tasks, including:

4.1. WebMail Administrator Plugin

4.1.1. Connecting

You can connect to the administration interface with your browser by simply entering the URL http(s)://webmail_server:port/admin in the address field of your browser. (set http/https and replace webmail_server and port with the correct values; port is usually port 6789 after the first start on a standalone server; on a servlet installation you will very likely have to add the WebMail mountpoint before the /admin).

You'll be presented the administrator's login screen then. Enter the password there (on first startup the password is "Secret") and click the login button. You should see the system settings form then.

Top of section "Connecting"

4.1.2. System Settings

The first page gives you a list of WebMail system variables and their values. You can change any variables you like (there is a short description for each of them) and then hit the submit button on the bottom of the page.

There are basically 4 kinds of input fields (although you will probably only recognize 2 on first look):

All of these fields will check whether the value entered is (more or less) correct if you submit the form.

Note:Special note on password fields: The password is shown encrypted (Unix crypt()), but if you want to change your password, please enter it in plain text. It will then show up encrypted again, after you hit the submit button (but still be the password you just entered).

To shutdown or restart the WebMail server, enter the time in seconds until the action will be performed and hit the appropriate button ("SHUTDOWN" or "REBOOT"). ATTENTION: You will not get anything like an answer after you do this (since you are shutting down the server this is quite difficult) and you will not be asked whether you really want to do this! Most likely you will get a "connection timed out" or "document contains no data" dialog.

Top of section "System Settings"

4.1.3. WebMail Virtual Domain Support

Virtual Domains in WebMail are a quite new concept (thanks to Oswaldo E. Aguirre M. for the idea).

They basically provide the following features:

Naturally, with this concept you will need to have at least one domain even if you don't plan to use virtual domains really.

The WebMail virtual domain setup form is quite simple and self explanatory, I think. There is one column where you have to enter the domain name, one where you have to enter this domain's default host (user's primary folder host), one for the authenti- cation host (not necessarily the same as the default host), and some fields that control the restrictions for users of this domain. With the checkbox, you can turn on/off host restriction completely, in the allowed hosts column, you can enter a comma-separated list of domains/hosts where users may access IMAP folders (e.g. "wastl.net" would allow them to use "mail.wastl.net" and "pop.wastl.net" while setting it to "mail.wastl.net" would just allow "mail.wastl.net" (and certainly "imap.mail.watl.net") and so on (suffix is matched to say it simple)).

Top of section "WebMail Virtual Domain Support"

4.1.4. Editing Users

You can add, edit and delete users from the administration interface (Note that you don't have to create users before they may use WebMail since they get default settings when they first log on authenticating against IMAP, POP or Unix).

To create a user,

To edit a user,

To delete a user,

Top of section "Editing Users"

4.1.5. Viewing WebMail Status

Last but not least you can get an overview of currently active sessions with the "view sessions" link. You will get some status information there as well as the possibility to explicitly kill an active session (whatever maybe the reason). Please be careful however with this feature, as you are very likely to kill a session that is currently in use and its user will probably not be very happy about that. The sessions will expire after a configured time anyway.

The Administrator Interface is currently available in English only, but the templates are already prepared for translation The system's default language will then be used (determined by the LANG environment setting).

I hope the rest is quite self explanatory at the moment, but I'll add some documentation later.

Top of section "Viewing WebMail Status"Top of section "WebMail Administrator Plugin"

4.2. File-Based Shutdown

You can initiate a WebMail shutdown when you create a file "shutdown" (or whatever you configured) in the data directory with only the admin password in it. This option can be disabled. It is useful in automatic system startup/shutdown.

Top of section "File-Based Shutdown"
Top of section "Configuration"

V. User Authentication

WebMail supports extended user authentication. At the moment, the following authentication methods are supported:

Changing authentication method can be achieved using the Administration Interface and changing the "AUTH" variable. For IMAP authentication there is an extra configuration variable called "AUTHHOST".

Top of section "User Authentication"

VI. Usage

6.1. General Usage

The WebMail daemon listens on whatever port you have configure. Just point your browser´s URL to http://yourhost:yourport/ and see the login screen.

A user will get the password he logs in with the first time. Passwords may be changed by the user in the options dialog. WebMail will try to establish a default connection to the configured default IMAP host with the user ID and password it was given, so it may be useful to use the same ID and password as on the IMAP host.

For further information, just click on the "?" at the navigation bar.

WebMail should also work with Proxy Servers and other Clients than Netscape Communicator.

Top of section "General Usage"

6.2. Folders

WebMail supports as many IMAP folders on as many different hosts you like.

WebMail mailboxes are configured by each user, however the administrator can change the default mailbox for each virtual domain. The default mailbox is the mailbox the user gets on the first login. He can than choose to remove it at any time and also add other mailboxes (the administrator can restrict that in the virtual domain configuration).

Top of section "Folders"
Top of section "Usage"

VII. Different Languages, Translating WebMail

WebMail supports the usage of different languages on a per user basis. Since v0.6.0 WebMail scans for available languages automatically and adds the corresponding locales to the user's setup dialog ("de" will add the locales "de_DE", "de_AT", "de_CH", ...).
To translate WebMail to a new language, please read the file "Translating" in the developers' documentation (source only).

Top of section "Different Languages, Translating WebMail"

VIII. Notes

8.1. WebMail Status

WebMail v0.7 is considered BETA, as not all features I want for a "1.0" are yet included.

Things I think of are:

Top of section "WebMail Status"

8.2. Changes

See the file "Changes" for a list of changes in the different WebMail releases.

Top of section "Changes"
Top of section "Notes"

IX. SSL Support (standalone installation)

Since WebMail 0.7.0, there is finally a free SSL implementation available for Java called ITI-SSL.

Installation is simple:

However, SSL in WebMail has some drawbacks:

If you compile ITI-SSL yourself, please ensure that you use openssl-0.9.4 for compilation because Netscape and IE won't work with WebMail SSL with prior versions.

Top of section "SSL Support (standalone installation)"

X. JDK Installation And Other Java Issues

10.1. What is Java

Note:I'll make it short here as Java is pretty well known and documented.

Java is a platform independent, object-oriented (OO) programming language. Java programs are compiled using the JDK Compiler (javac) or other compilers (e.g. IBM jikes). The resulting bytecode is optimized for the Java Virtual Machine (JVM) and still platform independent.
The JVM interpretes the previously compiled bytecode and translates it "on the fly" into platform dependent system calls. Therefore a JVM must exist for your platform in order to run Java programs.
You'll obviously recognize that Java is an interpreted language similar to Perl or Python. The most sigificant difference to the former two is that Java is precompiled.
So Java is a kind of compromise between purely interpreted languages and languages that are compiled to machine code which tries to combine the advantages of both (reliability and speed). As far as i know, this principle is derived from PROLOG.

Top of section "What is Java"

10.2. Where to obtain Java for your platform

The main Java distribution site is http://java.sun.com.
You will get the "officially supported" platforms and lots of documentation and additions there.

Java distributions for the different platforms:
Solaris SPARC and x86http://java.sun.com
Windows:http://java.sun.com
Linux/x86:http://www.ibm.com (IBM JDK 1.1.8 / IBM JDK 1.3)
http://www.blackdown.org (Blackdown port of JDK 1.2)
http://java.sun.com (Sun and Inprise port of JDK 1.2 / JDK 1.3)
Linux/PPC:http://business.tyler.wm.edu/mklinux/
Linux/Alpha:http://www.voicenet.com/~gatgul/JDK/java-alpha.html
Linux/SPARC:http://tinukai.sesuadra.org/~jdk/
AIX:http://www.ibm.com
Macintosh:http://applejava.apple.com
OS/2:http://www.ibm.com
FreeBSD:http://www.freebsd.org/ports/lang.html

Top of section "Where to obtain Java for your platform"

10.3. How to install Java properly

Use your system's standard facility to install the Java packages. Note that the Linux JDK most likely comes as "tar.gz" and not as .rpm or .deb, so you will have to manually install it using tar.

On Solaris, the JDK will install in /usr/java1.x/ by default. On Linux, I prefer installing the "tar.gz" in /usr/local and renaming the extracted path to "java1.x". Many distributions, however, will install Java in /usr/lib/java1.x or /usr/lib/jdkxxx.

Next, link all programs in the bin/ directory to somewhere in your path (e.g. /usr/local/bin) or alternativly add the bin/ directory to your PATH environment.

Last, set your CLASSPATH environment variable (e.g. in /etc/profile) to

You should have a running system now. Test it by typing "java -version".

Special note for Linux users: There are problems with earlier versions of the libc6 (aka glibc). Please use glibc 2.1.2 or above to ensure a stable environment for WebMail.

Top of section "How to install Java properly"

10.4. Improving speed

To improve Java performance, you will most likely use an JIT (Just in time compiler) that compiles bytecode to native code on-the-fly (while executing the program). This especially improves speed for routines that are used frequently, as it is with WebMail. So I strongly recommend using a JIT for WebMail!

If you already have Java 1.2 (aka Java 2) or the IBM JDK 1.1.8 on Linux, you won't need to get a JIT as it already ships with one. If you still have Java 1.1, it depends on your platform.

I don't know what it's like for other platforms. You can always try whether you have a JIT or not by setting JAVA_COMPILER to "NONE" and testing whether that affects the execution speed of WebMail. If it is considerably slower, than you most likely already have a JIT.

The Sun JDK 1.3 (all platforms) includes a new techology called "HotSpot". This can also dramatically improve performance for WebMail. For WebMail to make full use of HotSpot, you should comment out the "HOTSPOT=-server" option in webmail.sh or if you are using the servlet version start JServ with the -server parameter.
This will produce a high load during the first seconds of startup, but will go down after some time when the HotSpot optimizations are in effect.

Top of section "Improving speed"

10.5. Glossary

JDKJava Depelopment Kit - what you need to compile programs
JREJava Runtime Environment - what you need to only run programs
JVMJava Virtual Machine - bytecode interpreter
JITJust In Time Compiler - improves execution speed of the JVM

Top of section "Glossary"
Top of section "JDK Installation And Other Java Issues"

XI. License

WebMail is (c)1998-2000 by Sebastian Schaffert, schaffer@informatik.uni-muenchen.de

WebMail is distributed under the terms of the GNU General Public License (GPL). You can find a copy in the file COPYING.

The LGPL allows you, said in short, to add WebMail to other projects that are not covered by the GPL.

Top of section "License"

XII. Contributed Documentation

Contributed Documentation is documentation that has been provided by people that are not core WebMail developers but have managed to run WebMail on different platforms/systems and taken the effort to provide you with some sort of extra documentation (thanks a lot, BTW). I (Sebastian Schaffert) have not tested what you will find here.

12.1. Installing WebMail on Resin

Note: Resin is a framework for websites based on Apache that allows to run Java Servlets among other things. The following was contributed by Jesper Weissglas, jeppe@shapeshifter.nu.

The deployment descriptors of Resin are sort of Servlet API 2.2 compatible, as opposed to the Apache properties files. Here is a skeleton of what will work with Resin 1.1:

Assuming the webmail binary distribution is unpacked as [homedir]/webmail

[homedir]/WEB-INF/web.xml
<web-app>
<classpath id='WEB-INF/classes' source='WEB-INF/classes'/>
<classpath id='webmail/lib/webmail-servlet.jar'/>
<classpath id='webmail/lib/webmail-common.jar'/>
<classpath id='webmail/lib/authenticators'/>
<classpath id='webmail/lib/plugins'/>

<error-log id='log/error.log'/>

<servlet-mapping url-pattern='/servlet/*' servlet-name='invoker'/>

<session-config session-max='4096' session-timeout='120'/>

<servlet servlet-name="webmail" servlet-class="net.wastl.webmail.servlet.WebMailServlet">
<init-param webmail.plugin.path="[homedir]/webmail/lib/plugins" />
<init-param webmail.auth.path="[homedir]/webmail/lib/authenticators" />
<init-param webmail.data.path="[homedir]/webmail/data" />
<init-param webmail.lib.path="[homedir]/webmail/lib" />
<init-param webmail.template.path="[homedir]/webmail/lib/templates" />
<init-param webmail.storage="net.wastl.webmail.storage.mysql.MySQLStorage" />
<init-param webmail.storage.sqlhost="localhost" />
<init-param webmail.storage.sqllogin="" />
<init-param webmail.storage.sqlpass="" />
<init-param webmail.storage.sqldb="[your_database_name]" />
</servlet>
</web-app>

Top of section "Installing WebMail on Resin"
Top of section "Contributed Documentation"

XIII. Credits

I give my credits to all who reported me bugs and made suggestions to improve WebMail.

Some, however, I want to mention explicitly:

Sebastian Schaffert, schaffer@informatik.uni-muenchen.de

Top of section "Credits"