Ability to filter messages by size

RESOLVED FIXED in mozilla1.8alpha6

Status

MailNews Core
Filters
P3
enhancement
RESOLVED FIXED
18 years ago
6 years ago

People

(Reporter: revenant, Assigned: standard8)

Tracking

Trunk
mozilla1.8alpha6
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 4 obsolete attachments)

(Reporter)

Description

18 years ago
I have Communicator 4.6, so please forgive me if 4.7 has already addressed
this.

It would be very useful to be able to filter mail, and especially newsgroup,
messages by size.  This is a highly effective way of filtering spam from
binaries newsgroups.

Thank you.

Updated

18 years ago
Assignee: phil → nobody
Summary: RFE: Ability to filter messages by size → [HELP WANTED] Ability to filter messages by size
Whiteboard: [HELP WANTED]

Comment 1

18 years ago
Add to [help wanted] list

Updated

18 years ago
Keywords: helpwanted

Updated

18 years ago
Summary: [HELP WANTED] Ability to filter messages by size → Ability to filter messages by size
Whiteboard: [HELP WANTED]

Comment 2

17 years ago
From n.p.m.wishlist:
"In the same way I want to be able to set a limit on the size of the mails that 
I get home, I should get a question if I want to take it home, leave it on the
server or delete it. But then I want to have the subject of the mail too, which
gives me a hint if I want to get that one or not. (check YAM for this feature)"

I think in addition to filter mail on size it should be possible to delete 
messages bigger than a specified size on the mail server, ideally returning an 
automatic mail to the sender telling him so. 
Dial up will be very thankful for that feature.
OS: Windows 98 → All
Hardware: PC → All

Updated

17 years ago
Blocks: 66425

Updated

16 years ago
Status: NEW → ASSIGNED

Comment 3

16 years ago
Received an email from kieran@breen.net who wanted to help out on this bug and
have it assigned to him/her.  

Kieran - if you want to work on this enhancement, pls feel free to assign to you
(since it's a helpwanted bug assigned to "nobody@mozilla.org").  You can ask
questions in the mail/news newsgroup for assistance.  Thanks!
*** Bug 119661 has been marked as a duplicate of this bug. ***

Updated

16 years ago
Component: Mail Window Front End → Filters

Comment 5

16 years ago
This feature should be included along with a gui for bug 105169 (filter by
attachment file extension).  In fact, it would be really neat if someone
released self installing filter packages that searched the file extension and
file size that you could download to prevent virus emails from entering your inbox.

Comment 6

15 years ago
*** Bug 163680 has been marked as a duplicate of this bug. ***

Updated

15 years ago
Summary: Ability to filter messages by size → [RFE] Ability to filter messages by size

Comment 7

15 years ago
-> NEW
Status: ASSIGNED → NEW

Comment 8

15 years ago
*** Bug 188480 has been marked as a duplicate of this bug. ***

Updated

14 years ago
QA Contact: lchiang → nobody

Comment 9

14 years ago
I'd like this as a measure to be able to reject some of the viruses that have
been flying around of late.  It's rare for me to receive an email > 50KB in
size, especially a "bounce" message.

I might have a look and see if I can make a head & a tail of the Filtering code,
see if I can come up with a patch, but otherwise, if someone out there (who
knows what they're doing with the Mozilla source) is willing, I'd love to have
this feature in Mozilla.

Comment 10

13 years ago
*** Bug 240583 has been marked as a duplicate of this bug. ***

Comment 11

13 years ago
Hmmm, sound like something intresing to look into.  I'll love to have some
binaries sent to a seperate folder (as they're rare if outside a mailing list).

Is MailNews in XUL, or can it be extended via XUL?
(Assignee)

Comment 12

13 years ago
Created attachment 162515 [details] [diff] [review]
Patch to implement filter and search by size.

I've formulated this as a possible beginning patch - some of the code for the
size matching already seemed to be in place.

Currently I know of three problems I have seen with this patch applied but
haven't fully confirmed yet if they are just because of this patch.

1) looks like bug 242600
2) looks like it could be a bug with doing multiple searches in the mailnews
search dialog, mozilla crashes with a "Gdk-ERROR **: BadPixmap" when closing
the search dialog.
3) The filter by size doesn't appear to work, although the search by size does.


