Bug 288007 - kmail filter import broken
Summary: kmail filter import broken
Status: RESOLVED FIXED
Alias: None
Product: kmail2
Classification: Applications
Component: filtering (show other bugs)
Version: 4.7
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-01 18:45 UTC by Nino
Modified: 2011-12-02 17:08 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 4.8


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nino 2011-12-01 18:45:38 UTC
Version:           4.7 (using KDE 4.7.2) 
OS:                Linux

Trying to import filter rules from old kmailrc (from KDE of kubuntu 10.04) results in wrong destination folders (-> "Unknown folder"). In consequence, none of the imported filters is not saved when quitting the dialog (maybe due to the above error?). Fixing folders manually seems to work but if only one folder is forgotten, none is imported :-(

The only significant difference I found between old fashioned filter rule and actual one is that folders have been referenced by filename while now they seem to be referenced by a number. A diff looks like this
diff -y new old
action-args-0=160  |  action-args-0=.Office-Libre.directory/documentation

Is there any workaround or do I have to manually adjust all my 300+ filter rules? (As written above, I've already tried to fix a couple but the whole bunch did not get saved - maybe due to the still incorrect ones?)

Reproducible: Always

Steps to Reproduce:
Open filter dialog, import old kmailrc with written folder names in field action-args-x. 

Actual Results:  
Folder destination says "Unknown folder ..." (or similar, I'm working with German version saying "Unbekannter Ordner ...")

Then:
1. leave the dialog and reopen it without correcting folder destination: imported filters are lost completely.
2. correct some of the filters but not all, leave the dialog and reopen it: again none of the filters get saved.
3. correcting all filters seems to work (I did not try all of my 300 filters but only 10-20)

Expected Results:  
At least all manually corrected filters should stay saved.

Better: Adjustment of destination folders should happen automatically (e.g. by matching folder names with old file names and converting file names to numbers automatically if matching 100% resp. asking the user if matching is incomplete)

OS: Linux (i686) release 3.1.0-1.2-default
Compiler: gcc
Comment 1 Laurent Montel 2011-12-01 21:23:33 UTC
I confirm it.
Comment 2 Nino 2011-12-02 08:56:10 UTC
Seems to happen only with empty filter list. 
So a possible workaround might be: create at least one new filter manually first, start import only thereafter. Has worked for me.
Comment 3 Laurent Montel 2011-12-02 09:57:04 UTC
no it can't convert old format to new format for the moment.
so your workaround is not valid.
I will fix it
Comment 4 Laurent Montel 2011-12-02 17:08:15 UTC
Git commit a7efb900aa6a6191d8776134b600f08c03bdd4c6 by Montel Laurent.
Committed on 02/12/2011 at 18:07.
Pushed by mlaurent into branch 'master'.

Fix Bug 288007 - kmail filter import broken

now we can import old filter. We can export/import filter.
FIXED-IN: 4.8
BUG: 288007

M  +9    -6    mailcommon/filteraction.cpp
M  +62   -4    mailcommon/filteractionmissingcollectiondialog.cpp
M  +20   -2    mailcommon/filteractionmissingcollectiondialog.h
M  +11   -0    mailcommon/mailutil.cpp
M  +1    -1    mailcommon/mailutil.h

http://commits.kde.org/kdepim/a7efb900aa6a6191d8776134b600f08c03bdd4c6