A BUGNOTE has been added to this bug. ====================================================================== http://dbmail.org/mantis/bug_view_advanced_page.php?bug_id=0000097 ====================================================================== Reported By: alessandro Assigned To: ====================================================================== Project: DBMail Bug ID: 97 Category: IMAP daemon Reproducibility: always Severity: minor Priority: normal Status: acknowledged ====================================================================== Date Submitted: 04-Oct-04 15:46 CEST Last Modified: 05-Oct-04 18:48 CEST ====================================================================== Summary: RECENT flag always set Description: When connecting via IMAP, all the messages have the \Recent flag set. This flag should be set only for newly arrived messages, and should be unset by the server at the end of the session. See "Additional Information". ======================================================================
---------------------------------------------------------------------- ilja - 05-Oct-04 09:51 CEST ---------------------------------------------------------------------- I'll have a look at this. I guess this is some error that's way deep in the code.. Paul, can you take care of this in your new (2.1) code? Or have you already done so? ---------------------------------------------------------------------- paul - 05-Oct-04 10:28 CEST ---------------------------------------------------------------------- I did a quick scan through the code when this first came in. I can't find any places where the recent_flag is actually set to zero. A complete ommission it seems. The procedure is actually quite simple: when user opens mailbox and user has rw access to mailbox: update messages set recent_flag=0 where mailbox_idnr matches and recent_flag=1 So all we need is a db_ call that sets the recent_flag to zero for all messages in a mailbox, and call this from the correct location in _ic_select. _ic_select is the only command that is involved, afaik. Looks easy enough. I'll take care of this. ---------------------------------------------------------------------- paul - 05-Oct-04 16:39 CEST ---------------------------------------------------------------------- Not that simple after all. The call to the new function db_set_msgflag_recent() has to occur *after* the current session. One approach would be to update the recent_flag after each retrieval of active flags for a message or range of messages. Very tricky at best. The whole mailbox_t should be passed to those functions so we can move the acl checks and mailbox permission checks to those calls. Another approach would be to expand imap_userdata_t to include the previously selected mailbox_t. On selecting a new mailbox, update the recent_flag for all messages in the previously selected mailbox. I'll start working on both. ---------------------------------------------------------------------- aaron - 05-Oct-04 18:48 CEST ---------------------------------------------------------------------- Would it be possible to have a query run at logout/disconnect that marked all visited mailboxes as no longer recent? During the session, we'd keep a list of mailboxes that the person visited. At about the time of the connection cleanup code, call a function that marks those mailboxes as no longer recent. Bug History Date Modified Username Field Change ====================================================================== 04-Oct-04 15:46alessandro New Bug 05-Oct-04 09:51ilja Bugnote Added: 0000281 05-Oct-04 09:52ilja Status new => acknowledged 05-Oct-04 10:28paul Bugnote Added: 0000282 05-Oct-04 16:39paul Bugnote Added: 0000284 05-Oct-04 18:48aaron Bugnote Added: 0000285 ======================================================================