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:12:17 UTC

Mail seen 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

Re: Mail seen status

Posted by Stefano Bagnara <ap...@bago.org>.
POP3 mailbox have no persistent status.
Specification RFC does not include SEEN support. So you can't use SEEN 
safely with a POP3 server.

You can try feeling lucky with google and "setFlag SEEN pop3" to read 
more about this.

Stefano

Raghavendra Setty wrote:
> 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



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org