e-Mail Application

This applet provides an HTML interface for managing e-mails that are stored somewhere on the local filesystem. The e-mail application can be accessed by using internal URLs that start with the prefix internal://mail/. The e-mail composer is also invoked automatically by w3browse when following hyperlinks of mailto URLs such as mailto:.

The e-mail application incorporates the capabilities that are needed to

Links to most tasks are provided on the start page of the application.

The gory details about the syntax of Internet messages and especially the format and features of MIME messages can be found in [MIME].

Mail Folders and Messages

All e-mail messages are organized within a main directory that is specified by the parameter MailDir of the dialog "Open URL Window". This directory contains at least the following files and subdirectories:

holds all received messages,
holds all sent messages,
holds all pending messages to be sent,
holds the logfiles in which all activities during sending and receiving of messages including the message headers are remembered,
an RDF/XML file that contains the mail account definitions and other things,
a text file that contains the message-ids of all received and sent messages together with relative references to the corresponding message files.

Every so-called mail folder may contain messages as well as subfolders. Each message is stored in a separate text file that is named by a timestamp in hexadecimal format and includes all message headers as received, sent or composed, respectively. A message is never stored in decomposed or similar form.

Note that some or all files and directories may contain sensitive information, so it is recommended to protect the main e-mail directory, or at least the affected parts, appropriately.

Browsing in Mail Folders

When entering a mail folder or one of its subfolders, a numbered list of all contained subfolders and messages is presented, sorted by name. For messages, the sort order is reversed so that more recent entries come first, when applied to the used naming convention.

Within the list, subfolders are shown using their name and come prior to the first message. Messages are shown with the contents of either the From: field (inbox) or the first To: field (other folders), together with the Subject: field of the message.

Each entry of the list offers a hyperlink that provides access to the corresponding item. Additionally, in front of each entry there is a checkbox that can be used to mark this item for subsequent deletion or moving.

At the bottom of the list, a button for deleting and another button for moving selected items is available if at least one list item is present. Note that subfolders must be empty in order to be able to delete them. The name of a subfolder to which selected items may be moved can be chosen by the help of a selection field that contains all possible subfolder names.

Finally, a text input field together with a button is always provided for creating a new subfolder.

Viewing a Message

Messages themselves are presented as a hierarchical list of items that correspond to the message parts. A message that is not a multipart MIME message is treated like a message that has exactly one part which is denoted by a part number of 0. Regular parts are usually numbered starting at 1. The whole procedure as described in the following is applied recursively to each message part that is again a message.

Prior to the first list item, some header fields of the message are displayed if present, such as From:, Reply-To:, Sender:, To:, Cc:, Bcc:, Date:, Subject:, Message-ID:, In-Reply-To: and References:. Every message-id found in the last two fields is linked to the corresponding message if possible. When viewing a received message (inbox), an additional Reply link is provided near the Reply-To: or From: field and causes the e-mail composer to be invoked when activated. Appropriate values for the fields In-Reply-To: and References: of the reply message are also passed on in this case and appear as hidden fields in the HTML formular of the composer.

Then, for each message part, a link to the body of that part is provided as well as additional information about that part, such as Name:, Type:, Encoding:, Modified:, Location: and Description:, most of them are derived from related message header fields (those having a Content- prefix). One exception to this is Name:, which may result either from the name parameter of the Content-Type: header field or from the filename parameter of the Content-Disposition: header field. The other exception is Modified:, which is determined from the modification-date parameter of the Content-Disposition: header field if present.

Finally, the body of the first message part is embedded in the display if it is recognized as plain text.

A special feature of w3browse concerns the generally undefined part 0 of a multipart MIME message that has a content-type of multipart/related: It is a virtual part that represents the main index file of a remote cache and is identified by a content-type of text/x-w3bcache-index. The entries for the index are constructed from the related message parts using either the Content-Location: or the Content-ID: header field, and from the corresponding message part numbers.

Composing a Message

The e-mail composer presents an HTML formular which contains several text input fields that correspond to the From:, To:, Cc: and Subject: header fields of a message. The message body can be entered into a textarea input field and several files may be attached to a message by making use of a number of file selection fields. Submitting the form causes the generated MIME message to be saved to the outbox folder.

Two additional checkboxes allow to determine whether the message body should be created as plain text, as an HTML document, or both. The HTML document is created by treating the entered message body as a textual representation of HTML. The meta data part of that representation is stripped from the plain text version of the message body if that is also to be created.

Certain input fields of the formular may already be filled out, depending on how the e-mail composer is being invoked, especially the From: field may be preset from the default e-mail address (see next section). These values can be changed in the formular, of course.

Mail Accounts

Mail accounts are used to store parameters that are needed in order to get access to different electronic mailboxes. The settings are saved in the RDF/XML file index.dir and may be modified with any text editor.

The administration of mail accounts is performed on a separate page which presents a series of HTML formulars, one for each already defined account and an additional empty one for defining a new account. Each formular consists of a number of text input fields for the mail account parameters, and submit buttons are provided for each account in order to save changes and to delete an account.

The following parameters can be specified for each mail account:

Account Name
Identifies each account by an arbitrary name that should be unique with respect to others, but this is not enforced. These names are used on the start page of the application or other places as shortcuts to accounts.
Mail Address
Defines the e-mail address of the mailbox as it is to be used in the From: field of new messages. The first non-empty value in the ordered list of mail accounts is used by the e-mail composer as a default for this field.
POP3 Server
Specifies the location of a pop3 server for receiving messages from the related mailbox.
SMTP Server
Specifies the location of an smtp server for sending messages that are related to the mailbox.

A server location specification may include authentication information with such a server if needed. If a server location parameter is left empty, the related mail account cannot be used to perform the corresponding action, and therefore it does not appear as a possible target for such an action.

As a special case, if the parameter POP3 Server starts with the prefix file:, the rest of the value is taken to be the filename of an mbox file (see also [MBOX]) and causes the contents of that file to be imported. All messages of the file are thereby extracted and placed into separate files in the inbox folder. Note that the receive option whether or not to delete messages afterwards (see next section) indicates in this special case whether the mbox file itself should be deleted (or truncated if deletion fails) afterwards or not.

Sending and Receiving Messages

When sending messages, all messages that are currently present in the top-level of the outbox folder are sent out at once, using one selected mail account. Sent messages are also copied to the top-level of the sent folder, independent of the fact whether they are deleted from the outbox folder or not.

When receiving messages, all messages from one or more selected mail accounts are fetched at once into the top-level of the inbox folder.

Sending and receiving of messages is initiated by the use of submit buttons, one for each action. These buttons are currently located only on the start page of the e-mail application. Each submit button together with related options is only available if at least one non-empty server location for the corresponding action (sending or receiving) has been specified in the list of mail accounts.

If more than one mail account with a suitable server location for an action can be found, an additional selection field next to the button is available that can be used to make another choice for that action. For sending, the first mail account is preselected, while for receiving, all available mail accounts are preselected.

A further selection field allows to determine whether messages should be deleted (default) after an action has been performed or whether they should be left in place. In the latter case, re-doing that action will operate on the same messages again if not hindered by other activities!


This applet, if enabled, is part of the request processing chain that is created by the dialog "Open URL Window". For that reason, the namespace of URLs is not limited by this applet in any other way as to catch and respond to internal://mail/ and mailto:.