This project is read-only.

Can't mark as read because of read-only state

Mar 22, 2010 at 12:29 PM

I'm trying to mark messages as read, but this doesn't work and I'm getting the following message in the SendAndReceive method : "IMAP0078 OK Store ignored with read-only mailbox."

Is there some way of telling InterIMAP to open the connection as read/write, instead of read-only? I can mark the messages read when using something like Thunderbird, so I don't think it's a problem with the server configuration.

Mar 22, 2010 at 1:50 PM

I made the following change to source code and got MarkAsRead working :

 

        public void MarkMessageAsRead(IMAPMessage msg)
        {
            msg.Folder.Select();
            string cmd = "UID STORE {0} +FLAGS (\\Seen)\r\n";
            ArrayList result = new ArrayList();
            SendAndReceive(String.Format(cmd, msg.Uid), ref result);
            if (result[0].ToString().ToLower().Contains("ok"))
                msg.Flags.New = false;
            msg.Folder.Examine();
        }

 

        public void MarkMessageAsRead(IMAPMessage msg)
        {
            string cmd = "UID STORE {0} +FLAGS (\\Seen)\r\n";
            ArrayList result = new ArrayList();
            SendAndReceive(String.Format(cmd, msg.Uid), ref result);
            if (result[0].ToString().ToLower().Contains("ok"))
                msg.Flags.New = false;
        }

Changed to

 

        public void MarkMessageAsRead(IMAPMessage msg)
        {
            msg.Folder.Select();
            string cmd = "UID STORE {0} +FLAGS (\\Seen)\r\n";
            ArrayList result = new ArrayList();
            SendAndReceive(String.Format(cmd, msg.Uid), ref result);
            if (result[0].ToString().ToLower().Contains("ok"))
                msg.Flags.New = false;
            msg.Folder.Examine();
        }