how to detect an IMAPMessage is not an email but a Task or Calendar item

Posted by raticulin on Stack Overflow See other posts from Stack Overflow or by raticulin
Published on 2010-03-15T11:14:04Z Indexed on 2010/03/15 11:19 UTC
Read the original article Hit count: 299

Filed under:
|
|

I am accessing Lotus and Groupwise using javamail via IMAP, recursively accessing all folders and processing email I find. But in folders like Tasklist and Calendar (those are from Groupwise but I think I remember Lotus had similar things), I get the items in there as instances of IMAPMessage, and so they are processed as if they were mail.

I understand those items get exposed as mail through the IMAP protocol (either by design or by mistake), but I only want to process proper mail. Is there a way to do this? I have dismissed following approaches so far:

  • Make sure the message has a message-id, at least in Groupwise Calendar items have it.
  • Ignore folders by name (such as Calendar and Tasklist): is not totally correct as a user can move mail inside those folders.

What I am looking is some IMAP api call I have missed so far or something in those lines...

© Stack Overflow or respective owner

Related posts about imap

Related posts about javamail