Add Header to Email stored in the inbox

Hi,

Im writing a system which will periodically parse through a set of emails and perform actions on the contents. The system is extensible and has the ability to run multiple different filters on each message.

We use IMAP for the mail server and I would like to be able to add a header indicating that a message has been parsed using a particular filter so next time a folder parse is performed the message is skipped for that filter, but if new filters are added it still gets parsed.

Most mentions of headers are on sending of emails, and not email which is stored in the inbox.

Its a similar idea to Spam filters which leave an X-Spam-Software: Name type header after parseing.

Please help, ive tried opening read/write access to the inbox, but i cannot edit email that already exists on the server for some reason.

Toby

[868 byte] By [Warmfusiona] at [2007-10-3 4:59:14]
# 1

That's a limitation of IMAP - you can't modify the messages.

You can, however, set flags on messages. They won't

appear in the message headers, but the server will keep

track of them for each message. Create a user-defined

flag and use the setFlag method. Most (but not all) IMAP

servers will support user-defined flags.

bshannona at 2007-7-14 23:04:38 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...