WebPop servlet 2.1

    It is a Java servlet allows you to read your mail box. This servlet supports Post Office Protocol (POP). So this servlet is a mail client you may use in your portals.

How to use it:

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

b) define servlet in your web.xml file.
 

    <servlet>
     <servlet-name>WebPopServlet</servlet-name>
     <servlet-class>com.jsos.webpop.WebPopServlet</servlet-class>
    </servlet>

define a mapping:
 

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

    the usage is:

    1)   http://your_host/servlet/WebPopServlet

    you can use your own login screen (with the form for entering user name and password). See below how to do that.

    2)   you can incorporate this servlet into your site (portal). Just use frame (iframe) for this:
 


    <frame name="mailbox" src="http://your_host/servlet/WebPopServlet">

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


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

    4) you can use WebPop from your JSP pages (with forward or include directives)

    You must set initial parameter for this servlet. Parameter name is config and this parameter defines a name of your configuration file with mail settings.
 

    <servlet>
    <servlet-name>WebPopServlet</servlet-name>
    <servlet-class>com.jsos.webpop.WebPopServlet</servlet-class>
    <init-param>
    <param-name>config</param-name>
    <param-value>path_to_your_configuration_file</param-value>
    </init-param>
    </servlet>

Configuration file is a text describes mail settings, each line has got a form:

parameter=value.

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

# POP settings
# mailhost - your mail host
mailhost=mail.your_company.com

# mail port. Default value is 110
port=110

# SMTP settings
# smtp relay
relay=smtp.your_company.com

# smtp port. Default value is 25
port1=25

# domain name
domain=your_domain

# working directory.
# Note: servlet will use specified working directory for
# temp files only and all files from this directory will be deleted
dir=some_directory_on_your_server

# login script. You can support your own login page.
# By default this value is empty (build-in login form)
login=path_to_your_html_file

# page size (letters per page). Default value is 20
page=20

# title. Default value is WebPOP
title=WebPOP

# background color. Default value is #FFFFF
bgcolor=#FFFFF

# background color for the button's row.
# Default value is #A9A9A9 (gray)
bgcommand=#A9A9A9

# foreground color. Default value is #000000
fgcolor=#000000

# font face. By default is current browser's font
face="Verdana,Arial"

# font size. By default is current browser's font
size=3

# head. 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.
# By default this value is empty
head=path_to_your_file

# encoding for input parameters. Default value is ISO-8859-1
encoding=Cp1251

# enable/disable attachments. 1 - enable, 0 - disable
# Default value is 1 (enable).
attach=1

# enable/disable HTML in letters. 1 - enable, 0 - disable
# Default value is 0 (disable).
html=1

    For downloading:  webPopPackage.jar   
    Sample of configuration file:  webpop
 

  © Coldbeans     Comments?

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