Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guessing mailbox special use should not apply to sub-folders #4042

Open
jhesketh opened this issue Nov 9, 2020 · 10 comments
Open

Guessing mailbox special use should not apply to sub-folders #4042

jhesketh opened this issue Nov 9, 2020 · 10 comments

Comments

@jhesketh
Copy link

jhesketh commented Nov 9, 2020

Expected behavior

When you have multiple Inbox (or Archive/Sent/Etc) folders in sub-directories, they are just displayed as top level folders in the UI. This is very confusing as they all appear with the same name. For example, if I have the following folders:

Inbox
Sent
My Backups
old_email/Inbox
old_email/Sent
old_email/Other

I would expect them to be listed like that, with the "old_email/Inbox" as a drop down under "old_email".

Actual behavior

Instead (from the example), I get the following:

Inbox
Inbox
Sent
Sent
My Backups
old_email/Other

The only way to differentiate which folder is which is by clicking the ... menu item.

Mail app

Mail app version: 1.6.0

Mailserver or service: IMAP (self hosted)

Server configuration

Operating system: nextcloud upstream docker container

Web server: apache2

Database: mariadb

PHP version: 7.4.12

Nextcloud Version: 20.0.1

Client configuration

Browser: Firefox 81.0.1

Operating system: OpenSUSE tumbleweed

@ChristophWurst
Copy link
Member

version?

@ChristophWurst
Copy link
Member

fill out the issue template please

@jhesketh
Copy link
Author

jhesketh commented Nov 9, 2020

I've updated the issue with the template. I assumed most of it was irrelevant since it's not an abnormality rather than an implementation issue sorry.

@no-response no-response bot removed the needs info label Nov 9, 2020
@ChristophWurst
Copy link
Member

Please provide us with the mailbox names and delimiters.

  1. Locate the account ID: https://github.com/nextcloud/mail/blob/master/doc/admin.md#get-account-ids
  2. Run select `name`, `delimiter`, `attributes` from oc_mail_mailboxes where account_id = <accountId>; on the database
  3. Post the results but redact sensitive information

@jhesketh
Copy link
Author

jhesketh commented Nov 9, 2020

This is actually just a shortened/subset list, but will hopefully give you an idea of why having the INBOX/Junk/etc brought to the top in all cases is confusing (at least for my use).



