1

For many years I've been running a dovecot imap server on localhost, to store my mail archive and access it with any client (mainly Mail.app and Thunderbird) and not depend on those app's storage format when they upgrade. Since upgrading to Big Sur (macOS 11.6.5, Mail.app 14.0) things work in Thunderbird but no longer in Mail.app, which displays all folders (except those at the top of the hierarchy) as empty.

Here is my dovecot configuration:

FZs-MacBook-Pro:~ fz$ doveconf -n
# 2.0.16: /Volumes/Home/FZ/.local/etc/dovecot/dovecot.conf
# OS: Darwin 20.6.0 x86_64  hfs
default_internal_user = fz
default_login_user = fz
log_path = /Volumes/Home/FZ/.local/var/log/dovecot.log
mail_location = maildir:/Volumes/Home/FZ/Mail:LAYOUT=fs
passdb {
  args = username_format=%u /Volumes/Home/FZ/.local/etc/dovecot-users
  driver = passwd-file
}
service anvil {
  chroot = 
}
service imap-login {
  chroot = 
  inet_listener imap {
    port = 10143
  }
  inet_listener imaps {
    port = 10993
  }
}
service pop3-login {
  chroot = 
  inet_listener pop3 {
    port = 10110
  }
  inet_listener pop3s {
    port = 10995
  }
}
ssl = no
userdb {
  args = username_format=%u /Volumes/Home/FZ/.local/etc/dovecot-users
  driver = passwd-file
}

Here is a log of what happens when I click the folder "Topics/Computing/httpd" in Thunderbird:

FZs-MacBook-Pro:~ fz$ cat imap.log.moz_log | grep 13bbc0000
[Parent 2577: IMAP]: D/IMAP ImapThreadMainLoop entering [this=13bbc0000]
[Parent 2577: Main Thread]: I/IMAP 13bbc0000:localhost:NA:SetupWithUrlCallback: clearing IMAP_CONNECTION_IS_OPEN
[Parent 2577: IMAP]: I/IMAP 13bbc0000:localhost:NA:ProcessCurrentURL: entering
[Parent 2577: IMAP]: I/IMAP 13bbc0000:localhost:NA:ProcessCurrentURL:imap://fz@localhost:10143/select%3E/Topics/Computing/httpd:  = currentUrl
[Parent 2577: IMAP]: I/IMAP 13bbc0000:localhost:NA:CreateNewLineFromSocket: * OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE AUTH=PLAIN] Dovecot ready.
[Parent 2577: IMAP]: I/IMAP 13bbc0000:localhost:NA:SendData: 18 authenticate PLAIN
[Parent 2577: IMAP]: I/IMAP 13bbc0000:localhost:NA:CreateNewLineFromSocket: + 
[Parent 2577: IMAP]: I/IMAP 13bbc0000:localhost:NA:SendData: Logging suppressed for this command (it probably contained authentication information)
[Parent 2577: IMAP]: I/IMAP 13bbc0000:localhost:NA:CreateNewLineFromSocket: 18 OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS MULTIAPPEND UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS] Logged in
[Parent 2577: IMAP]: I/IMAP 13bbc0000:localhost:A:SendData: 19 namespace
[Parent 2577: IMAP]: I/IMAP 13bbc0000:localhost:A:CreateNewLineFromSocket: * NAMESPACE (("" "/")) NIL NIL
[Parent 2577: IMAP]: I/IMAP 13bbc0000:localhost:A:CreateNewLineFromSocket: 19 OK Namespace completed.
[Parent 2577: IMAP]: I/IMAP 13bbc0000:localhost:A:SendData: 20 ID ("name" "Thunderbird" "version" "91.9.0")
[Parent 2577: IMAP]: I/IMAP 13bbc0000:localhost:A:CreateNewLineFromSocket: * ID NIL
[Parent 2577: IMAP]: I/IMAP 13bbc0000:localhost:A:CreateNewLineFromSocket: 20 OK ID completed.
[Parent 2577: IMAP]: I/IMAP 13bbc0000:localhost:A:SendData: 21 ENABLE UTF8=ACCEPT
[Parent 2577: IMAP]: I/IMAP 13bbc0000:localhost:A:CreateNewLineFromSocket: 21 OK Enabled.
[Parent 2577: IMAP]: I/IMAP 13bbc0000:localhost:A:SendData: 22 select "Topics/Computing/httpd"
[Parent 2577: IMAP]: I/IMAP 13bbc0000:localhost:A:CreateNewLineFromSocket: * FLAGS (\Answered \Flagged \Deleted \Seen \Draft $MDNSent)
[Parent 2577: IMAP]: I/IMAP 13bbc0000:localhost:A:CreateNewLineFromSocket: * OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft $MDNSent \*)] Flags permitted.
[Parent 2577: IMAP]: I/IMAP 13bbc0000:localhost:A:CreateNewLineFromSocket: * 2 EXISTS
[Parent 2577: IMAP]: I/IMAP 13bbc0000:localhost:A:CreateNewLineFromSocket: * 0 RECENT
[Parent 2577: IMAP]: I/IMAP 13bbc0000:localhost:A:CreateNewLineFromSocket: * OK [UIDVALIDITY 1325085214] UIDs valid
[Parent 2577: IMAP]: I/IMAP 13bbc0000:localhost:A:CreateNewLineFromSocket: * OK [UIDNEXT 3] Predicted next UID
[Parent 2577: IMAP]: I/IMAP 13bbc0000:localhost:A:CreateNewLineFromSocket: * OK [HIGHESTMODSEQ 1] Highest
[Parent 2577: IMAP]: I/IMAP 13bbc0000:localhost:A:CreateNewLineFromSocket: 22 OK [READ-WRITE] Select completed.
[Parent 2577: IMAP]: I/IMAP 13bbc0000:localhost:S-Topics/Computing/httpd:SendData: 23 UID fetch 1:* (FLAGS)
[Parent 2577: IMAP]: I/IMAP 13bbc0000:localhost:S-Topics/Computing/httpd:CreateNewLineFromSocket: * 1 FETCH (UID 1 FLAGS (\Seen $MDNSent))
[Parent 2577: IMAP]: I/IMAP 13bbc0000:localhost:S-Topics/Computing/httpd:CreateNewLineFromSocket: * 2 FETCH (UID 2 FLAGS (\Seen $MDNSent))
[Parent 2577: IMAP]: I/IMAP 13bbc0000:localhost:S-Topics/Computing/httpd:CreateNewLineFromSocket: 23 OK Fetch completed.

And here is what appears in Connection Doctor > Show Detail when I try the same thing in Mail.app:

WROTE May 19 18:20:09.706 [kCFStreamSocketSecurityLevelNone] -- host:127.0.0.1 -- port:10143 -- socket:0x600007487420 -- thread:0x6000044c3300
40.372 SELECT Topics.Computing.httpd (CONDSTORE)

READ May 19 18:20:09.707 [kCFStreamSocketSecurityLevelNone] -- host:127.0.0.1 -- port:10143 -- socket:0x600007487420 -- thread:0x6000044c3300
40.372 NO Mailbox doesn't exist: Topics.Computing.httpd

It seems clear that the problem is that Mail.app asks for the subfolders assuming separator "." instead of "/".

Question: How can I get Mail.app and dovecot to communicate correctly?

1 Answer 1

1

I solved the problem by moving ~/Library/Mail out of the way. (This is Mail.app’s local store, not dovecot’s which is at ~/Mail.) On the next launch of Mail.app, it was rebuilt and all subfolders were miraculously populated in the interface, with Mail.app now assuming the correct separator:

WROTE May 21 03:54:35.783 [kCFStreamSocketSecurityLevelNone] -- host:127.0.0.1 -- port:10143 -- socket:0x6000009e5800 -- thread:0x60000346d1c0
352.5 SELECT Topics/Computing/httpd (CONDSTORE)

READ May 21 03:54:35.784 [kCFStreamSocketSecurityLevelNone] -- host:127.0.0.1 -- port:10143 -- socket:0x6000009e5800 -- thread:0x60000346d1c0
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft $MDNSent)
* OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft $MDNSent \*)] Flags permitted.
* 2 EXISTS
* 0 RECENT
* OK [UIDVALIDITY 1325085214] UIDs valid
* OK [UIDNEXT 3] Predicted next UID
* OK [HIGHESTMODSEQ 1] Highest
352.5 OK [READ-WRITE] Select completed.

WROTE May 21 03:54:35.786 [kCFStreamSocketSecurityLevelNone] -- host:127.0.0.1 -- port:10143 -- socket:0x6000009e5800 -- thread:0x60000346d1c0
353.5 UID FETCH 1:2 (FLAGS UID) (CHANGEDSINCE 1 VANISHED)

READ May 21 03:54:35.787 [kCFStreamSocketSecurityLevelNone] -- host:127.0.0.1 -- port:10143 -- socket:0x6000009e5800 -- thread:0x60000346d1c0
353.5 OK Fetch completed.

I have no idea why that worked, other than to observe that the separator was indeed cached in ~/Library/Mail:

FZs-MacBook-Pro:~ fz$ tail ~/Library/Mail/V8/6CD652AB-CCEF-45CC-9D6C-FB91888D36B4/.mboxCache.plist 
            <key>MailboxPathComponent</key>
            <string>Trash</string>
            <key>MailboxUnreadCount</key>
            <integer>0</integer>
        </dict>
    </dict>
    <key>separator</key>
    <string>/</string>
</dict>
</plist>
FZs-MacBook-Pro:~ fz$ tail ~/Library/Mail.outoftheway/V8/6CD652AB-CCEF-45CC-9D6C-FB91888D36B4/.mboxCache.plist 
            <key>MailboxPathComponent</key>
            <string>Trash</string>
            <key>MailboxUnreadCount</key>
            <integer>0</integer>
        </dict>
    </dict>
    <key>separator</key>
    <string>.</string>
</dict>
</plist>
FZs-MacBook-Pro:~ fz$ 

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .