The IMAPGenerator is a new component included within the Mail block.

Simply put, it generates an XML listing of messages from an IMAP mailbox.


Get the JavaMail API jar from, and the JAF activation.jar from Put them in your WEB-INF/lib/ directory and restart your servlet container.

Next, include the following line in your sitemap.xmap:



Now you should be good to go. The Generator is currently configured via parameters:

<map:match pattern="inbox">
  <map:generate type="imap">
    <map:parameter name="host" value="{request-param:host}"/>
    <map:parameter name="user" value="{request-param:user}"/>
    <map:parameter name="pass" value="{request-param:pass}"/>
  <map:serialize type="xml"/>

Sample Output

The generator currently generates XML using the "imap" prefix and the namespace URI of

<imap:imap xmlns:imap="">
      <imap:subject>sample subject</imap:subject>
      <imap:from>tony collen &lt;;</imap:from>
      <imap:sentDate>Wed Sep 24 21:36:33 CDT 2003</imap:sentDate>


The IMAPGenerator (along with the entire Mail block) is considered unstable, and the contracts and APIs may change suddenly without warning, such as the output, or method of configuration.

IMAPGenerator (last edited 2009-09-20 23:41:07 by localhost)