KDE Bug Tracking System
Home
Report New Wish or Bug
Query Existing Reports
First
Last
Prev
Next
No search results available
Search page
Bug
101001
:
Filter on Status Spam broken after update
P
roduct
:
kmail
Co
m
ponent
:
filtering
Status
:
RESOLVED
Resolution
:
FIXED
Target
:
---
Version
:
1.8
Pr
i
ority
:
NOR
Severity
:
normal
V
otes
:
0
Description
:
Opened:
2005-03-06 23:42
Last Changed:
2007-09-14 12:17:01
Version: 1.8 (using KDE 3.4.0, Gentoo) Compiler: gcc version 3.3.5 (Gentoo Linux 3.3.5-r1, ssp-3.3.2-3, pie-8.7.7.1) OS: Linux (i686) release 2.6.10-gentoo-r4 After my update to KDE 3.4.0-rc1, the filter which filtered on "Status is Spam" was broken. Instead of "Spam", the status "Important" (the first one in the list) was selected. Very annyoing as all the spam flooded into my inbox. I already fixed this filter but the following is a similar example: <before> [Filter #17] ConfigureShortcut=false ConfigureToolbar=false Icon= StopProcessingHere=false action-args-0=R action-name-0=set status actions=1 apply-on=check-mail contentsA=spam contentsB=text/html|message/alternative fieldA=<status> fieldB=Content-Type funcA=contains funcB=regexp name=M: UBE: HTML operator=and rules=2 </before> <after> [Filter #15] AutomaticName=true ConfigureShortcut=false ConfigureToolbar=false Icon= StopProcessingHere=false action-args-0=R action-name-0=set status actions=1 apply-on=check-mail contentsA=spam contentsB=text/html|message/alternative fieldA=<status> fieldB=Content-Type funcA=contains funcB=regexp name=M: UBE: HTML operator=and rules=2 </after> Hmmm... the filter still looks ok, but I noticed that the fixed one has an upper-cased value "Spam" now. Is that one not case-insensitive? Also note that an "AutomaticName=true" was added which is very annoying if you modify the filter.
Comment
#1
Andreas Gungl 2005-03-07 09:07:30
Am Sonntag, 6. März 2005 23:42 schrieb Malte S.Stretz:
> <before> > [Filter #17] > ConfigureShortcut=false > ConfigureToolbar=false > Icon= > StopProcessingHere=false > action-args-0=R > action-name-0=set status > actions=1 > apply-on=check-mail > contentsA=spam > contentsB=text/html|message/alternative > fieldA=<status> > fieldB=Content-Type > funcA=contains > funcB=regexp > name=M: UBE: HTML > operator=and > rules=2 > </before> > <after> > [Filter #15] > AutomaticName=true > ConfigureShortcut=false > ConfigureToolbar=false > Icon= > StopProcessingHere=false > action-args-0=R > action-name-0=set status > actions=1 > apply-on=check-mail > contentsA=spam > contentsB=text/html|message/alternative > fieldA=<status> > fieldB=Content-Type > funcA=contains > funcB=regexp > name=M: UBE: HTML > operator=and > rules=2 > </after>
>
> Hmmm... the filter still looks ok, but I noticed that the fixed one has > an upper-cased value "Spam" now. Is that one not case-insensitive?
Sorry, I can't see the "Spam" vs. "spam" thing somewhere in your example. However, the matching by regexp should still work case-insensitive. (And it does here with RC1 on Suse 9.2 as well as with CVS HEAD.)
> Also note that an "AutomaticName=true" was added which is very annoying > if you modify the filter.
AutomaticName=true is set for newly created filters. If you modify the name in the GUI, it is no longer set allowing you to use whatever name you like. You can set it back to automatic naming by providing an empty name. If you only change rules, the name is adjusted as long as as AutomaticName=true is set. As to the problem with the wrong status, perhaps an update script did something wrong? I'm not aware of any change in the filtering code which could cause such a change.
Comment
#2
Malte S Stretz 2005-03-07 09:16:30
I didn't post the spam vs. Spam version. <before> is from my backup of the old rcfile, <after> the one I got after I updated KMail. After I fixed the filter in the rules dialog, I now have the following one: <fixed> [Filter #15] AutomaticName=true ConfigureShortcut=false ConfigureToolbar=false Icon= StopProcessingHere=false action-args-0=R action-name-0=set status actions=1 apply-on=check-mail contentsA=Spam contentsB=text/html|message/alternative fieldA=<status> fieldB=Content-Type funcA=contains funcB=regexp name=M: UBE: HTML operator=and rules=2 </fixed> About AutomaticName: It seems like on update this tag is added to all old filters which do not have it yet, not only new ones but all existing.
Comment
#3
Malte S Stretz 2005-03-07 09:23:50
Just to make it more clear: 1. This is about funcA/fieldA/contentsA 2. <before> worked with 1.7, <after> didn't work with 1.8 and <fixed> works with 1.8 again.
Comment
#4
Andreas Gungl 2005-03-07 17:17:53
Ah, now I understand. The filter action doesn't mark the wrong status, but the filter rules filter on the wrong status. Let's see how we can fix that. Adding AutomaticName=true to all filters is a clear bug as well.
Comment
#5
Andreas Gungl 2005-04-08 20:48:35
CVS commit by gungl: Avoid case-sensitivity of the filter-rules for status values, use a more sensible default when assuming automatic naming for filters (which is set to off now) BUGS:101001 M +1 -1 kmfilter.cpp 1.72 M +18 -16 kmsearchpattern.cpp 1.78 --- kdepim/kmail/kmfilter.cpp #1.71:1.72 @@ -218,5 +218,5 @@ void KMFilter::readConfig(KConfig* confi bConfigureToolbar = bConfigureToolbar && bConfigureShortcut; mIcon = config->readEntry( "Icon", "gear" ); - bAutoNaming = config->readBoolEntry("AutomaticName", true); + bAutoNaming = config->readBoolEntry("AutomaticName", false); int i, numActions; --- kdepim/kmail/kmsearchpattern.cpp #1.77:1.78 @@ -585,35 +585,37 @@ KMMsgStatus KMSearchRuleStatus::statusFr { KMMsgStatus status = 0; - if ( ! aStatusString.compare("Important") ) + QString statusString = aStatusString.upper(); + + if ( ! statusString.compare( QString("Important").upper() ) ) status = KMMsgStatusFlag; - if ( ! aStatusString.compare("New") ) + if ( ! statusString.compare( QString("New").upper() ) ) status = KMMsgStatusNew; - if ( ! aStatusString.compare("Unread") ) + if ( ! statusString.compare( QString("Unread").upper() ) ) status = KMMsgStatusUnread | KMMsgStatusNew; - if ( ! aStatusString.compare("Read") ) + if ( ! statusString.compare( QString("Read").upper() ) ) status = KMMsgStatusRead; - if ( ! aStatusString.compare("Old") ) + if ( ! statusString.compare( QString("Old").upper() ) ) status = KMMsgStatusOld; - if ( ! aStatusString.compare("Deleted") ) + if ( ! statusString.compare( QString("Deleted").upper() ) ) status = KMMsgStatusDeleted; - if ( ! aStatusString.compare("Replied") ) + if ( ! statusString.compare( QString("Replied").upper() ) ) status = KMMsgStatusReplied; - if ( ! aStatusString.compare("Forwarded") ) + if ( ! statusString.compare( QString("Forwarded").upper() ) ) status = KMMsgStatusForwarded; - if ( ! aStatusString.compare("Queued") ) + if ( ! statusString.compare( QString("Queued").upper() ) ) status = KMMsgStatusQueued; - if ( ! aStatusString.compare("Sent") ) + if ( ! statusString.compare( QString("Sent").upper() ) ) status = KMMsgStatusSent; - if ( ! aStatusString.compare("Watched") ) + if ( ! statusString.compare( QString("Watched").upper() ) ) status = KMMsgStatusWatched; - if ( ! aStatusString.compare("Ignored") ) + if ( ! statusString.compare( QString("Ignored").upper() ) ) status = KMMsgStatusIgnored; - if ( ! aStatusString.compare("To Do") ) + if ( ! statusString.compare( QString("To Do").upper() ) ) status = KMMsgStatusTodo; - if ( ! aStatusString.compare("Spam") ) + if ( ! statusString.compare( QString("Spam").upper() ) ) status = KMMsgStatusSpam; - if ( ! aStatusString.compare("Ham") ) + if ( ! statusString.compare( QString("Ham").upper() ) ) status = KMMsgStatusHam; - if ( ! aStatusString.compare("Has Attachment") ) + if ( ! statusString.compare( QString("Has Attachment").upper() ) ) status = KMMsgStatusHasAttach;
Comment
#6
Andreas Gungl 2005-04-09 20:27:07
As the last change was not accepted as being of appropriate quality, I've reverted the fix and reopen this bug report. Sorry, it will take a while to come up with a more complex patch to fix it in a more sophisticated manner because I can't afford much time for KMail hacking currently. If anyone wants to take over, you can at least see clearly where the problem is.
Comment
#7
Till Adam 2005-04-09 22:54:53
On Saturday 09 April 2005 20:27, Andreas Gungl wrote:
> As the last change was not accepted as being of appropriate quality, I've > reverted the fix and reopen this bug report. Sorry, it will take a while to > come up with a more complex patch to fix it in a more sophisticated manner > because I can't afford much time for KMail hacking currently. If anyone > wants to take over, you can at least see clearly where the problem is.
I've committed the cleanup Marc suggested, but have not changed the match to be case insensitive. How did the lower case "spam" end up in that filter rule in the first place?
Comment
#8
Andreas Gungl 2005-04-10 08:28:51
Am Samstag, 9. April 2005 22:54 schrieb Till Adam:
> How did the lower case "spam" end up in that filter > rule in the first place?
It comes from an KDE 3.3.x installation where KMail used the lower case "spam" in contradiction to capitalized status values for the other states.
Comment
#9
Till Adam 2005-04-10 10:06:41
On Sunday 10 April 2005 08:28, Andreas Gungl wrote:
> Am Samstag, 9. April 2005 22:54 schrieb Till Adam: > > How did the lower case "spam" end up in that filter > > rule in the first place?
>
> It comes from an KDE 3.3.x installation where KMail used the lower case > "spam" in contradiction to capitalized status values for the other states.
Then that was a bug and the right fix is to write an update script which fixes such broken filters on update, I think.
Comment
#10
Ingo Klöcker 2005-04-18 00:20:52
CVS commit by kloecker: Add configuration update script for fixing changed keys for filtering by status. BUGS:101001 A kmail-3.4.1-update-status-filters.pl 1.1 M +2 -1 Makefile.am 1.331 M +4 -0 kmail.upd 1.30 M +2 -1 kmstartup.cpp 1.41 --- kdepim/kmail/Makefile.am #1.330:1.331 @@ -168,5 +168,6 @@ kmail-3.3-misc.pl \ kmail-3.3b1-misc.pl \ - kmail-3.4-misc.pl + kmail-3.4-misc.pl \ + kmail-3.4.1-update-status-filters.pl confdir = $(kde_confdir) --- kdepim/kmail/kmstartup.cpp #1.40:1.41 @@ -113,5 +113,6 @@ void checkConfigUpdates() { "3.4-misc", "3.4a", - "3.4b" + "3.4b", + "3.4.1" }; static const int numUpdates = sizeof updates / sizeof *updates; --- kdepim/kmail/kmail.upd #1.29:1.30 @@ -155,4 +155,8 @@ Options=copy Key=list-font,list-unread-font +# Convert status filter rules to upper case (cf.
bug #101001
) +Id=3.4.1 +File=kmailrc +Script=kmail-3.4.1-update-status-filters.pl,perl # # Important notice:
P
latform
:
unspecified
O
S
:
Linux
K
eywords
:
U
RL
:
People
Reporter
:
Malte S Stretz
Assigned To
:
kdepim bugs
Related actions
View Bug Activity
Format For Printing
XML
Clone This Bug
Note
You need to
log in
before you can comment on or make changes to this bug.
Attachments
Add an attachment
(proposed patch, testcase, etc.)
Depends on
:
B
locks
:
Show dependency tree
-
Show dependency graph
First
Last
Prev
Next
No search results available
Search page
Actions
Reports
Requests
Reports
Bugs reported today
Bugs reported in the last 3 days
Bug reports with patches
Weekly Bug statistics
The most hated bugs
The most severe bugs
The most frequently reported bugs
The most wanted features
Junior Jobs
Report ownership counts and charts
My Account
New Account
Log In