You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by Raghavendra Setty <ra...@tarangtech.com> on 2006/09/20 07:09:06 UTC

Mail status

Hi all,

I am using James email server. I have a question on "Seen status" of the
email. Please go through the below:

Below are the steps i follow to read a particular email:

store = session.getStore("pop3");
store.connect("localhost","blue","blue");
root = store.getDefaultFolder();
inbox = root.getFolder("inbox");
inbox.open(Folder.READ_WRITE);

tempMsg = (MimeMessage) inbox.getMessage(messageNumber);

...........

tempMsg.getAllRecipients();
tempMsg.getSubject();
tempMsg.getContent();
...........

tempMsg.setFlag(Flags.Flag.SEEN, true);

inbox.close(true);
store.close();


Below are the steps i follow while i display the message headers in
inbox:

Message[] msgs = inbox.getMessages();
for(int i = 0; i < msgs.length; i++) {
	MimeMessage msg = (MimeMessage) msgs[i];

	..........

	msg.getSentDate();
	msg.getSubject();
		
	..........

	if (msg.isSet(Flags.Flag.SEEN)) {
		sysout(“Read”);
	}else{
		sysout(“Unread”);
	}

Even after reading a mail and exclusively setting the "seen" flag to
"true" in the first method, the flag will always be "false" in the
second method. Always prints "Unread".

Please help me to know where the problem is.

Thanks in advance,
Rag Setty



This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient or received it in error, please contact the sender by reply e-mail and destroy all copies of the original message. Please do not copy it for any purpose or disclose its contents.

Copyright Tarang Software Technologies Pvt. Ltd. 2004. All rights Reserved