how to detect an IMAPMessage is not an email but a Task or Calendar item
- by raticulin
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...