Special folders are stored for the main account and not stored in DB for each identity (and are always NULL)
I installed the plugin version 4.2 of ident_switch and created an identity connected to an external IMAP account.
Special folders in that account use a different language and need to have the special folders to be reassigned.
I can see that in the database of indent_switch it is possible and as per this PR that information should be stored in the database.
But that doens’t seem to be the case. When I update the special folders, they update for every account (Globally) and I can see that drafts_mbox and all other are still all NULL in the database. Switching back to another identity has the wrong special folders assigned then to all other accounts.
Is there anything special that has to be enabled to make this work? Or is the only way to update this to set it manually in the DB each time?
Comments (7)
-
repo owner -
I haven’t looked into the database yet, but I can confirm that this is a problem from the following behaviour:
On my main account, that doesn’t have any Archive folder by default, I created an folder called
Archive
myself. As this is my account setting the folder works without any problems.On my gmail account, there is a predefined archive folder (all messages) called
[Gmail]/Všechny zprávy
. I’ve set this forlder to be used as a archive BUT when I click theArchive
button, the email just disappears. After reloading the page a new folder (calledArchive
- the same name as the main account) appears and the email is in it, not in the proper ([Gmail]/Všechny zprávy
) folder.
I can confirm this on other accounts such as my Microsoft account (folder
Archivovat
) and my work email (folderArchiv
).
@Boris Gulay From a quick look over the pr I can see that there is not a column for the
Archive
folder. Sadly I don’t really understand php and js, so I am unable to add it myself, but as other folders are implemented, it doesn’t appear to me that is should be hard. Would you be able to patch it, please? Other folders seem to work fine only theArchive
folder is broken.
-
@Boris Gulay I’ve just added a
archive_mbox
columnt to the database and all the functions. It appears in the settings and saving and loading them works. Now there’s only left to figure out how to change the archive folder for the button and folder view -
@Boris Gulay Ok, so from what I figured out so far I need to somehow add the folder to special forlders in `on_switch()` function. So far I figured out that there’s not an
archive
type in$folder_types
. I’ve tried to manually add it to the array directly into roundcube on my server, but that did not help. I’m trying to figure out how does the special folderArchive
work. -
@Boris Gulay Ok. I’m an idiot. It’s a stupid plugin. How do I approach this now?
-
@Boris Gulay So from briefly looking at the
archive
plugin I’ve found this line:$this->archive_folder = $rcmail->config->get('archive_mbox');
I think that this is the one that is causing my problems. Now I need to somehow spoof the output of this function to get the proper result from your extension
-
So I probably just need to set
archive::$archive_folder
variable to the correct folder name. I however don’t know how to get the folder name in your extension to set the folder name. - Log in to comment
Can you show what is stored in ident_switch table for main and external accounts?
Please wipe out all login/password data!