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

Nonexistant subscribed folders are listed in mail view, but can't be unsubscribed from #2474

Closed
rcubetrac opened this issue Oct 16, 2009 · 36 comments

Comments

@rcubetrac
Copy link

commented Oct 16, 2009

Reported by brandond on 16 Oct 2009 03:31 UTC as Trac ticket #1486225

Our old webmail system had a bug in its folder renaming code that would leave a subscription entry for the old folder name, in addition to adding a subscription for the new folder. Dovecot does not validate that the subscription list contains only valid entries, and returns these nonexistent folders to the client.

Roundcube's handling of this is somewhat odd, in that it shows the nonexistant folder (as empty) in the mail interface, but not in the folder subscription list. This leaves you with a 'ghost' folder that you can't unsubscribe from, short of going to another client and doing it there.

Roundcube should either hide the folder in the Mail view, or display it in the folder list (perhaps with some indication that it doesn't exist) so it can be unsubscribed from.

Migrated-From: http://trac.roundcube.net/ticket/1486225

@rcubetrac

This comment has been minimized.

Copy link
Author

commented Dec 8, 2009

Comment by @alecpl on 8 Dec 2009 20:37 UTC

#1485988 marked as duplicate.

@rcubetrac

This comment has been minimized.

Copy link
Author

commented Feb 24, 2010

Comment by serpico7456 on 24 Feb 2010 21:08 UTC

The problem of leaving subscriptions for non-existent folders is also caused by other mail clients, as well as if the folder is manually deleted on the mail server. While I agree Dovecot should validate subscription lists, this doesn't change the fact the Roundcube's handling of this is inconsistent. As brandond mentions, RC should either hide the folder in the mailbox view (as is already does in the subscription view) OR show it in the subscription view (as it already does in the mailbox view)--It should not show it in some contexts and not in others.

Our temporary work around has been to disable IMAP folder subscriptions via the bundled 'subscriptions_option' plugin. This way non-existent folders will not appear in the mailbox view.

See the attached screen shots which demonstrate the problem.

@rcubetrac

This comment has been minimized.

Copy link
Author

commented Feb 25, 2010

Comment by @alecpl on 25 Feb 2010 07:22 UTC

Actually IMAP RFC doesn't require to validate subscription list on server-side, so maybe we should do this in Roundcube. We need to call LSUB for subscriptions list and LIST for existance check. Currently we aren't do this for performance reasons.

@rcubetrac

This comment has been minimized.

Copy link
Author

commented Feb 25, 2010

Owner changed by @alecpl on 25 Feb 2010 07:22 UTC

=> none

@rcubetrac

This comment has been minimized.

Copy link
Author

commented Feb 25, 2010

Milestone changed by @alecpl on 25 Feb 2010 07:22 UTC

later => 0.4-beta

@rcubetrac

This comment has been minimized.

Copy link
Author

commented Apr 2, 2010

Comment by @alecpl on 2 Apr 2010 12:27 UTC

...or we could use LIST (SUBSCRIBED) instead of LSUB on servers with LIST-EXTENDED (RFC5258) support.

@rcubetrac

This comment has been minimized.

Copy link
Author

commented Aug 5, 2010

Comment by @alecpl on 5 Aug 2010 17:59 UTC

With following patch "ghost" folders are removed when user enters Folders tab. I'm not sure if this is proper fix for this issue.

--- manage_folders.inc  (wersja 3870)
+++ manage_folders.inc  (kopia robocza)
@@ -255,6 +255,12 @@
     $RCMAIL->user->save_prefs(array('message_threading' => $a_threaded));
   }

