Bug 415245 - Create Maildir ressource on valid maildir could result in not showing mails
Summary: Create Maildir ressource on valid maildir could result in not showing mails
Status: REPORTED
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: Maildir Resource (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-16 13:59 UTC by Christoph Thielecke
Modified: 2020-05-03 12:18 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christoph Thielecke 2019-12-16 13:59:14 UTC
I have the problem found, when I adding a new maildir ressource for a maildir located in my home directory (e.g. ~/MailStore/Account2), the ressource will added but no mails are shown in ressource.

STEPS TO REPRODUCE
1. Copy maildir to home dir somewhere (e.g. ~/MailStore/Account2)
2. create new maildir ressource for the maildir copied (e.g. ~/MailStore/Account2)

OBSERVED RESULT
The ressource is added but its shown empty (no mail or folder).

A interesting thing is, that sometimes it works when I let create it on desired location (e.g. ~/.local/share/akonadi_maildir_resource_2). When that works fine, remove the created directory and replace the folder by a symbolic link to the desired maildir it found the mails and folders.

Also, I can't rename the resource name (I guess it takes the name from folder but that seem to work only on creation.

EXPECTED RESULT
The ressource is added and it shows contents (mails and folders).

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 5.3.0-24-lowlatency #26~18.04.2-Ubuntu SMP PREEMPT Tue Nov 26 14:39:35 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
KDE Plasma Version: 5.12.9.1-0ubuntu0.1build1~ubuntu18.04~ppa1
KDE Frameworks Version: 5.47.0-0ubuntu1~ubuntu18.04~ppa1
Qt Version: 5.9.5

ADDITIONAL INFORMATION
Starting akonadi using "akonadictl start" shows:
org.kde.pim.akonadicontrol: "AgentManager::agentInstanceSynchronizeCollection"  Agent instance  "akonadi_maildir_resource_2"  has no resource interface!
org.kde.pim.akonadiserver: "Cannot connect to agent instance with identifier 'akonadi_maildir_resource_2', error message: ''
Comment 1 Igor Poboiko 2020-05-03 12:18:38 UTC
Git commit 4ab1f2068b53d3fabe3cf35c087f28bf10bca672 by Igor Poboiko.
Committed on 03/05/2020 at 12:18.
Pushed by poboiko into branch 'release/20.04'.

[resources/maildir] Reload configuraton on configuration change

Summary:
When user adds new maildir, a new resource gets created, with the default
directory `~/.local/share/local-mail`. Since it's a new resource, with no
proper configuration, an `attemptConfigRestoring()` is called, which changes
it to `~/.local/share/akonadi_maildir_resource#`. It's stored inside
`mSettings->path()`.

Then a dialog appears, where user can choose prefered directory. It gets
written to the config file; then `configurationChanged` gets called.
We call `mSettings->save()`, which overwrites the path provided by user with
the default one (`~/.local/share/akonadi_maildir_resource#`), making it
impossible to create a new maildir anywhere else.

Just use `load()` instead, it makes more sense when configuration was changed.
Related: bug 416287, bug 415922

Test Plan:
1) Create a new maildir resource pointing to `/tmp/dummy`.
2) The resource gets created, with the name `dummy`. `/tmp/dummy` gets created.
2) Drop some mails into it via KMail. Mails appear inside `/tmp/dummy`

Reviewers: dvratil, mlaurent

Reviewed By: dvratil

Subscribers: wbauer, kde-pim

Tags: #kde_pim

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

M  +2    -1    resources/maildir/maildirresource.cpp

https://commits.kde.org/kdepim-runtime/4ab1f2068b53d3fabe3cf35c087f28bf10bca672