Note that this is an experimental agent. Its name will probably change. Its attributes may change. Its function may change.Description
This handler stores incoming mail messages, produces a table of contents of all received mail, and allows for the retrieval of individual messages. Messages are deleted when they time out.Each message is assigned a unique id. Each id begins with a one letter prefix (A - attachments exist, B - body only) followed by a random four digit number.
Below is an example of what the table of contents might look like:
Table Of Contents
1. (B5300) From: John Fantry <jfantry@mitre.org> Subject: test2 [1M]
2. (A9621) From: John Fantry <jfantry@mitre.org> Subject: test1 [30K]Note that all new mail messages will appear at the top of the table. All older messages (messages that have already appeared in a previous incarnation of the table) are listed below the new messages. A blank line with a single hyphen character is inserted in between the new and the old in order to provide a visual clue. The message id appears inside parens () but the '(' and ')' characters are not part of the id.
This agent will respond to some messages as commands. The commands are:
get <message id>
- retrieve message
get -a <message id>
- retrieve message and include attachments
get -help
- send a list of commands
get -list
- retrieve all messages contained in the list which will be a series of (message id)'s each on a separate line as generated in the table message
get -list -a
- retrieve all messages in a list (described above) with their attachments
get -table
- generate a table of contents
Note: Please read the description of the commandPrefix variable for additional information about commands.
Configuration Variables
includeFromFieldtrue/false (true)If this field is true then the name of the person who sent the mail message will be included in the table of contents (see example above). If this field is false then only the subject of the message will be included.
includeSizeField
true/false (false)If this field is true then the size of the mail message is included in the table of contents (see example above). If this field is false then no size will be included.
emailIn
The email address that this juggler should collect mail for. Defaults to ("").Remember that this class was designed to receive email asynchronously.
messageLifetimeInHours
An integer that represents the number of hours that email messages should be saved. Defaults to (24).commandPrefix
This string is used to identify command messages and to provide some kind of support for password protection. If a commandPrefix is defined then it must proceed all commands. For instance if the commandPrefix is defined as "123" then a command message must have the form
"123 <command> <param>"
.Product
The juggler produces a Product that contains either the table of contents or a specific mail message.
How it works
The handler receives mail messages asynchronously. Every message, that is not a command, is added to the end of a VectorProduct that contains all the mail. When the juggler is fired a BasicProduct is created that contains a table of contents that represents all the mail contained in the VectorProduct. When the table of contents is generated older messages that have expired are deleted.Some mail messages may be interpreted as commands. If a mail message is determined to be a command (i.e. get) then a response is generated and immediately sent out.
Revised 10/19/99