+  $a_ghosts = array_diff($a_subscribed, $a_unsubscribed);
+  unset($a_unsubscribed);
+  // Remove subscribed but non-existing folders (#1486225)
+  foreach ($a_ghosts as $ghost)
+    $IMAP->unsubscribe($ghost);
+
   $checkbox_subscribe = new html_checkbox(array(
     'name' => '_subscribed[]',
     'onclick' => JS_OBJECT_NAME.".command(this.checked?'subscribe':'unsubscribe',this.value)",
@rcubetrac

This comment has been minimized.

Copy link
Author

commented Aug 23, 2010

Comment by brandond on 23 Aug 2010 07:43 UTC

Patch looks good to me. Honestly I'd be happy to see Roundcube go as far as sending an unsubscribe if they don't exist.. but just hiding them is good too, and probably safer. Any chance we could see this committed?

@rcubetrac

This comment has been minimized.

Copy link
Author

commented Aug 23, 2010

Comment by brandond on 23 Aug 2010 07:48 UTC

Actually I'm an idiot, that's exactly what it does ;) Sorry for the noise. I'd still be happy to see it committed, unless you'd prefer to take the LIST (SUBSCRIBED) approach as a safer alternative.

@rcubetrac

This comment has been minimized.

Copy link
Author

commented Aug 23, 2010

Comment by @alecpl on 23 Aug 2010 07:49 UTC

IMAP RFC says:

      A server MAY validate the mailbox argument to SUBSCRIBE to verify
      that it exists.  However, it MUST NOT unilaterally remove an
      existing mailbox name from the subscription list even if a mailbox
      by that name no longer exists.

           Note: This requirement is because a server site can
           choose to routinely remove a mailbox with a well-known
           name (e.g., "system-alerts") after its contents expire,
           with the intention of recreating it when new contents
           are appropriate.

So, now I think we shouldn't unsubscribe non-existing folders, but we should display them in Settings/Folders with option to unsubscribe.

@rcubetrac

This comment has been minimized.

Copy link
Author

commented Aug 23, 2010

Comment by brandond on 23 Aug 2010 07:54 UTC

That'd be good too. Think you'd be able to put together a patch for that anytime soon? I was just about to apply the unsubscribe patch to my installation, but I'd be glad to do the 'right thing' instead if a patch was available.

@rcubetrac

This comment has been minimized.

Copy link
Author

commented Oct 26, 2010

Comment by @alecpl on 26 Oct 2010 13:45 UTC

Fixed in 3870bec, so non-existent folders are not listed.

@rcubetrac

This comment has been minimized.

Copy link
Author

commented Oct 26, 2010

Status changed by @alecpl on 26 Oct 2010 13:45 UTC

new => closed

@rcubetrac

This comment has been minimized.

Copy link
Author

commented Oct 27, 2010

Comment by dziobak on 27 Oct 2010 05:53 UTC

Hi Alec, after this change I can't see my public and shared mailboxes and I can't subscribe them back.

@rcubetrac

This comment has been minimized.

Copy link
Author

commented Oct 27, 2010

Comment by dziobak on 27 Oct 2010 06:52 UTC

look post before.

@rcubetrac

This comment has been minimized.

Copy link
Author

commented Oct 27, 2010

Status changed by dziobak on 27 Oct 2010 06:52 UTC

closed => reopened

@rcubetrac

This comment has been minimized.

Copy link
Author

commented Oct 27, 2010

Comment by @alecpl on 27 Oct 2010 06:58 UTC

Show imap_debug. I feel they are marked as \Noselect.

@rcubetrac

This comment has been minimized.

Copy link
Author

commented Oct 27, 2010

Comment by dziobak on 27 Oct 2010 07:45 UTC

unfortunetly:[09:43:07 +0200]([BR]]

[27-Oct-2010): S: * LIST (\Subscribed \NonExistent) "/" "Public/AddressBook"
[09:43:07 +0200](27-Oct-2010): S: * LIST (\Subscribed \NonExistent) "/" "Public/PublicMails"
[09:43:07 +0200](27-Oct-2010): S: * LIST (\Subscribed \NonExistent) "/" "Public/"
@rcubetrac

This comment has been minimized.

Copy link
Author

commented Oct 27, 2010

Comment by @alecpl on 27 Oct 2010 07:46 UTC

If they're not exists, why you care of them?

@rcubetrac

This comment has been minimized.

Copy link
Author

commented Oct 27, 2010

Comment by brandond on 27 Oct 2010 07:53 UTC

If you're using Dovecot, this could be an issue with how you are storing subscriptions for your public namespace. See:

http://www.dovecot.org/list/dovecot/2010-October/054310.html

Basically, LSUB or LIST (SUBSCRIBED) will return odd results if you're storing subscription entries for one namespace in another namespaces' subscription file.

If course it could be something else entirely, but this is something I ran into recently.

@rcubetrac

This comment has been minimized.

Copy link
Author

commented Oct 27, 2010

Comment by dziobak on 27 Oct 2010 07:55 UTC

because the public mailboxes are working well. this is a special configuration ;-)[same is with shared mailboxes:[[BR]([BR]]
the)]

[09:51:59 +0200](27-Oct-2010): S: * LIST (\Subscribed \NonExistent) "/" "Shared/dziobak/root"
[09:51:59 +0200](27-Oct-2010): S: * LIST (\Subscribed \NonExistent) "/" "Shared/tester2/sdfgsg"
[09:51:59 +0200](27-Oct-2010): S: * LIST (\Subscribed \NonExistent) "/" "Shared/tester2/sdfgsg/gsdfgf"
[09:51:59 +0200](27-Oct-2010): S: * LIST (\Subscribed \NonExistent) "/" "Shared/tester2/sdfgsg/gsdfgf/vtyjyfgj"
[09:51:59 +0200](27-Oct-2010): S: * LIST (\Subscribed \NonExistent) "/" "Shared/tester2/sdfgsg/gsdfgf/vtyjyfgj/rtdhrthxs"
[09:51:59 +0200](27-Oct-2010): S: * LIST (\Subscribed \NonExistent) "/" "Shared/tester2/sdfgsg/gsdfgf/vtyjyfgj/rtdhrthxs/zhfhg"
[09:51:59 +0200](27-Oct-2010): S: * LIST (\Subscribed \NonExistent) "/" "Shared/"

[[BR]]
and it is working well too.

@rcubetrac

This comment has been minimized.

Copy link
Author

commented Oct 27, 2010

Comment by @alecpl on 27 Oct 2010 08:09 UTC

So, are these folders exist? What returns LIST "" "*" command? Please, attach complete imap_debug log.

@rcubetrac

This comment has been minimized.

Copy link
Author

commented Oct 27, 2010

Comment by dziobak on 27 Oct 2010 08:18 UTC

I can't enter those folders from RC, because I don't see them now and I don't want to make revert. I can give you the telnet output.[list "" "*"

  • LIST (\HasNoChildren) "/" "Trash"
  • LIST (\HasNoChildren) "/" "Junk"
  • LIST (\HasNoChildren) "/" "Informacje"
  • LIST (\HasNoChildren) "/" "Sent"
  • LIST (\HasNoChildren) "/" "Drafts"
  • LIST (\HasNoChildren) "/" "Archives"
  • LIST (\HasNoChildren) "/" "Kalendarz"
  • LIST (\HasNoChildren) "/" "Wiadomo&AVs-ci-&AVs-mieci"
  • LIST (\HasNoChildren) "/" "INBOX"
  • LIST (\HasNoChildren) "/" "Public/AddressBook"
  • LIST (\HasNoChildren) "/" "Public/PublicMails"
  • LIST (\Noselect \HasChildren) "/" "Shared/dziobak"
  • LIST (\Noselect \HasChildren) "/" "Shared/tester2"
  • LIST (\HasNoChildren) "/" "Shared/dziobak/root"
  • LIST (\HasChildren) "/" "Shared/tester2/sdfgsg"
  • LIST (\HasChildren) "/" "Shared/tester2/sdfgsg/gsdfgf"
  • LIST (\HasChildren) "/" "Shared/tester2/sdfgsg/gsdfgf/vtyjyfgj"
  • LIST (\HasChildren) "/" "Shared/tester2/sdfgsg/gsdfgf/vtyjyfgj/rtdhrthxs"
  • LIST (\HasNoChildren) "/" "Shared/tester2/sdfgsg/gsdfgf/vtyjyfgj/rtdhrthxs/zhfhg"
    . OK List completed.
    . select Shared/dziobak/root
  • OK [CLOSED]([BR]]
.) Previous mailbox closed.
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft NonJunk Junk)
* OK [(\Answered \Flagged \Deleted \Seen \Draft NonJunk Junk)](PERMANENTFLAGS) Flags permitted.
* 716 EXISTS
* 0 RECENT
* OK [716](UNSEEN) First unseen.
* OK 1269599970(UIDVALIDITY) UIDs valid
* OK [4199](UIDNEXT) Predicted next UID
* OK [175](HIGHESTMODSEQ) Highest
. OK [READ-WRITE] Select completed.
@rcubetrac