+--------------------------------------------------------------------+-----------+-------------------------------------------+
| name                                                               | delimiter | attributes                                |
+--------------------------------------------------------------------+-----------+-------------------------------------------+
| Junk                                                               | /         | ["\\subscribed","\\junk"]                 |
| <redacted> 2020                                                    | /         | ["\\subscribed","\\unmarked"]             |
| Drafts                                                             | /         | ["\\subscribed","\\drafts"]               |
| Trash                                                              | /         | ["\\subscribed","\\trash"]                |
| <redacted> 2019                                                    | /         | ["\\subscribed","\\unmarked"]             |
| <redacted> 2018                                                    | /         | ["\\subscribed","\\unmarked"]             |
| Trips                                                              | /         | ["\\subscribed","\\unmarked"]             |
| INBOX/<redacted>                                                   | /         | ["\\subscribed"]                          |
| <redacted> 2021                                                    | /         | ["\\subscribed","\\unmarked"]             |
| Sent                                                               | /         | ["\\subscribed","\\sent"]                 |
| Archive                                                            | /         | ["\\subscribed","\\unmarked","\\archive"] |
| Archive/2020                                                       | /         | ["\\subscribed"]                          |
| Archive/2018                                                       | /         | ["\\subscribed","\\unmarked"]             |
| old_email_domain_com                                               | /         | ["\\subscribed","\\unmarked"]             |
| old_email_domain_com/Junk                                          | /         | ["\\subscribed","\\unmarked"]             |
| old_email_domain_com/Drafts                                        | /         | ["\\subscribed","\\unmarked"]             |
| old_email_domain_com/<redacted> 2016                               | /         | ["\\subscribed","\\unmarked"]             |
| old_email_domain_com/INBOX                                         | /         | ["\\subscribed","\\unmarked"]             |
| old_email_domain_com/Sent                                          | /         | ["\\subscribed","\\unmarked"]             |
| old_email_domain_com/<redacted> 2017                               | /         | ["\\subscribed","\\unmarked"]             |
| old_email_domain_com/<redacted> 2017/<redacted>                    | /         | ["\\subscribed","\\unmarked"]             |
| old_email_domain_com/Archives                                      | /         | ["\\subscribed","\\unmarked"]             |
| old_email_domain_com/Archives/2011                                 | /         | ["\\subscribed","\\unmarked"]             |
| old_email_domain_com/Archives/2015                                 | /         | ["\\subscribed","\\unmarked"]             |
| old_email_domain_com/Archives/2013                                 | /         | ["\\subscribed","\\unmarked"]             |
| old_email_domain_com/Archives/2009                                 | /         | ["\\subscribed","\\unmarked"]             |
| old_email_domain_com/Trash                                         | /         | ["\\subscribed","\\unmarked"]             |
| old_email_domain_com/Trash/Archive                                 | /         | ["\\subscribed","\\unmarked"]             |
| old_email_domain_com/Trash/<redacted>                              | /         | ["\\subscribed","\\unmarked"]             |
| another_old_email_com                                              | /         | ["\\subscribed","\\unmarked"]             |
| another_old_email_com/INBOX                                        | /         | ["\\subscribed","\\unmarked"]             |
| another_old_email_com/Junk                                         | /         | ["\\subscribed","\\unmarked"]             |
| another_old_email_com/Sent                                         | /         | ["\\subscribed","\\unmarked"]             |
| another_old_email_com/LCA TALK                                     | /         | ["\\subscribed","\\unmarked"]             |
| another_old_email_com/Drafts                                       | /         | ["\\subscribed","\\unmarked"]             |
| another_old_email_com/Archives                                     | /         | ["\\subscribed","\\unmarked"]             |
| another_old_email_com/Archives/2012                                | /         | ["\\subscribed","\\unmarked"]             |
| another_old_email_com/Archives/2015                                | /         | ["\\subscribed","\\unmarked"]             |
| another_old_email_com/Archives/2004                                | /         | ["\\subscribed","\\unmarked"]             |
| another_old_email_com/Archives/2018                                | /         | ["\\subscribed","\\unmarked"]             |
| another_old_email_com/Archives/2003                                | /         | ["\\subscribed","\\unmarked"]             |
| another_old_email_com/<redacted>                                   | /         | ["\\subscribed","\\unmarked"]             |
| another_old_email_com/<redacted>                                   | /         | ["\\subscribed","\\unmarked"]             |
| another_old_email_com/Archive                                      | /         | ["\\subscribed","\\unmarked"]             |
| another_old_email_com/Archive/<redacted>                           | /         | ["\\subscribed","\\unmarked"]             |
| another_old_email_com/Archive/<redacted>                           | /         | ["\\subscribed","\\unmarked"]             |
| another_old_email_com/Archive/<redacted>/Received                  | /         | ["\\subscribed","\\unmarked"]             |
| another_old_email_com/Archive/<redacted>/<redacted>                | /         | ["\\subscribed","\\unmarked"]             |
| another_old_email_com/Archive/<redacted>/Sent                      | /         | ["\\subscribed","\\unmarked"]             |
| another_old_email_com/Archive/<redacted>                           | /         | ["\\subscribed","\\unmarked"]             |
| another_old_email_com/Archive/<redacted>/<redacted>                | /         | ["\\subscribed","\\unmarked"]             |
| another_old_email_com/Archive/<redacted>/<redacted>                | /         | ["\\subscribed","\\unmarked"]             |
| another_old_email_com/Archive/<redacted>/<redacted>                | /         | ["\\subscribed","\\unmarked"]             |
| another_old_email_com/Archive/<redacted>                           | /         | ["\\subscribed"]                          |
| another_old_email_com/Archive/<redacted>/Sent                      | /         | ["\\subscribed","\\unmarked"]             |
| another_old_email_com/Archive/<redacted>/<redacted>                | /         | ["\\subscribed","\\unmarked"]             |
| another_old_email_com/Archive/<redacted>/Received                  | /         | ["\\subscribed"]                          |
| another_old_email_com/Trash                                        | /         | ["\\subscribed","\\unmarked"]             |
| another_old_email_com/Trash/testing                                | /         | ["\\subscribed","\\unmarked"]             |
| INBOX                                                              | /         | ["\\subscribed"]                          |
+--------------------------------------------------------------------+-----------+-------------------------------------------+

@no-response no-response bot removed the needs info label Nov 9, 2020
@ChristophWurst
Copy link
Member

What's the drafts_mailbox_id, sent_mailbox_id and trash_mailbox_id of your account set to? Check oc_mail_accounts. And then also redo the previous query but include the id so we can match the two data sets. Thanks.

@jhesketh
Copy link
Author

Sorry for the slow reply.

+-------------------+-----------------+------------------+
| drafts_mailbox_id | sent_mailbox_id | trash_mailbox_id |
+-------------------+-----------------+------------------+
|               374 |             381 |              375 |
+-------------------+-----------------+------------------+

