Good evening all,
I’ve been experimenting with Mailcow for personal self-hosted email and so far everything seems good. However I appear to have created a problem where I’ve deleted a folder tree in the SOGo webmail and now I have subscriptions which still exist in SOGo but do not exist in the IMAP server behind the scenes.
I believe this may also be causing me issues with syncing to my iPhone, but I’m unsure whether this is the same problem or whether it’s a different problem which just started happening around the same time.
The symptoms I am seeing are:
- I created a folder tree with a small part of my mail archive to test
- this started in the “Archive” folder, and included a recursive tree (for example “Archive/Parent/Folder1/Folder2” and so on
- I then deleted “Parent” from SOGo Webmail, and emptied the Trash
- In SOGo, if I enable the
Show subscribed mailboxes only
in the mail preferences dialogue, I can still see this directory tree
Parent
(which I deleted) is greyed out, the other folders are shown in a solid colour
- These folders do not appear in a standalone mail client (i.e. Apple Mail) and do not show up if I use
openssl
to connect to my IMAPS port directly and issue IMAP commands by hand (i.e. 1 LIST "" "*"
)
This leads me to believe that SOGo has some kind of cache which is out of date and not reflecting the true state of the IMAP server, and in turn is failing to refresh these non-existent folders and causing the failing Activesync connection. Meanwhile, regular IMAP is bypassing SOGo and is reflecting the true set of folders that I have.
If anyone has seen this issue before, or has clues on how I can diagnose further then I would appreciate your response. I did find some SOGo bugs related to IMAP subscriptions on deleted folders, but the bugs I found claim to have already been fixed in earlier releases so shouldn’t be visible on the 5.12 version included with Mailcow 2025-03b
edit - iOS contact sync IS working, so the Activesync connection overall is fine, my server is configured, firewall is correct, etc. But I still have no iOS mail sync, the phone has started throwing a generic “The connection to the server failed” error message when I open Mail. I’ve also found these entries in the SOGo log file, which make no sense because the webmail works fine. Could this be an app password permission problem? Do I need to allow an app password used by Activesync to also have IMAP access because SOGo is going to try to use that password?
sogo-mailcow-1 | Apr 22 01:54:49 4b9c9535be9e sogod [66]: <0xaaab09ec3190[SOGoMailAccount]:0> renewing imap4 password
sogo-mailcow-1 | Apr 22 01:54:49 4b9c9535be9e sogod [66]: [ERROR] <0xaaab09ec3190[SOGoMailAccount]:0> no IMAP4 password available
sogo-mailcow-1 | Apr 22 01:54:49 4b9c9535be9e sogod [66]: [ERROR] <0xaaab09ec3190[SOGoMailAccount]:0> Could not connect IMAP4
edit 2 - yes, the Activesync app password appears to need IMAP permissions as well, maybe this is documented and I just missed that step or maybe it’s undocumented and unintuitive. But now I’ve allowed that extra permission, things seem to be working OK again on my iPhone.
The first problem still remained, although I’ve now cleaned up the list by using SOGo webmail to enter every “dead” folder and this appears to have cleared some cache so those folders no longer appear.