The mailproc-register accessor registers a new mailprocessor with a MailTransport.
A mailprocessor periodically polls a mailserver to check for unprocessed messages. All unprocessed messages
are issued as arguments to a service URI specified in the mailprocessor config. A newly registered mailprocessor is
idle and will only commence polling when started by mailproc-start.
The MailTransport which receives the mailprocessor registration is located dynamically and is discovered from the
first instance of ffcpl:/etc/MailTransportConfig.xml in the current module address space.
For more information on the operation of the MailTransport see the MailTransport guide.
Configuration
A mailprocessor has the following configuration...
<mailProcessor>
<type>pop | imap</type>
<host>hostname of mailserver</host>
<username />
<password />
<processURI>the URI which will be invoked with each processed message</processURI>
<pollInterval>time interval in ms at which mailbox will be polled</pollInterval>
<filters>
<rule>
<field>to | cc | subject | body</field>
<match>a regex pattern to match the field against</match>
</rule>
...Any number of filter rules may be added here...
</filters>
<options>
<maxRetries />
<deleteProcessed />
<preserveFiltered />
</options>
</mailProcessor>
Any number of filters may be applied to the messages in the mailbox. Only messages which match the filters will
be processed. If no filters are specified all messages are processed.
The default behaviour of a mailprocessor is to retry a mailbox 3 times, to mark processed messages as read and to
delete messages which fail the filter criteria. The defaults may be modified with the following options...
mailFolder the name of the mailfolder to use to locate messages (note: only valid with IMAP mailservers, defaults to INBOX).
maxRetries the number of times to attempt to process a mailbox before shutting down the mailprocessor. A value
of -1 means never shutdown.
deleteProcessed after processing delete the message. Generally pop mailboxes should set this option to avoid processing loops.
preserveFiltered by default messages which do not successfully pass the filtering stage are deleted. This option
preserves these messages but marks them as read.