MariaDB [nextcloud]> select `id`, `name`, `delimiter`, `attributes` from oc_mail_mailboxes WHERE id IN (374, 381, 375);
+-----+--------+-----------+-----------------------------+
| id  | name   | delimiter | attributes                  |
+-----+--------+-----------+-----------------------------+
| 374 | Drafts | /         | ["\\subscribed","\\drafts"] |
| 375 | Trash  | /         | ["\\subscribed","\\trash"]  |
| 381 | Sent   | /         | ["\\subscribed","\\sent"]   |
+-----+--------+-----------+-----------------------------+

But I think what is more interesting in the oc_mail_mailboxes is the special_use column.

Here is a subset of those:

+--------------------------------------------------------------------+-----------+-------------------------------------------+-------------+
| name                                                               | delimiter | attributes                                | special_use |
+--------------------------------------------------------------------+-----------+-------------------------------------------+-------------+
| redact                                                            | /         | []                                        | []          |
| Junk                                                               | /         | ["\\unmarked","\\junk"]                   | ["junk"]    |
| Drafts                                                             | /         | ["\\unmarked","\\drafts"]                 | ["drafts"]  |
| Trash                                                              | /         | ["\\trash"]                               | ["trash"]   |
| Trash/redact                                                       | /         | ["\\unmarked"]                            | []          |
| Sent                                                               | /         | ["\\unmarked","\\sent"]                   | ["sent"]    |
| Archive                                                            | /         | ["\\unmarked","\\archive"]                | ["archive"] |
| Archive/2020                                                       | /         | ["\\unmarked"]                            | []          |
| Archive/2019                                                       | /         | ["\\unmarked"]                            | []          |
| Archive/2018                                                       | /         | ["\\unmarked"]                            | []          |
| Archive/2017                                                       | /         | ["\\unmarked"]                            | []          |
| an_old_addr                                                        | /         | ["\\unmarked"]                            | []          |
| an_old_addr/SORTED                                                 | /         | ["\\unmarked"]                            | []          |
| an_old_addr/Junk                                                   | /         | ["\\unmarked"]                            | ["junk"]    |
| an_old_addr/Drafts                                                 | /         | ["\\unmarked"]                            | ["drafts"]  |
| an_old_addr/INBOX                                                  | /         | ["\\unmarked"]                            | ["inbox"]   |
| an_old_addr/Sent                                                   | /         | ["\\unmarked"]                            | ["sent"]    |
| an_old_addr/Archives                                               | /         | ["\\unmarked"]                            | ["archive"] |
| an_old_addr/Archives/2011                                          | /         | ["\\unmarked"]                            | []          |
| an_old_addr/Archives/2015                                          | /         | ["\\unmarked"]                            | []          |
| an_old_addr/Archives/2013                                          | /         | ["\\unmarked"]                            | []          |
| an_old_addr/Archives/2018                                          | /         | ["\\unmarked"]                            | []          |
| an_old_addr/Archives/2010                                          | /         | ["\\unmarked"]                            | []          |
| an_old_addr/Archives/2014                                          | /         | ["\\unmarked"]                            | []          |
| an_old_addr/Archives/2007                                          | /         | ["\\unmarked"]                            | []          |
| an_old_addr/Trash                                                  | /         | ["\\unmarked"]                            | ["trash"]   |
| an_old_addr/Trash/Archive                                          | /         | ["\\unmarked"]                            | []          |
| an_old_addr/Trash/redact                                           | /         | ["\\unmarked"]                            | []          |
| another_old                                                        | /         | ["\\unmarked"]                            | []          |
| another_old/INBOX                                                  | /         | ["\\unmarked"]                            | ["inbox"]   |
| another_old/Junk                                                   | /         | ["\\unmarked"]                            | ["junk"]    |
| another_old/Sent                                                   | /         | ["\\unmarked"]                            | ["sent"]    |
| another_old/Drafts                                                 | /         | ["\\unmarked"]                            | ["drafts"]  |
| another_old/Archives                                               | /         | ["\\unmarked"]                            | ["archive"] |
| another_old/Archives/2012                                          | /         | ["\\unmarked"]                            | []          |
| another_old/Archives/2015                                          | /         | ["\\unmarked"]                            | []          |
| another_old/Archives/2010                                          | /         | ["\\unmarked"]                            | []          |
| another_old/Archives/2008                                          | /         | ["\\unmarked"]                            | []          |

Hope that helps!

@no-response no-response bot removed the needs info label Nov 24, 2020
@ChristophWurst
Copy link
Member

oc_mail_mailboxes is the special_use column

fyi those have little meaning these days ever since we added an account setting for special mailboxes

@stale
Copy link

stale bot commented Jan 9, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jan 9, 2022
@jhesketh
Copy link
Author

Bumping this issue as I'm still experiencing it trying the latest release.

@stale stale bot removed the stale label Jan 10, 2022
@ChristophWurst ChristophWurst changed the title Guessing folder function should not apply to sub-folders Guessing mailbox special use should not apply to sub-folders Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants