<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/xhtml; charset=utf-8">
</head>
<body>
<div style="font-family:sans-serif"><div style="white-space:normal">
<p dir="auto">On 25 May 2018, at 11:27, Bill Cole wrote:</p>

<blockquote style="border-left:2px solid #777; color:#777; margin:0 0 5px; padding-left:5px">
<p dir="auto">On 25 May 2018, at 12:55, Randall Gellens wrote:</p>

<blockquote style="border-left:2px solid #777; color:#999; margin:0 0 5px; padding-left:5px; border-left-color:#999">
<blockquote style="border-left:2px solid #777; color:#BBB; margin:0 0 5px; padding-left:5px; border-left-color:#BBB">
<p dir="auto">You can use the GUI. Right-click the IMAP account -> "Edit IMAP Account..." -> "Edit Subscriptions..." and uncheck the phantom mailbox.</p>
</blockquote>

<p dir="auto">I don't see "Edit Subscriptions" under "Edit IMAP Account".  There's a pane to fill in the server info, account info, etc.</p>
</blockquote>

<p dir="auto">Yes, and a button in the IMAP section.</p>

<p dir="auto">See attached image...</p>
</blockquote>

<p dir="auto">Ah, I hadn't noticed that, thanks.</p>

<p dir="auto">Interestingly, on any account, clicking it results in an error dialog box:</p>

<pre style="background-color:#F7F7F7; border-radius:5px 5px 5px 5px; margin-left:15px; margin-right:15px; max-width:90vw; overflow-x:auto; padding:5px" bgcolor="#F7F7F7"><code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0" bgcolor="#F7F7F7">Mailbox Retrieval Failed

Error: “Reading ended without error.”
</code></pre>

<blockquote style="border-left:2px solid #777; color:#777; margin:0 0 5px; padding-left:5px">
<blockquote style="border-left:2px solid #777; color:#999; margin:0 0 5px; padding-left:5px; border-left-color:#999">
<blockquote style="border-left:2px solid #777; color:#BBB; margin:0 0 5px; padding-left:5px; border-left-color:#BBB">
<p dir="auto">The root causes of this are that most IMAP servers don't sanity-check the "subscriptions" list against the actual list of mailboxes and that all MUAs for an account share a common subscription list, so they tend to avoid exerting automatic arbitrary control over it.</p>
</blockquote>

<p dir="auto">I guessed that perhaps MM doesn't refresh the mailbox list after deleting a mailbox.</p>
</blockquote>

<p dir="auto">Yes, after a fashion.</p>

<p dir="auto">The issue is that there isn't One True Mailbox List, and MM does not propagate the changes that it makes to the list of all available mailboxes (by deleting a mailbox on the server) to the list of mailboxes that are "subscribed" and as a consequence get synchronized by MM and displayed to the user.</p>
</blockquote>

<p dir="auto">Admittedly it's been many years since I was active in IMAP protocol development and server-side work, but to my knowledge, the IMAP protocol is designed so the client asks the server for a list of mailboxes (typically using wildcards to get all).  This represents the list of mailboxes that exist (with flags to indicate if they are permitted to have children, etc.)  So, typically, a client periodically refreshes the list of all mailboxes by walking the mailbox tree and fetching all at each level, and does so after doing a delete or a move (which technically is a RENAME).</p>

<p dir="auto">If I recall correctly from the days when IMAP was being developed, subscriptions were an afterthought that was glued on to the protocol to support shared mailboxes.  The IMAP protocol specifically allows for mailboxes that no longer exist to be on a user's subscription list, so a client should never assume that a subscribed mailbox exists.</p>

<p dir="auto">I took a peek at RFC 3501 to refresh my memory, and it explains the reasoning behind non-existent subscribed mailboxes:</p>

<pre style="background-color:#F7F7F7; border-radius:5px 5px 5px 5px; margin-left:15px; margin-right:15px; max-width:90vw; overflow-x:auto; padding:5px" bgcolor="#F7F7F7"><code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0" bgcolor="#F7F7F7">  The server 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.
</code></pre>

<p dir="auto">--Randall </p>
</div>
</div>
</body>
</html>