Page MenuHomePhorge

Files folder shows up in email folder list
Closed, ResolvedPublic1 Story Points

Description

https://issues.kolab.org/show_bug.cgi?id=4474

Ensure no files folder show up in kmail by connecting to server with a files folder created.

Details

Ticket Type
Task

Revisions and Commits

Event Timeline

mollekopf raised the priority of this task from to 60.
mollekopf updated the task description. (Show Details)
mollekopf added a project: KDE PIM.
mollekopf changed Ticket Type from Task to Task.
mollekopf subscribed.
  • create a file folder and add one file to it
  • open kmail and added to to subscription list
  • look at akonadiconsole to see it being created
  • don't see the folder at kmail

-> Can't reproduce: NEEDSINFO

What is the mimetype of the folder?

akonadiconsole -> browser -> right click to the file collection -> "folder properties" -> tab "Internals" -> List "Content Types"

can confirm now with demo account and via docker image cmollekopf/kolab:latest

annotation:

"mailbox" "annotations"

"INBOX" QMap(("/private/vendor/kolab/folder-type", "mail.inbox")("/shared/vendor/kolab/folder-type", "mail"))
"Files" QMap(("/private/vendor/kolab/folder-type", "file.default")("/shared/vendor/kolab/folder-type", ""))

the current behaviour is if a /shared annotation this is used. For "Files" this means isEmpty() -> use default type -> mail type [see KolabHelpers::getFolderTypeAnnotation (kdepim-runtime)]:

QByteArray KolabHelpers::getFolderTypeAnnotation(const QMap< QByteArray, QByteArray > &annotations)
{
    if (annotations.contains("/shared" KOLAB_FOLDER_TYPE_ANNOTATION)) {
        return annotations.value( "/shared" KOLAB_FOLDER_TYPE_ANNOTATION);
    }
    return annotations.value(KOLAB_FOLDER_TYPE_ANNOTATION);
}
  • Is this a error of the server, to not set the /shared folder-type for files?
  • why are the "/private" annotation fetched but not take into account?

The emtpy annotation is a bug possibly in kolabd or so (whoever create the folder with that annotation)
That said, we can work around it by ignoring empty annotations.

getFolderTypeAnnotation should:

  • ignore empty annotations
  • private overrides shared annotations
  • A folder with an unknown annotation shouldn't fall-back to mail, it should be ignored instead.

....

getFolderTypeAnnotation should:

  • ignore empty annotations
  • private overrides shared annotations
  • A folder with an unknown annotation shouldn't fall-back to mail, it should be ignored instead.

The last point doesn't apply to getFolderTypeAnnotation. isHandledType should already correctly ignore unknown folder types, so I'm not sure why it's recognized as a mail folder.

getFolderTypeAnnotation should continue to return annotations.value(KOLAB_FOLDER_TYPE_ANNOTATION); (without shared or private), for backwards compatibility. But only if no
shared or private annotation is found.

  • A folder with an unknown annotation shouldn't fall-back to mail, it should be ignored instead.

The last point doesn't apply to getFolderTypeAnnotation. isHandledType should already correctly ignore unknown folder types, so I'm not sure why it's recognized as a mail folder.

The reason is that folderTypeFromString in libkolab returns type mail for empty annotations. We can't change this because an empty string in this context means no annotation,
and for that case mail is correct. folderTypeFromString must only be called with valid annotations (or an empty string if there is no annotation). the kolab resource therefore
needs to avoid using folderTypeFromString in case of an empty annotation.

We deiscussed and cam to the conclusion:

getFolderTypeAnnotation should:

  • ignore empty annotations
  • shared annotations fallback to private annotations
  • A folder with an unknown annotation shouldn't fall-back to mail, it should be ignored instead.
    • the problem so far is that many mail folders have an invalid shared annotation:
"Spam" QMap(("/private/vendor/kolab/folder-type", "mail.junkemail")("/shared/vendor/kolab/folder-type", ""))
"Drafts" QMap(("/private/vendor/kolab/folder-type", "mail.drafts")("/shared/vendor/kolab/folder-type", ""))

folderTypeFromString:

  • if the type is a special type aka mail.junkemail than sprip it to mail

roundcubemail fixes the shared annotation:

before (wrong):

"Files" QMap(("/private/vendor/kolab/folder-type", "file.default")("/shared/vendor/kolab/folder-type", ""))
  • open folder settings
  • change type to mail and back to file again
  • the annotation afterwards:
"Files" QMap(("/private/vendor/kolab/folder-type", "file.default")("/shared/vendor/kolab/folder-type", "file"))

Can be reproduced using the docker images kontact:latest against kolab/kolabtestcontainer