mike-kfed / roundcube-thunderbird_labels

Thunderbird Labels Plugin for Roundcube Webmail
Other
51 stars 27 forks source link

Can't remove label for some mails #42

Closed sabl0r closed 5 years ago

sabl0r commented 5 years ago

I can't remove labels for some mails anymore. It is still working in Thunderbird. When I click on one of these mails, I see the following in the dev console.

Array [ -1 ] LABEL4 true

When I press "4" to remove the label, I see and the blue color disappears:

Array [ 175962 ] LABEL4 false

Aftwards I click on a different email and then back to the one mentioned above:

Array [ -1 ] LABEL4 true

So nothing changed for that email.

Roundcube Webmail 1.3.8 [GIT 20181023.1309] thunderbird_labels v1.3.0

Note: for some reason I can't pull in v1.3.1 via composer although ^1.3 is specified in composer.json

mike-kfed commented 5 years ago

then install v1.3.1 manually please. using the shortcuts works for me (with 1.3.1). No idea how to reproduce your problem, are there any errors on the network log?

sabl0r commented 5 years ago

So I did some investigation.

Turned out, that Thunderbird stores the keyword $label4 but this plugin stores the keyword LABEL4 (without the dollar sign and uppercase).

According to the Dovecot documentation[1] keywords are stored in the mail filename on the server using the mapping file dovecot-keywords.

The file looks like this after the label was set in roundcube. Note the "b" at the end.

$ ls -la
-rw-r--r-- 1 sabl0r sabl0r 4894 20. Dez 16:54 '1545321275.M40045P9749.mango,S=4894,W=4998:2,Sb'

Mapping file is:

$ cat ../dovecot-keywords
0 $label4
1 LABEL4

Index 0 (a) was added by thunderbird after I set the label for a test. Index 1 (b) was added by roundcube after I set the label.

I'm not sure, if this issue is caused by Dovecot, Thunderbird or this plugin.

Any idea?

Dovecot version: 2.3.3 / 2.3.4 Thunderbird: 60.3.3 Roundcube Webmail 1.3.8 [GIT 20181023.1309] thunderbird_labels v1.3.0

[1] https://wiki2.dovecot.org/MailboxFormat/Maildir#IMAP_keywords

mike-kfed commented 5 years ago

Roundcube replaces the dollar sign for labels (I guess some pseudo security for PHP where variables start with dollar). that could be the reason for this behaviour, I'll look into this.

mike-kfed commented 5 years ago

Indeed seems to be the problem - commit bb60f45cca6f424920c9d260b5b8b84cc273a4b7

@sabl0r please check current master (or branch rc1.4beta) if that works for you now.

sabl0r commented 5 years ago

I applied the commit manually at my setup and it works like a charm. Thanks a lot for the fast response!