Preprocessing Email Messages

When the email listener daemon finds a message in a monitored inbox, it preprocesses the message into xml format and then passes the xml to the JPO as the first element of the arguments array. The message object itself cannot be passed to JPO.invoke because it does not implement Serializable.

The parsed xml format looks like this:

<MxMessage>
        <version>1</version>
        <To>To addresses</To>
        <From>From address</From>
        <ReplyTo>ReplyTo address</ReplyTo>
        <Cc>Cc addresses</Cc>
        <Bcc>Bcc addresses</Bcc>
        <Subject>testing</Subject>
        <Text>Message text</Text>
        <HtmlText>HtmlTest</HtmlText>
        <Sent>JavaDate in Milliseconds</Sent>
       <Received>JavaDate in Milliseconds></Received>
    </MxMessage>