[kmail2] [Bug 408354] If default maildir folder is changed a new set of folders are stored under "/home/$user/file:"

2020-03-05 Thread Igor Poboiko
https://bugs.kde.org/show_bug.cgi?id=408354

Igor Poboiko  changed:

   What|Removed |Added

 CC||mathias.hom...@opensuse.org

--- Comment #12 from Igor Poboiko  ---
*** Bug 411307 has been marked as a duplicate of this bug. ***

-- 
You are receiving this mail because:
You are the assignee for the bug.

[kmail2] [Bug 408354] If default maildir folder is changed a new set of folders are stored under "/home/$user/file:"

2020-03-01 Thread Igor Poboiko
https://bugs.kde.org/show_bug.cgi?id=408354

Igor Poboiko  changed:

   What|Removed |Added

 Status|REPORTED|RESOLVED
  Latest Commit||https://commits.kde.org/kde
   ||pim-runtime/93ecfacfb9f21ee
   ||027dbcfc7d5d47ddbbb253ba1
 Resolution|--- |FIXED

--- Comment #11 from Igor Poboiko  ---
Git commit 93ecfacfb9f21ee027dbcfc7d5d47ddbbb253ba1 by Igor Poboiko.
Committed on 01/03/2020 at 18:44.
Pushed by poboiko into branch 'master'.

[resources/maildir] Don't save "file:" schema to the config

Summary:
`ConfigWidget` uses `KConfig` underneath, and utilizes `KUrlRequester` custom
widget. The `USER` property of this widget (which is used by `KConfig`) is of
type `QUrl`, and thus when dialog is accepted, the `path` config property
gets overriden with `QUrl::toString()` value, which prepends `file:` schema
(this is basically because `KCoreConfigSkeleton::ItemPath` is inherited from
`ItemString`, and when someone calls `ItemString::setProperty`, it gets
casted as `QVariant::toString`).

Inside the `ConfigWidget::save` the code calls `setPath` method on
`url.toLocalFile`, which drops the scheme. Because of that, the `pathItem`
and `path` property of `mSettings` have different values, first has schema
and the second hasn't. Eventually, the value stored by `pathItem` wins, and
`mSettings->path()` returns URL with schema. However, `Maildir` doesn't expect
it and misinterprets it as the relative path to current WORKDIR (which is home
directory), thus creating `/home/user/file:/home/user/...` file structure.

The proposed solution is to simply call `mSettings->save()`, which overrides
`pathItem` value and drops schema from it.

It also fixes the `AkoNotes` resource, which uses the same `ConfigWidget`.
Funny enough, `Contacts` resource, which is somewhat similar, is not affected
as it has the same `Settings->save()` call.

Alternative approaches include:
1) Teach `Maildir` to drop the schema (if it's there).
2) Teach `KCoreConfigSkeleton::ItemPath` to work with `QUrl` and don't append
schema (it makes sense, because `ItemPath` corresponds to local file. Although
it's not documented that it shouldn't have schema, it seems from the tests that
it was the original intent). This could save the headache of having such issue
in the future, but it could mess up with other programs in funny ways (as
currently `file:` sometimes gets prepended, and some code might implicitly rely
on it)

Additional note:
There are `ui.kcfg_Path->url().isLocalFile()` checks around, which doesn't make
sense to me, as `KUrlRequester` is used for local files and it seems like it
always returns `QUrl` pointing to local file (i.e. have the `file:` schema).
Related: bug 411269, bug 413588

Test Plan:
1) Open `akonadiconsole -> Local Folders` properties, change the folder, save
2) `cat ~/.config/akonadi_maildir_resource_0rc`. `file:` schema gets prepended
2.1) `akonadictl restart`. `file:` folder gets created inside homedir
3) Apply patch, repeat (1)-(2.1). `file:` schema is dropped.

Reviewers: dvratil, mlaurent

Reviewed By: dvratil

Subscribers: kde-pim

Tags: #kde_pim

Differential Revision: https://phabricator.kde.org/D27722

