Max Dittrich
2009-Aug-11 10:12 UTC
[Dovecot] dovecot 1.2.3: TB fails to unsubscribe folder after deletion
Hi, I'm running dovecot 1.2.3 with "imap_client_workarounds tb-extra-mailbox-sep" and noticed that after deleting a folder (moving to Trash and emptying it on exit) that folder in Trash still keeps subscribed. I think the reason for that behavior is that the call for mailbox_list_set_subscribed() in imap/cmd-subscribe.c (line 84) is fed with the original mailbox name and not the stripped version in verify_name. Assigning verify_name to mailbox in the workaround-conditional fixes this issue for me. I'm not very familiar with C programming but while tracing cmd_subscribe_full() I stumbled upon another thing. In mail_namespace_find_mask() (lib-storage/mail-namespace.c at line 413) mailbox is reassigned with a local string (not t_strduped). I think this might be a problem when mailbox is dereferenced after returning from that function?! .max
Max Dittrich
2009-Aug-11 10:27 UTC
[Dovecot] dovecot 1.2.3: TB fails to unsubscribe folder after deletion
Max Dittrich wrote:> I'm not very familiar with C programming but while tracingqed> cmd_subscribe_full() I stumbled upon another thing. In > mail_namespace_find_mask() (lib-storage/mail-namespace.c at line 413) > mailbox is reassigned with a local string (not t_strduped). I think this > might be a problem when mailbox is dereferenced after returning from > that function?!Looks like the string "INBOX" isn't allocated from the stack. ;) .max
Timo Sirainen
2009-Aug-14 00:47 UTC
[Dovecot] dovecot 1.2.3: TB fails to unsubscribe folder after deletion
On Tue, 2009-08-11 at 12:12 +0200, Max Dittrich wrote:> Hi, > > I'm running dovecot 1.2.3 with "imap_client_workarounds > tb-extra-mailbox-sep" and noticed that after deleting a folder (moving > to Trash and emptying it on exit) that folder in Trash still keeps > subscribed. > I think the reason for that behavior is that the call for > mailbox_list_set_subscribed() in imap/cmd-subscribe.c (line 84) is fed > with the original mailbox name and not the stripped version in > verify_name. Assigning verify_name to mailbox in the > workaround-conditional fixes this issue for me.Well, I guess it was kind of intentional and this isn't necessarily always a problem. TB subscribes mailbox as "box/" and unsubscribes it as "box/". Dovecot internally also stores it as "box/" so all of that should be ok. Except if some other client subscribes to it, or perhaps TB doesn't always subscribe to it as "box/". Anyway.. http://hg.dovecot.org/dovecot-1.2/rev/339be408f49a should help. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20090813/964bc760/attachment-0002.bin>
Bruno Tréguier
2011-Mar-07 15:07 UTC
[Dovecot] dovecot 1.2.3: TB fails to unsubscribe folder after deletion
Timo Sirainen wrote:> On Tue, 2009-08-11 at 12:12 +0200, Max Dittrich wrote: >> Hi, >> >> I'm running dovecot 1.2.3 with "imap_client_workarounds >> tb-extra-mailbox-sep" and noticed that after deleting a folder (moving >> to Trash and emptying it on exit) that folder in Trash still keeps >> subscribed. >> I think the reason for that behavior is that the call for >> mailbox_list_set_subscribed() in imap/cmd-subscribe.c (line 84) is fed >> with the original mailbox name and not the stripped version in >> verify_name. Assigning verify_name to mailbox in the >> workaround-conditional fixes this issue for me. > > Well, I guess it was kind of intentional and this isn't necessarily > always a problem. TB subscribes mailbox as "box/" and unsubscribes it as > "box/". Dovecot internally also stores it as "box/" so all of that > should be ok. Except if some other client subscribes to it, or perhaps > TB doesn't always subscribe to it as "box/". > > Anyway.. http://hg.dovecot.org/dovecot-1.2/rev/339be408f49a should help.Hi Timo, Sorry to "unbury" such an old patch, but it seems to be related to a bug I'm seeing right now, that I described in a mail sent on Thursday. In short, TB *and* OE, when talking to a Dovecot server using an mbox backend, complain with messages stating that "the mailbox isn't selectable", for "folders of folders" mailbox types. You say that Dovecot internally stores folders of folders as "box/" (just as it is subscribed/unsubsribed to by TB). However, the patch you mention above changes this behaviour and Dovecot now stores folders of folders as "box" with no trailing slash. This seems to break things on the Dovecot side, for mbox backend users, as there is no way left to distinguish between both kinds of folders. As a consequence, there is an inconsistency between the way the folder is created (as a directory on the filesystem) and the way it is advertised in the .subscription file (without the trailing "/"). Is this really meant ? The behaviour was different before that patch, and notably in the 1.1 branch, that I still use on another server: the subscribed mailboxes bear a trailing slash in the .subscriptions file. Best regards, Bruno -- - Service Hydrographique et Oceanographique de la Marine - DO/MGS/INF - 13, rue du Chatellier - CS 92803 - 29228 Brest Cedex 2, FRANCE - Phone: +33 2 98 22 17 49 - Email: Bruno.Treguier at shom.fr