[QuickFolders] [Bug 25356] More complex filters

Axel Grude axel.grude at gmail.com
Sun Mar 3 08:47:46 UTC 2013


Hello Yango,

first and foremost, that is indeed a Thunderbird bug, and to be honest, a little out 
of scope for me and my humble Addons but if you want to help, here is my feedback on 
this - a quick search on bugzilla (product=thunderbird, search string=complex filters) 
reveals this */one/* bug only:

https://bugzilla.mozilla.org/show_bug.cgi?id=846367

It would be great if you could contribute some of your ideas on this topic there.

> Thus, a combination of rules would be necessary:
> A. If sender is "myfriend at mail.com" AND subject contains "Viagra" then move message 
> to "Medical|Viagra"
> This is working, yes. But my reply needs an own filter, and I have to define it in a 
> separate action:
> B. If recipient is "myfriend at mail.com" AND subject contains "Viagra" then move 
> message to "Medical|Viagra".
>
> This could be overcome by more complex filters:
> C. If sender OR recipient  is "myfriend at mail.com" AND subject contains "Viagra" then 
> move message to "Medical|Viagra".
> I guess this is a problem of thunderbird itself and not of your addon.
> However, your addon could help by automatically defining a pair of filters: A and B.
now the interesting bit: AFAIK Thunderbird's actual /filter engine /already supports 
such constructs.

The main problem is to build a usable UI, and by usable I mean something that is 
readily understood by users who usually work with boolean logic.

> Of course, Version C would be better, and if C is installedd an addon offering the 
> workaround is nonsense. On the other hand the filter fuctionality of thunderbird 
> wasn't changed for years, so they seem to rate it not very important (however, it 
> would help me tremendeously).

Well sadly, it's not just Filters but, as you may have heard, innovation as whole in 
Thunderbird must now be provided by the community; there is a list of prioritized bugs 
(papercuts) which tries to outline what should be fixed until the next major release.

The workaround with FiltqQuilla is an interesting one (by "simply" creating new more 
complex filter conditions which then can be either ORed or ANDed together) but 
ultimately it is still a workaround that doesn't lend itself to cover 100% of the 
cases (as a UI that supports combinations of OR + AND would). Also what we need to 
think of is that fact that normal users not aware of operator precedence (AND binds 
before OR) and one would have to also somehow include creation of Parentheses, in 
order to support both conditions like:

i)     If A  or (B and C) => Action Z

ii)    If (A or B) and C => Action Z


Just of the cuff, maybe one way to solve this would be by nesting other filters as 
subconditions. These other filters would not necessarily have an action.


One way to achieve this with the current filters would be like this:

i)     If A  or (B and C) => Action Z

if B and C  tag mail as XXX
if A or mail tagged as XXX => Action Z, and remove XXX tag

ii)    If (A or B) and C => Action Z

if A or B  tag mail as XXX
if C and mail tagged as XXX => Action Z

Of course in both cases you would have to remove the XXX tags again after all work is 
done.

In terms of UI, this "Nesting" of Filters, could offer something like this:



(Selectiong of another Filter might be optional for a first implementation). The 
important thing here is that clicking on the "Edit nested Conditions" button (after 
selecting "Nested Filter" "applies to Mail") you would essentially just use the same, 
familiar interface for building these nested conditions and there you could freely 
decide whether to choose the AND or the OR operator to chain these conditions 
together. In our example:

ii)    If (A or B) and C => Action Z

A = Sender is Malachi (who just does Reviews)
B = Body contains Review
C = Subject Contains QuickPasswords

If (Sender is Malachi OR Body contains Review) AND Subject Contains QuickPasswords

In the above screenshot you would now create the condition (Sender is Malachi OR Body 
contains Review) by clicking on the Edit button, and you would also probably have to 
give it a meaningful name in order to have it appear as a label, such as

"Is Review Related"


if A or B tag mail as XXX
if C and mail tagged as XXX => Action Z



As regards UI building, this is relatively light weight, and it also doesn't really 
require for the user to learn any new skills (other than knowing of the concept of 
nesting)

What do you think? I am also cc-ing the Tb-Planning list and the author of 
FiltaQuilla, just to get some feedback on this

> Both present a solution, but for the normal user and/or multiple mail accounts to be 
> set: I could imagine that such a functionality is very badly needed and could give 
> quickfilters a boost...
> BTW: think about copying filter rules from one account to another?
Definitely and totally next on my agenda for my quickFilters agenda - please raise a 
bug on quickFilters!

As I have just tackled the problem of Filter merging 
<https://www.mozdev.org/bugs/show_bug.cgi?id=25199> this is the next logical step. In 
my latest beta, have created an interface to Merge filters together, here is the 
screen flow:

1. select multiple filters click merge button


2. [Optional] Remove filters that do not match the same action (e.g. move to folder XYZ)


3. Edit the merged filter


4. On clicking [OK], merged filters are removed and the list refreshes with 
consolidated result(s)



This functionality is a missing piece in the much needed Cut / Copy / Paste 
functionality, and when copying filters across accounts there should be a detection of 
other filters that do the same thing already and merge should be offered, as now does 
quickFilters when you (drop or create from mail):



So please go ahead raise that (copy/cut/paste) bug on quickFilters and I will happily 
start working on this after the next release with the Merge.

Apologies to Tb-Planning for so much Addon related stuff but I think it is an 
interesting question and the possible UI solutions complex filter creation is 
something that is worth while discussing here.

If there is interest I volunteer on creating a prototype in form of an Addon first.


kind regards,
   Axel




*To:* Axel <mailto:axel.grude at googlemail.com>
*From:* Yango Pohl <mailto:yango.pohl at zahnunfall.de>
*Sent: *Sunday, 03/03/2013 07:06:37 07:06 GMT Standard Time {GMT ST} +0000 [Week 10]
*Subject:*Re: [QuickFolders] [Bug 25356] More complex filters
> Dear Axel,
> I'm not quite sure if I understood everything right, so I just mail to not openn an 
> unneccessary ticket.
> First, sorry for submitting in quickfolders instead of quickfilters. For me they 
> belong to each other, so I did not realize that there are different feature requests...
> Then, I realize, that it is mainly not a question to you and your add-on, but 
> instead to the thunderbird core group.
> However, you could help with a workaround, if they won't change the filter 
> functionality (which is obviously the case).
>
> Scenario:
> Several to many persons to whom there are many mail contacts, with different subjects.
> Several to many similar subjects but not restriced to these mail contacts.
>
> Thus, a combination of rules would be necessary:
> A. If sender is "myfriend at mail.com" AND subject contains "Viagra" then move message 
> to "Medical|Viagra"
> This is working, yes. But my reply needs an own filter, and I have to define it in a 
> separate action:
> B. If recipient is "myfriend at mail.com" AND subject contains "Viagra" then move 
> message to "Medical|Viagra".
>
> This could be overcome by more complex filters:
> C. If sender OR recipient  is "myfriend at mail.com" AND subject contains "Viagra" then 
> move message to "Medical|Viagra".
> I guess this is a problem of thunderbird itself and not of your addon.
> However, your addon could help by automatically defining a pair of filters: A and B.
>
> Of course, Version C would be better, and if C is installedd an addon offering the 
> workaround is nonsense. On the other hand the filter fuctionality of thunderbird 
> wasn't changed for years, so they seem to rate it not very important (however, it 
> would help me tremendeously).
>
> So, I don't know what to do. Open a ticket for basic filter change at thb and wait 
> for a reply? This obviously had been done without success / there are uncountable 
> search results in google for "thunderbird filters complex"... Or shall I open a 
> ticket for your addon? Seems to be the way with a better prognosis?!
> Maybe you as a programmer are a little bit closer to the core group and could better 
> get information about future developments, and whether such a workaround would make 
> sense?
>
> interesting links:
> http://superuser.com/questions/51148/how-to-combine-filter-rules-in-message-filters-in-thunderbird-to-create-more-adv
> and
> http://superuser.com/questions/452246/how-do-i-create-an-email-filter-with-complex-logic
>
> Both present a solution, but for the normal user and/or multiple mail accounts to be 
> set: I could imagine that such a functionality is very badly needed and could give 
> quickfilters a boost...
> BTW: think about copying filter rules from one account to another?
>
> Kind regards
> Yango
>
>
>
>
> Am 02.03.2013 21:57, schrieb bugzilla-daemon at mozdev.mozdev.org:
>> https://www.mozdev.org/bugs/show_bug.cgi?id=25356
>>
>>
>> Axel Grude<axel.grude at gmail.com>  changed:
>>
>>             What    |Removed                     |Added
>> ----------------------------------------------------------------------------
>>               Status|NEW                         |RESOLVED
>>           Resolution|                            |WONTFIX
>>
>>
>>
>>
>> --- Comment #1 from Axel Grude<axel.grude at gmail.com>   2013-03-02 12:57:42 ---
>> Well we cannot just make "more complex filters" as a template (which is
>> supposed to be used more than once for creating different filters, you have to
>> be more concrete than this. Second you can always add additional conditions, so
>> without a concrete example it is a little doubtful whether a template would
>> really help here? Third, I would really prefer if you could file these bugs
>> under the quickFilters addon as this is more specifically written for filter
>> management and it is more likely that I will add these features there rather
>> than bloating QuickFolders with it.
>>
>> QuickFolders is of course fully compatible with quickFilters and triggers the
>> quickFilters methods directly once you drop a mail to a QuickFolders tab or
>> folder menu item.
>>
>> I will mark this as WONTFIX but encourage you to re-raise this (and maybe give
>> a more concrete example) on the quickFilters addon:
>>
>> http://quickfilters.mozdev.org/bugs.html
>>
>> Note there is already quite a bit of innovation happening there currently -
>> there is merging and re-using filters, and I am also planning on cut / copy /
>> paste functions in the near future.
>>
>>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/tb-planning/attachments/20130303/ed9849bc/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cgagfehe.png
Type: image/png
Size: 54675 bytes
Desc: not available
URL: <http://mail.mozilla.org/pipermail/tb-planning/attachments/20130303/ed9849bc/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jjbdfffd.png
Type: image/png
Size: 36066 bytes
Desc: not available
URL: <http://mail.mozilla.org/pipermail/tb-planning/attachments/20130303/ed9849bc/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fgedcaij.png
Type: image/png
Size: 61277 bytes
Desc: not available
URL: <http://mail.mozilla.org/pipermail/tb-planning/attachments/20130303/ed9849bc/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fdhbchic.png
Type: image/png
Size: 23862 bytes
Desc: not available
URL: <http://mail.mozilla.org/pipermail/tb-planning/attachments/20130303/ed9849bc/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gaeihbjb.png
Type: image/png
Size: 68182 bytes
Desc: not available
URL: <http://mail.mozilla.org/pipermail/tb-planning/attachments/20130303/ed9849bc/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dfhcaege.png
Type: image/png
Size: 41823 bytes
Desc: not available
URL: <http://mail.mozilla.org/pipermail/tb-planning/attachments/20130303/ed9849bc/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bhfeaied.png
Type: image/png
Size: 43200 bytes
Desc: not available
URL: <http://mail.mozilla.org/pipermail/tb-planning/attachments/20130303/ed9849bc/attachment-0006.png>


More information about the tb-planning mailing list