Problems with flag SEEN and Lotus Domino rel. 6.5.5

Hi all,

we have an application checking the INBOX (using imap protocol) for new e-mails every day, by applying the following filter:

Message[] messages = folder.search(new AndTerm(new FromTerm(new InternetAddress(myAddres)),

new FlagTerm(new Flags(Flags.Flag.SEEN),false)));

in order to get only the new e-mails coming from the specified address.

After getting the messages, the application does some logic and then sets the flag SEEN to every single message:

message.setFlag(SEEN,true);

The application had been working properly till a few days ago when the mail server was updated (from 5.0.12 to release 6.5.5). The server is Lotus Domino.

From then on the application is getting all the messages from the specified address, the SEEN ones too.

I've done some testing and it seems that the AndTerm is not working properly. I've tried to get all new messages

Message[] messages = folder.search(new FlagTerm(new Flags(Flags.Flag.SEEN),false));

and it works.

If I change the order of the search terms, it works properly, but I can't understand why:

Message[] messages = folder.search(new AndTerm(new FlagTerm(new Flags(Flags.Flag.SEEN),false),

new FromTerm(new InternetAddress(myAddress))));

Can anyone help me to understand this behaviour?

Thanks,

mavenez

[1903 byte] By [maveneza] at [2007-10-2 21:50:29]
# 1

Since the only thing that changed is Domino, have you considered that it

might be a Domino bug?

You can turn on session debugging and the protocol trace it produces

will show you the search term it's sending to the IMAP server. You can

manually check that that search term makes sense, but you'll probably

need to send it to IBM and ask them why it's not working.

bshannona at 2007-7-14 1:06:16 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2

I sent the information about the session debugging to the people responsible for Lotus Domino in the company where our application is hosted....and they haven't replied yet!

Anyway I can confirm that inverting the position of the search terms works:

Message[] messages = folder.search(new AndTerm(new FlagTerm(new Flags(Flags.Flag.SEEN), false),

new FromTerm(new InternetAddress(myAddress))));

Thanks for your help!

maveneza at 2007-7-14 1:06:17 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...