This comment has been minimized.

Copy link
Author

commented Oct 27, 2010

Comment by @alecpl on 27 Oct 2010 08:23 UTC

So, they are existing. It looks like dovecot bug. Maybe you could confirm this on dovecot mailing list.

@rcubetrac

This comment has been minimized.

Copy link
Author

commented Oct 27, 2010

Comment by dziobak on 27 Oct 2010 08:27 UTC

I have version 1.2.14. so Timo won't correct this. I use only ports for FreeBSD without patches. You can make a config option for compatibility with this bug.

@rcubetrac

This comment has been minimized.

Copy link
Author

commented Oct 27, 2010

Comment by brandond on 27 Oct 2010 08:44 UTC

It might not be a bug - you may just have to change your Dovecot configuration to store subscriptions in the proper namespace. You should at least ask.

@rcubetrac

This comment has been minimized.

Copy link
Author

commented Oct 27, 2010

Comment by @alecpl on 27 Oct 2010 08:47 UTC

If this is a bug I'll provide force_lsub option, but I need confirmation from Timo.

@rcubetrac

This comment has been minimized.

Copy link
Author

commented Oct 28, 2010

Comment by dziobak on 28 Oct 2010 12:26 UTC

Here is Timo confirmation:[[BR]]
[http://www.dovecot.org/list/dovecot/2010-October/054372.html]

@rcubetrac

This comment has been minimized.

Copy link
Author

commented Nov 3, 2010

Comment by @alecpl on 3 Nov 2010 08:29 UTC

Added imap_force_lsub option in f75f65c.

@rcubetrac

This comment has been minimized.

Copy link
Author

commented Nov 3, 2010

Status changed by @alecpl on 3 Nov 2010 08:29 UTC

reopened => closed

@rcubetrac rcubetrac closed this Nov 3, 2010

@rcubetrac

This comment has been minimized.

Copy link
Author

commented Dec 17, 2010

Comment by jonesy16 on 17 Dec 2010 22:57 UTC

I can confirm that the same Dovecot issues exists when configuring shared namespaces in the shipping version of the IMAP server on OS X Server 10.6+. The imap_force_lsub option worked for me.

@rcubetrac

This comment has been minimized.

Copy link
Author

commented Dec 21, 2010

Comment by smithmb on 21 Dec 2010 03:07 UTC

Just to add, we saw this same issue at UF with various mail clients. The support work to undo it was a nightmare, and this patch helped a ton :)

@rcubetrac

This comment has been minimized.

Copy link
Author

commented Apr 26, 2011

Comment by frecon on 26 Apr 2011 06:41 UTC

I am still, in 0.5.2, not able to unsubscribe from non-existing subscribed folders. Is this supposed to be fixed with the imap_force_lsub option or was that solution of the problem disregarded? I'm running courier-imap.

@rcubetrac

This comment has been minimized.

Copy link
Author

commented Apr 26, 2011

Comment by @alecpl on 26 Apr 2011 07:19 UTC

Enable imap_debug and provide the log. What you mean you are not able? Any error or not possible to unselect a checkbox?

@rcubetrac

This comment has been minimized.

Copy link
Author

commented Apr 26, 2011

Comment by frecon on 26 Apr 2011 08:23 UTC

Replying to alec:

Enable imap_debug and provide the log. What you mean you are not able? Any error or not possible to unselect a checkbox?

As described in the initial ticket description, the non-existing subscribed folders are displayed in the E-Mail - Folders list but not in the Settings - Folders list. I can not open the folders and I cannot unsubscribe to them using roundcube.

The IMAP log (imap), the E-Mail Folders list (e-mail-folders-list.jpg) and the Settings Folders list (settings-folders-list.jpg) are attached.

@rcubetrac

This comment has been minimized.

Copy link
Author

commented Nov 7, 2011

Comment by mtu on 7 Nov 2011 21:41 UTC

I can confirm this fixed the problem for me. My IMAP daemon is dovecot 1.1.3. Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.