K-9: Automatically detect and use special folders. Don't create new ones

Created on 29 Apr 2015  Â·  14Comments  Â·  Source: k9mail/k-9

Currently when setting up K-9 Mail newly, shortly afterwards I will find myself with second folders for Sent, Junk, Drafts and Trash. (At least that is the case for me where my mail server uses special folders named in English, and my Android is set to French. K-9 Mail creates new French special folders.)

I need to manually go into the settings and plug them in correctly. Instead, K-9 should automatically use the existing special folders.

bug enhancement

Most helpful comment

Yes, in Nextcloud Mail we just guess the special role based on common names. See the code here: https://github.com/nextcloud/mail/blob/08f193948f17b27caba8e3e7c3f3e0017c79614c/lib/mailbox.php#L286-L311

(cc @DeepDiver1975, fellow Nextcloud Mail developer)

All 14 comments

This is a pretty valid issue, but how do you fix it? I suppose you could check the account for the most commonly formatted folder names and set the account settings to which ones you find? Surely some email software will inevitably have cases you will miss, but you can probably get most of them.

"Sent" or "Sent Items", "Junk", "Junk E-mail", or "Spam", "Trash" or "Deleted Items".

Yes, in Nextcloud Mail we just guess the special role based on common names. See the code here: https://github.com/nextcloud/mail/blob/08f193948f17b27caba8e3e7c3f3e0017c79614c/lib/mailbox.php#L286-L311

(cc @DeepDiver1975, fellow Nextcloud Mail developer)

@jancborchardt Random FYI, on our Exchange server, it's "Junk E-mail", a case not in your function. :) I haven't used ownCloud's mail, so I have no idea if that's relevant/useful, but it might be if you import from there or something.

@ocdtrekkie would be very cool and helpful if you can test Nextcloud Mail with that server. (No worries – it’s just an IMAP client and I use it in production since some time.) If it in fact is not working, just submit a pull request adding the folder name to the list we have. :)

This is a pretty valid issue, but how do you fix it? I suppose you could check the account for the most commonly formatted folder names and set the account settings to which ones you find? Surely some email software will inevitably have cases you will miss, but you can probably get most of them.

There is a IMAP extension allowing to detect such special folders - https://tools.ietf.org/html/rfc6154

K-9 Mail supports the LIST extension and Google's XLIST extension. So if your server supports this special folders are correctly configured. I'm hesitant to implement any magic beyond that.

Also, missing functionality is not a bug :)

It does not detect the right folders with my dovecot, which should implement the needed RFC (and works with thunderbird).

Same here for Dovecot and Thunderbird. After manual configuration, all works, except Junk. See also https://code.google.com/p/k9mail/issues/detail?id=301 to move SPAM to Junk.

Please fix this.

I'm fed up with duplicate special folders.

This is an old bug and the most annoying one in K9mail, not a "missing feature". Users expect their mail clients to use existing special folders and not creating duplicate ones. Would be great if someone could fix it!

The worst: It sometimes creates a folder INBOX.INBOX (INBOX as a Subfolder of the Inbox).
It always feels dangerous to delete the false inbox folder.

I'm increasingly convinced it's a bug that it creates duplicates.

K9, by creating superfluous folder duplicates in the localized language of the phone, breaks easy synchronization with other clients. Sent mails from the phone are not in the sent folder in Thunderbird on the desktop and to an average user it's not at all clear why this happens, in fact it looks like a synchronization issue, data loss or worse.
Once the underlying issue is understood (that K9 insists on localizing underlying data - folder names -, not just displaying it in a localized GUI as it should) I may try to work around it. I can change the folders used for Sent, Trash, Drafts, Spam in Thunderbird to the localized folders K9 created in it's own unwanted initiative. Can I also tell K9 to use the standard folders which are already populated? Yes. But it's clumsy. Since one can't delete folders with K9 it should neither create them. This is a bug.

Anyone knows how to delete the folders?

Hi there,
i am using version 5.600 from F-Droid.
Despite #3253, K-9 just created a bunch of new folders on its own on my imap server, after setting up a new account. They were created in my local language (german), and now I am stuck with dublicate empty folders "Entwürfe" (german for drafts) and "Gesendet" (german for sent). I can't seem to delete those folders anywhere. In the UI of the mail server, these new folders do not show up. Only if I try to manually create a new folder with the same name, it sais the folder already exists. To clean up this mess, it seems the only way is to completely delete the mail account on my server. I will recreate the mailaccount on the server and keep K-9 in english. Hopefully then it will use the existing folders.

Therefore, this issue does not seem to be resolved. Is there any information I can provide to help solve it?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

robsmith11 picture robsmith11  Â·  3Comments

farson2003 picture farson2003  Â·  4Comments

jrtberlin picture jrtberlin  Â·  3Comments

frederiiiic picture frederiiiic  Â·  3Comments

bam80 picture bam80  Â·  4Comments