I will keep looking at this, but if anyone can have a quick look and pass back
comments (especially related to the crashes) it would be useful. Thanks.
(Assignee)

Comment 13

13 years ago
Comment on attachment 162515 [details] [diff] [review]
Patch to implement filter and search by size.

The two bugs I found exist in the raw trunk and aren't to do with my patch (the
second of those bugs is now logged as bug 265148).

I think this patch is basically ready, but should we be searching in bytes or
kilobytes?

Requesting review for the bytes version. If you think it should be kilobytes,
please note and I'll find a way of updating the patch to do it.
Attachment #162515 - Attachment description: Possible beginning patch → Patch to implement filter and search by size.
Attachment #162515 - Flags: review?(neil.parkwaycc.co.uk)

Comment 14

13 years ago
Given that the message list shows the size of emails in kB, the searching should
reflect this.  Perhaps it could be configurable?

Mind you, it isn't that difficult to pull out a calculator and divide by 1024
(or multiply for that matter :-D)
(Assignee)

Comment 15

13 years ago
Comment on attachment 162515 [details] [diff] [review]
Patch to implement filter and search by size.

Cancelling review for the time being. To search in KB would make more sense at
the moment with the message display as it is. Will add new patch soon.
Attachment #162515 - Flags: review?(neil.parkwaycc.co.uk)
(Assignee)

Comment 16

13 years ago
Created attachment 163211 [details] [diff] [review]
Patch for Search/Filter in KB

Revised the previous patch to search/filter with size parameter as KB as that
is what the user sees in the message pane.

Also tidied a couple of bits from the previous patch.

Note: I'm also going to be suggesting a seperate patch for adding size column
to the search results pane under the existing bug 222639.
Attachment #162515 - Attachment is obsolete: true
(Assignee)

Updated

13 years ago
Attachment #163211 - Flags: review?(neil.parkwaycc.co.uk)

Comment 17

13 years ago
Comment on attachment 163211 [details] [diff] [review]
Patch for Search/Filter in KB

Looks good, at least for POP/Local accounts and filters.
Attachment #163211 - Flags: review?(neil.parkwaycc.co.uk) → review+
(Assignee)

Updated

13 years ago
Attachment #163211 - Flags: superreview?(mscott)

Updated

13 years ago
Assignee: nobody → mark
(Assignee)

Comment 18

13 years ago
Assigning to self and removing helpwanted keyword for now.
Status: NEW → ASSIGNED
Keywords: helpwanted
(Assignee)

Updated

13 years ago
Blocks: 92074

Updated

13 years ago
Summary: [RFE] Ability to filter messages by size → Ability to filter messages by size
(Assignee)

Comment 19

13 years ago
Comment on attachment 163211 [details] [diff] [review]
Patch for Search/Filter in KB

mscott seems to be busy on other things, David will you consider sr for this
please?
Attachment #163211 - Flags: superreview?(mscott) → superreview?(bienvenu)
(Assignee)

Comment 20

13 years ago
Created attachment 166264 [details] [diff] [review]
Search for Size on Imap (no whitespace changes)
(Assignee)

Comment 21

13 years ago
Created attachment 166268 [details] [diff] [review]
Search/Filter for Imap (whitespace changes)

Ok, two patches that both implement search/filter for size ability for IMAP
accounts. One of these will need to be applied after the original patch
attachment 163211 [details] [diff] [review]). 

I know we don't normally change the whitespace, but nsMsgSearchAdapter.cpp was
seemed to me pretty hard to work out where the various parts of the switch/case
statements were and what they related to.

Anyway, I've included both for clarity, but will be requesting the whitespace
one gets checked in.
(Assignee)

Updated

13 years ago
Attachment #166268 - Flags: review?(neil.parkwaycc.co.uk)

Comment 22

13 years ago
Comment on attachment 166268 [details] [diff] [review]
Search/Filter for Imap (whitespace changes)

>+      // If we are doing a less than search, we must subtract 1 now,
>+      // as otherwise we get a 67KB size message returned for a
>+      // less than 67KB search.
>+      if (nsMsgSearchOp::IsLessThan)
>+        sizeValue -= 1;
>+
>+      // Multiply by 1024 to get into kb resolution
>+      sizeValue *= 1024;
Firstly, if (nsMsgSearchOp::IsLessThan) doesn't seem to do what you want,
you're not comparing anything. Secondly, to match up with local search, you
probably want "greater than N" to translate as "LARGER <N*1024+1023>" and "less
than N" to translate as "SMALLER <N*1024>". At least with my mail server,
SMALLER really means SMALLER. Of course, "less than 1" never returns any
matches for your local search...
(Assignee)

