random-cuber / contextmenu_folder

Roundcube Context Menu Folder Plugin
https://packagist.org/packages/random-cuber/contextmenu_folder
Apache License 2.0
9 stars 7 forks source link

UTF7 foldernames Support #8

Closed nixprosoft closed 1 year ago

nixprosoft commented 7 years ago

When folderlist contauns UTF-7 coded foldersnames, then search list contains unreadable folders list. So I try to convert it with array_map. But when I try to move message to folder woth that name - got error "UID MOVE: Mailbox name is not valid mUTF-7".

2017-09-15_16-52-58

 // produce flat, sorted, unfiltered, mailbox list
    public function action_folder_list() {
        $output = $this->rc->output;
        $storage = $this->rc->storage;
        $realnames = $this->rc->config->get('show_real_foldernames');
        $p = array('maxlength' => 100, 'realnames' => $realnames, 'is_escaped' => true);

        $folder_list = $storage->list_folders();
        $folder_list = array_map('self::utf7convert', $folder_list);
        $output->command($this->key('folder_list'), array('folder_list' => $folder_list));
        $output->send();
    }

    static function utf7convert($mbox) {
        return rcube_charset::convert($mbox, 'UTF7-IMAP');
    }

So, the question is to use rcmail localize_foldername instead of current folder_list for displaying special folders, and fix the other script of the plugin to correctly move messages. And to use Rcube method to build select tree of folders.

Andrei-Pozolotin commented 7 years ago

please send a PR tested with roundcube >= 1.3.1

Andrei-Pozolotin commented 1 year ago

obsolete