[imp] Deleted messages are counted in summary

Steven Alexson steve at alexson.org
Tue May 20 09:46:11 PDT 2003


I have been looking into this possibility a bit further. It seems that the
imp/lib/Block/summary.php (used for the portal), is using the PHP function
"imap_status". This function appears to only be able to check for statuses of 
"RECENT" or "UNSEEN". It has no way of knowing if the "DELETED" flag is set on
the message.

So, I changed my approach...

I figured that the filters use the same functions to move/copy a message to a
new folder as the Move/Copy links the user uses in mailbox view
(imp/lib/message.php, I believe). I searched through there, and found the
section that actually deals with moving/copying a message. It seems to use a
variable "$action" to determine whether the message is to be moved or just
copies. The variable takes on a variable of "MOVE_MESSAGE" or "COPY_MESSAGE".
Based on this variable, certain flags are set.

>From what I see happening, if a message is moved (or even just deleted) without
being first seen by the user/script, the "DELETED" flag is set, but the
"SEEN/UNSEEN" flag remains untouched.

What I propose is:

/* in imp/lib/message.php */

     if ($action == "MOVE_MESSAGE") {
          /* set a message flag of seen using the PHP imap_setflag_full function
*/
          imap_setflag_full ($imap['session'], $msgIdx, \\SEEN, ST_UID);
          /* I am pretty sure that those are the variables that Imp uses for the
mail session */
     }

I did try to implement this, but it seems to not work. I don't know if it is a
problem with the function itself, or the way I am calling it. In theory, this
would solve the problem of the summary counting deleted messages as new no
matter whether the message was moved by a script, filter, or by the user.

Any thoughts, help, or suggestions?

--
Steven Alexson

"Common sense is not so common." --Voltaire


Quoting Jan Schneider <jan at horde.org>:

> Zitat von Steven Alexson <steve at alexson.org>:
>
> > When a user logs in, the INBOX summary seems to be counting unseen
> > deleted
> > messages as part of the total. This is, of course, for users that do not
> > move
> > deleted messages to a trash bin. This tends to be an annoying inaccuracy,
> > especially for users with filters that move messages to other folders.
> >
> > As in my test case, I have several folders which are checked for new
> > messages,
> > and each has a filter that moves messages into the folders. When I logon,
> > assume that I have 8 new messages. 5 of which were filtered into new
> > folders
> > which are also checked. Now my summary reads that there are new messages
> > in
> > these folders, plus 8 new messages in the INBOX. This could be confusing
> > for
> > users which choose to hide deleted items, and forget or choose not to
> > purge
> > their INBOX before they log off.
> >
> > I am assuming that IMP has some mechanism to recognize the difference
> > between
> > deleted and not deleted messages since I knows the difference in the
> > folder
> > view. Couldn't that same mechanism be incorporated into the summary tool?
>
> Sure. Patch?
>
> Jan.
>
> --
> http://www.horde.org - The Horde Project
> http://www.ammma.de - discover your knowledge
> http://www.tip4all.de - Deine private Tippgemeinschaft
>
> --
> IMP mailing list
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: imp-unsubscribe at lists.horde.org
>


More information about the imp mailing list