M  +1-0resources/maildir/configwidget.cpp

https://commits.kde.org/kdepim-runtime/93ecfacfb9f21ee027dbcfc7d5d47ddbbb253ba1

-- 
You are receiving this mail because:
You are the assignee for the bug.

[kmail2] [Bug 408354] If default maildir folder is changed a new set of folders are stored under "/home/$user/file:"

2020-02-13 Thread Vojtěch Zeisek
https://bugs.kde.org/show_bug.cgi?id=408354

Vojtěch Zeisek  changed:

   What|Removed |Added

 CC||vojtech.zei...@opensuse.org

--- Comment #10 from Vojtěch Zeisek  ---
I can confirm it on openSUSE Tumbleweed, KMail 5.13.2 (19.12.2), KDE Frameworks
5.66.0, Qt 5.14.1 (built against 5.14.1).

-- 
You are receiving this mail because:
You are the assignee for the bug.

[kmail2] [Bug 408354] If default maildir folder is changed a new set of folders are stored under "/home/$user/file:"

2020-02-04 Thread Jason Straight
https://bugs.kde.org/show_bug.cgi?id=408354

--- Comment #9 from Jason Straight  ---
This just happened to me on Kubuntu 20.04

Thank goodness for the trash bin.

I saw "file:" in my ~ and figured I probably did something stupid to create it
with a bad redirection. So I trashed it.

Few hours later, I realize 250MB of archived mail is gone.

Ver: 19.04.3

-- 
You are receiving this mail because:
You are the assignee for the bug.

[kmail2] [Bug 408354] If default maildir folder is changed a new set of folders are stored under "/home/$user/file:"

2020-02-04 Thread Jason Straight
https://bugs.kde.org/show_bug.cgi?id=408354

Jason Straight  changed:

   What|Removed |Added

 CC||j.straight-...@straights.ne
   ||t

-- 
You are receiving this mail because:
You are the assignee for the bug.

[kmail2] [Bug 408354] If default maildir folder is changed a new set of folders are stored under "/home/$user/file:"

2019-10-09 Thread keitalbame
https://bugs.kde.org/show_bug.cgi?id=408354

--- Comment #8 from keitalbame  ---
I no longer see the folder file: being created on my home folder but the issue
of not being able to use a custom path to the maildir is still present.
Createig any maildir type account always defaults to being created on
~/.local/share/akonadi_maildir_resource_xx.

On Fedora 30, KDE Spin:
kmail 19.04.2-2.fc30
akonadi 1.13.0-113.fc30
plasma-desktop 5.15.5-1.fc30

-- 
You are receiving this mail because:
You are the assignee for the bug.

[kmail2] [Bug 408354] If default maildir folder is changed a new set of folders are stored under "/home/$user/file:"

2019-08-29 Thread Roland Hautz
https://bugs.kde.org/show_bug.cgi?id=408354

Roland Hautz  changed:

   What|Removed |Added

 CC||rha...@kabelmail.de

-- 
You are receiving this mail because:
You are the assignee for the bug.

[kmail2] [Bug 408354] If default maildir folder is changed a new set of folders are stored under "/home/$user/file:"

2019-08-20 Thread keitalbame
https://bugs.kde.org/show_bug.cgi?id=408354

keitalbame  changed:

   What|Removed |Added

 CC||keitalb...@posteo.net

-- 
You are receiving this mail because:
You are the assignee for the bug.

[kmail2] [Bug 408354] If default maildir folder is changed a new set of folders are stored under "/home/$user/file:"

2019-06-27 Thread Dan
https://bugs.kde.org/show_bug.cgi?id=408354

Dan  changed:

   What|Removed |Added

 CC||k...@foskett.org

--- Comment #7 from Dan  ---
I have the same problem. In case jt helps, I noticed that when you use the
dialog to change the Local Folder directory, the path in
~/.config/akonadi_mail_resource_0rc changes from

Path[$e]=$HOME/.local/share/akonadi_maildir_resource_0