Updated

13 years ago
Attachment #166268 - Flags: review?(neil.parkwaycc.co.uk)
Product: MailNews → Core
(Assignee)

Comment 23

13 years ago
Created attachment 167032 [details] [diff] [review]
Revised search/filter for Imap patch

This patch fixes the size issues that Neil mentioned & also stops "is" being a
possible option for matching on in imap filtering (it had crept in before
somehow).
(Assignee)

Updated

13 years ago
Attachment #166264 - Attachment is obsolete: true
Attachment #166268 - Attachment is obsolete: true
(Assignee)

Comment 24

13 years ago
Comment on attachment 167032 [details] [diff] [review]
Revised search/filter for Imap patch

Neil, revised and works ok, now that I have a working imap server ;-)

I did both the searching algorithms based on the fact of getting the displayed
values matching what you are searching for. Hence, less than 1 won't return
anything because we never display messages with a size of less than 1. We could
change it if you want, but I think it makes sense as it is.
Attachment #167032 - Flags: review?(neil.parkwaycc.co.uk)

Comment 25

13 years ago
Comment on attachment 167032 [details] [diff] [review]
Revised search/filter for Imap patch

Ideally you shouldn't reformat the entire function's whitespace just to add a
few lines... also you wrapped a useless pair of braces around the if
(IsStringAttribute(attrib)) block. r=me for the relevant bits only.
Attachment #167032 - Flags: review?(neil.parkwaycc.co.uk) → review+
(Assignee)

Comment 26

13 years ago
Created attachment 167038 [details] [diff] [review]
Revised search/filter for Imap with no whitespace changes.
Attachment #167032 - Attachment is obsolete: true
(Assignee)

Comment 27

13 years ago
Comment on attachment 167038 [details] [diff] [review]
Revised search/filter for Imap with no whitespace changes.

Using neil's r for the patch as only whitespace removed.

Requesting Superreview - David can you sr the other patch on this bug as well
please if it's ok.

Thanks.
Attachment #167038 - Flags: superreview?(bienvenu)
Attachment #167038 - Flags: review+

Updated

13 years ago
Attachment #167038 - Flags: superreview?(bienvenu) → superreview+

Updated

13 years ago
Attachment #163211 - Flags: superreview?(bienvenu) → superreview+
(Assignee)

Comment 28

13 years ago
Comment on attachment 163211 [details] [diff] [review]
Patch for Search/Filter in KB

Do aviary and thunderbird want this? Enables Search & Filter message size.
Attachment #163211 - Flags: approval1.7.5?
Attachment #163211 - Flags: approval-aviary?
(Assignee)

Updated

13 years ago
Attachment #167038 - Flags: approval1.7.5?
Attachment #167038 - Flags: approval-aviary?
(Assignee)

Comment 29

13 years ago
Patches checked into trunk by timeless at: 2004-11-25 13:05. Marking fixed.
Status: ASSIGNED → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.8alpha6

Comment 30

13 years ago
Regarding aviary and thunderbird, yes, definitely, as well as similar/related
bug 92075: "Search for Flag".

Comment 31

13 years ago
Comment on attachment 167038 [details] [diff] [review]
Revised search/filter for Imap with no whitespace changes.

1.0 has wrapped and we're looking to the trunk for future releases.
Attachment #167038 - Flags: approval-aviary? → approval-aviary-

Updated

13 years ago
Attachment #167038 - Flags: approval1.7.5? → approval1.7.5-

Updated

13 years ago
Attachment #163211 - Flags: approval1.7.5?
Attachment #163211 - Flags: approval1.7.5-
Attachment #163211 - Flags: approval-aviary?
Attachment #163211 - Flags: approval-aviary-
Question on the "Size".
Which size is passed when partially downloaded mail - whole mail size or size of
already downloaded portion?
("Header only" or "Download size limitation" on POP3)

Comment 33

11 years ago
*** Bug 175384 has been marked as a duplicate of this bug. ***
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.