Open Bug 304809 Opened 19 years ago Updated 2 years ago

add ability to search+filter deleted IMAP messages

Categories

(MailNews Core :: Filters, enhancement)

enhancement

Tracking

(Not tracked)

People

(Reporter: matthew, Unassigned)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [patchlove])

Attachments

(1 file, 3 obsolete files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8b2) Gecko/20050505 Firefox/1.0+
Build Identifier: 

It would be useful to be able to define custom views which filter out deleted
IMAP messages, without using the whole delete-to-Trash idiom.  Conceivably they
might want to only be able to view deleted messages in certain folders, too.

This is very very similar to bug 272709 (add ability search+filter+view flagged
IMAP messages)

Reproducible: Always

Steps to Reproduce:
Cloned off David Bienvenu's fix for bug 272709, this allows for
searching/filtering/viewing based on the deleted/undeleted imap flag.  It has
the probably desirable sideeffect of not hiding deleted messages by default
from search views, too.
Attachment #192820 - Flags: review?(bienvenu)
Oops, forgot to patch thunderbird's en-US locale with the new 'Deleted' status
property.
Attachment #192820 - Attachment is obsolete: true
Attachment #192831 - Flags: review?(bienvenu)
Does this patch make deleted show up in all search/view/filter UI's, even for
local folders and for imap servers where the user isn't showing deleted
messages? That would not be good - only users using the imap delete model should
ever be bothered with this.
Hi David; thanks for having a look at my patch.

It does indeed make deleted messages capable of showing up in the
search/view/filter UIs by default, but I'm confused as to why this is such a
bad thing. If you delete a mail in a local folder, it's moved to the Trash
folder, right?	And likewise if you delete in the trash-idiom in IMAP.	So
you'd only ever have deleted mails show in results if you were searching the
Trash.	But I guess you want to avoid them showing up when you do a global
search.

Anyway, i've updated the patch so that it only allows you to display deleted
messages if you explicitly add a search term concerning deletion status, to
avoid this problem.
Attachment #192831 - Attachment is obsolete: true
Attachment #192844 - Flags: review?(bienvenu)
I meant that the ui for even picking the "deleted" flag should be limited to
imap folders where the server is configured to show deleted messages. It has no
meaning for local folders, for example, because the search will never return
deleted messages. And for imap users who are deleting to the trash, they don't
want to be bothered with the fact that their deleted messages are lurking around
in their inbox for a certain amount of time. Also, messages in the imap or local
trash don't have the deleted flag set on them. Does that make sense? I might be
confused about what you're trying to do, but I thought it really only applied to
users using the imap delete model, where deleted messages are shown...
Right, i understand now (apologies for slowness).  I agree that
searching/filtering/viewing on imap delete flags is only meaningful for IMAP
accounts which have been set up for "When I delete a message: Mark it as deleted". 
Propagating that bit up to the searchValue widget in all of its different
contexts seems like a bit of a nightmare, however - but I'll give it a shot at
some point. (It would also completely break if search/filtering/viewing across
multiple accounts is ever implemented)
yes, I'm not sure how that info would get propagated...

re cross-account searches, the UI for that is going to have to be the union of
all the possible search criteria anyway, so maybe it'll just fall-out :-)
Attachment #192820 - Flags: review?(bienvenu)
Attachment #192844 - Flags: review?(bienvenu) → review-
Attachment #192831 - Flags: review?(bienvenu)
Matthew: I use the IMAP delete model and need this function, so I ask in a display of pure self interest: any chance of you reviving your patch? :-)

(Bug 190974 is related or a duplicate.))

Gerv
I suppose we could compromise and show this option for all imap accounts, not just imap accounts using the imap delete model.
QA Contact: general
why hasn't anything happened on this bug?  The fact that one can't sort on deleted status for "mark deleted" imap folders is a major bug in my opinion.
This bug seems to be Thunderbird counterpart of bug #196035 (which is filed against SeaMonkey).
Marking as dupe, it's semi-shared code.
Status: UNCONFIRMED → RESOLVED
Closed: 17 years ago
Resolution: --- → DUPLICATE
This is not a duplicate; it's asking for different things to 196035 (e.g. not just advanced search, for example). And there's a beginning patch here which has got lost as a consequence.

Gerv
Status: RESOLVED → UNCONFIRMED
Resolution: DUPLICATE → ---
Assignee: mscott → nobody
Component: General → Filters
Product: Thunderbird → MailNews Core
QA Contact: general → filters
Whiteboard: [patchlove]
Blocks: 196035
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment on attachment 192844 [details] [diff] [review]
Updated; by default deleted messages are hidden unless explicitly specified

Patch is obsolete - mailnews/base/resources/content/mailWidgets.xml no longer exists.
Attachment #192844 - Attachment is obsolete: true
Matthew, any chance of a new updated patch?
it has moved to mail/base/content
Within the structure of the existing filter code, in order to have a different set of available operators you need to define a new validity table. Although it seems overkill to do it for a single operator, we already do that for a single change in attribute in places.

Once you have defined a new validity table, it is not hard to propogate information to the filter code. The filter code ultimately asks the nsIIncomingServer about which validity table to use by reading its filterScope or searchScope attribute, so as long as the server knows its delete model, the filter code can figure it out as well.

Also, in addition to mailWidgets in mail/base/content, you also need to change the forked file for Seamonkey in suite (though the code is identical in the search section).
Any chance of resolving this? I would really like an option to see the deleted-but-not-yet-expunged messages in the IMAP accounts. Let them be invisible by default - but I'd like to be able to see them, if I want.
That's already implemented in bug 190974 for tb3. (View | Messages | Not Deleted)
Summary: add ability to search+filter+view deleted IMAP messages → add ability to search+filter deleted IMAP messages
Blocks: 444147
Propose as wanted bug. Seems worth feature for guys who use mark as deleted model. Virtual folder with all deleted messages help a lot when you have tons folders.
Flags: wanted1.9.2?
Version: unspecified → Trunk
This feature can be done very easily in my extension FiltaQuilla.

For a JavaScript search term, just add the following term:

message.flags & Ci.nsMsgMessageFlags.IMAPDeleted
Flags: wanted1.9.2?
Refreshed the old patch. Seems to be working, but i didn't figure out how to hide the "Status: Deleted" search/filter option for non-imap accounts.
(In reply to Magnus Melin from comment #23)

> Refreshed the old patch. Seems to be working, but i didn't figure out how to
> hide the "Status: Deleted" search/filter option for non-imap accounts.

Hmm, yeah we have ways to hide/show search attributes through the nsMsgSearchValidityManager, but not individual flag values. If you could figure out what the search scope is, you could add code to the xbl to hide the item - it looks like the xbl does know the search scope (look for the searchScope property)
Yeah i can get the searchScope, but pop and offline imap both use the offlineMail searchScope :(
Or maybe that's a bug/should change...?
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: