WebMail servlet 1.8

    It is a Java servlet allows you to support web-based private mail service including mail-lists. So all mail (private, and mail lists) will be saved and distributed within your server. This servlet offers user interface to read/send mail, create and maintain mail lists etc. In other words it is a special forum (message board) where the interface is organized like e-mail package. So this servlet is yet another way to create your own community (see also for example our discussions or forum servlets).
   WebMail supports local mail stores but you can also forward (send) messages to external addresses. So for any address contains @ package will send letter to this external address.

How to use it:

a) copy webmailPackage.jar into your WEB-INF/lib directory.

b) define servlet in your web.xml file. In order to run this servlet you have to set two initial parameters:

 - configuration file (is mandatory). Parameter name is 'config'
 - administrative password for mail-lists. Parameter name is 'admin'
 


    <servlet>
     <servlet-name>WebMail</servlet-name>
     <servlet-class>com.jsos.webmail.WebMailServlet</servlet-class>
     <init-param>
      <param-name>config</param-name>
      <param-value>path_to_your_configuration_file</param-value>
     </init-param>
    </servlet>

c) describe a mapping for this servlet in web.xml. E.g.:
 


<servlet-mapping>
  <servlet-name>WebMail</servlet-name>
  <url-pattern>/servlet/WebMail</url-pattern>
</servlet-mapping>

the usage is:
 


    http://your_host/servlet/WebMail

The rest of that is standard as for any another mail package. Each user must sign in and setup own name and password. This user name is user's address within the WebMail scope. Mail lists can be created in the so called administrative mode (see below).

Configuration file is a text file, each line describes one parameter in the form of

    param=value

Empty lines and any line starts with # or // are ignored. Current version supports the following list of parameters:

#
#
# webmail config
#

# login screen background (default value is #FFFFF)
bgcolor1=#FFFFF

# login screen foreground (default value is #000000)
fgcolor1=#FFFFF

# login screen font size (by default is current font)
size1=2

# login screen font face (by default is current font)
face1=Arial,Verdana

# mail screen left frame background (default value is #FFFFF)
bgcolor2=#FFFFF

# mail screen left frame foreground (default value is #000000)
fgcolor2=#FFFFF

# mail screen left frame font size (by default is current font)
size2=2

# mail screen left frame font face (by default is current font)
face2=Arial,Verdana

# mail screen right frame background (default value is #FFFFF)
bgcolor3=#FFFFF

# mail screen right frame foreground (default value is #000000)
fgcolor3=#FFFFF

# mail screen right frame font size (by default is current font)
size3=2

# mail screen right frame font face (by default is current font)
face3=Arial,Verdana

# frames settings. Default value is 20%,80%
frames=25%,75%

# border settings. Default value is 1
border=1

# enable/disable frames resize. Default value is 1 (enable)
resize=1

# base dir (data srote). This parameter is mandatory and describes
# any existing directory on your server
dir=/your_dir_is_here
# or for Win 95/98/NT  some like dir=c:\my_path

# title (default walue: WebMail)
title=Coldbeans webmail

# date format (0 : Month/Day,  1: Day/Month, default value is 0)
date=0

# localization support. In case of your servletrunner can not support by default local
# characters (you will see ?), you can set here explicit characters encoding
# for input parameters. Default value is ISO-8859-1
encoding=Cp1251

# logo. You can add your own logo for the login page. File you set here
# can contains any html code. By default this value is empty.
logo=path_to_your_file

# header. You can set here some file contains any html-code. This code will be
# outputted at the beginning of the each page. So you can set for example some banners or CSS styles.
# By default this value is empty
header=path_to_your_file

# footer. You can set here some file contains any html-code. This code will be
# outputted at the bottom of the each page. So you can set for example some
# banners. By default this value is empty
footer=path_to_your_file

# external mail settings

# mailhost
mailhost=your_smtp_relay

# port. Default value is 25
port=25

# domain. Local domain settings. External mail will be sended from user_name@domain
# Default value is localhost.
domain=your_host_address
 

More about the usage

1. For running WebMail in the administrative mode (create/delete mail lists) use your admin password:

http://host/servlet/WebMail?your_password

In case you did not set any password in the properties file default password is 'welcome'.
(http://host/servlet/WebMail?welcome)

2. You can bypass system initial screen. Just use the following:

a) for direct access to login screen

http://host/servlet/WebMail?act=login

b) for direct access to signup screen

http://host/servlet/WebMail?act=login&sign=yes

3) You can create you own form for login procedure. You have to post to this servlet two values: user name and password. Fields names are: wmu and pwd
 


<html>
    ... your code
    <form method="post" action="http://your_host/servlet/WebMail?act=login2">
        User: <input type="text" name="wmu">&nbsp;
        Password:<input type="password" name="pwd">
    </form>
</html>

4) You can create you own form for signup procedure. You have to post to this servlet three values: user name and password (twice). Fields names are: wmu, pwd, pwd1
 


<html>
    ... your code
    <form method="post" action="http://your_host/servlet/WebMail?act=login1">
        User: <input type="text" name="usr">&nbsp;
        Password: <input type="password" name="pwd">
        Confirm: <input type="password" name="pwd1">
    </form>
</html>

 

    For downloading:   webmailPackage.jar  
    Sample of configuration file:  mailconf
 
  © Coldbeans      Comments?

See also JSOS - the largest collection of servlets and filters.