to 

Path[$e]=file:$HOME/local-mail

I was able to get my mail back in the default Local Folders by following the
steps to recover from a failed migration. The first time reset the location of
Local Folders to the default without using the dialog box (so "file:" was not
part of the path), and then I moved my mail files there, and went through the
steps a second time, and kmail read all of my stored mail in.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[kmail2] [Bug 408354] If default maildir folder is changed a new set of folders are stored under "/home/$user/file:"

2019-06-11 Thread Laurent Montel
https://bugs.kde.org/show_bug.cgi?id=408354

--- Comment #6 from Laurent Montel  ---
Ok I was able to reproduce it now.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[kmail2] [Bug 408354] If default maildir folder is changed a new set of folders are stored under "/home/$user/file:"

2019-06-11 Thread Nick
https://bugs.kde.org/show_bug.cgi?id=408354

--- Comment #5 from Nick  ---
On the same computer I created a new user. I then changed the default location
of the maildir folder from /home/[user]/.local/share/local-mail to a folder
called /home/[user]/emails. Both locations are on the same partition. No
symbolic links are involved.

kmail (or akonadi) then creates a directory file:/home/[user]/emails/inbox

Even more oddly the ..inbox/ folder that contains the subdirectories new, cur
and tmp, if you look inside new you will find another subdirectory called file:

This path in full is shown here. This is created by either kmail or Akonadi.

/home/marmite/file:/home/marmite/local-mail/inbox/new/file:/home/marmite/local-mail/inbox/new/new

-- 
You are receiving this mail because:
You are the assignee for the bug.

[kmail2] [Bug 408354] If default maildir folder is changed a new set of folders are stored under "/home/$user/file:"

2019-06-11 Thread Nick
https://bugs.kde.org/show_bug.cgi?id=408354

--- Comment #4 from Nick  ---
I'll do a fresh install and see if I can find specifically what triggers this
problem.

One thing that is most likely different from the average install is that
/home/nick/Data is a symbolic link to /media/nick/Data_sdb. 

/media/nick/Data_sdb is mounted at boot to /dev/sdb3

The df entry looks like this:
/dev/sdb3591G  556G  4.8G 100% /media/nick/Data_sdb
(I know the partition is at 100%)

And the /etc/fstab entry is:
UUID=329dc068-a4ed-45fd-9b0b-0ef09ca926ee /media/nick/Data_sdb ext4 defaults 0
2

My initial thoughts are that this symbolic linking and use of a different
partition 'may' have something to do with the problem.

So my plan would be to start with a working install using the default maildir
location, then change to a valid maildir folder on a different directory. Not
forgetting the symbolic link.

I'll update you if I can reproduce this on a fresh install.

Just to note, I have tried deleting  /home/nick/.local/share/akonadi and
letting it rebuild but it still would not index the emails.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[kmail2] [Bug 408354] If default maildir folder is changed a new set of folders are stored under "/home/$user/file:"

2019-06-11 Thread Laurent Montel
https://bugs.kde.org/show_bug.cgi?id=408354

--- Comment #3 from Laurent Montel  ---
For the moment I can't reproduce bug...

-- 
You are receiving this mail because:
You are the assignee for the bug.

[kmail2] [Bug 408354] If default maildir folder is changed a new set of folders are stored under "/home/$user/file:"

2019-06-05 Thread Nick
https://bugs.kde.org/show_bug.cgi?id=408354

--- Comment #2 from Nick  ---
That's great!. Thank You.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[kmail2] [Bug 408354] If default maildir folder is changed a new set of folders are stored under "/home/$user/file:"

2019-06-05 Thread Laurent Montel
https://bugs.kde.org/show_bug.cgi?id=408354

Laurent Montel  changed:

   What|Removed |Added

 CC||mon...@kde.org

--- Comment #1 from Laurent Montel  ---
it's a problem with url vs string.
I will investigate it soon

-- 
You are receiving this mail because:
You are the assignee for the bug.