Hello,
As you probably know, there is a limit on a path length on Windows.
In some conditions, customers using SmarterMail are allowed to create path that exceed this and therefore SmarterMail returns an exception when trying to create the folder on the filesystem.
We identified some possible way customers can do this. For example creating subfolders in subfolders in subfolders that are reaching the limit.
Or moving a subfolder tree in another subfolder tree, creating an even longer subfolder tree.
When this happens the folder is not created on the filesystem, but the reference to the folder IS added to the user folders.json anyway.
The issue is not directly affecting the user account, but if you then issue a domain reload or have to restart SmarterMail because it crashed, these mailbox with such attempted folder creations are unusable.
It need a manual inspection of the folders.json file to remove the entries to these too long folders creation attempt entries.
No action can be done from SmarterMail on these users until the json was cleaned from these. It is really painful.
We absolutely need SmarterMail to prevent adding entries in folders.json for folder it wasn't able to create on the disk.
I was able to reproduce the issue on a test account by creating long names subfolders from an IMAP client and/or moving around folders inside other folders, at some point the account was dead with this in the log:
[2021.04.07] 17:39:55.085 MailboxManager Exception in GetMailbox. Path: dossier pourri\encore plus pourri pour voir &aoa- quel moment &aoc-a bug\et la c'est encore pire qu'avant du coup\apr&aog-s faut voir si &aoc-a fonctionne on sait jamais\la ca va &AOo-tre le truc en trop qui va tout casser Root: G:\SmarterMail\Domains\somedomain.com\Users\madjik\Mail. Exception: System.IO.DirectoryNotFoundException: Could not find a part of the path 'G:\SmarterMail\Domains\somedomain.com\Users\madjik\Mail\dossier pourri\encore plus pourri pour voir &aoa- quel moment &aoc-a bug\et la c'est encore pire qu'avant du coup\apr&aog-s faut voir si &aoc-a fonctionne on sait jamais\la ca va &AOo-tre le truc en trop qui va tout casser\'.
[2021.04.07] at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
[2021.04.07] at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj, Boolean checkHost)
[2021.04.07] at System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost)
[2021.04.07] at MailService.Mailboxes.Mailbox.MailboxConstructorFunction()
[2021.04.07] at MailService.Mailboxes.MailboxManager.GetMailbox(String subFolderName, Dictionary`2 timings)
[2021.04.07] 17:40:18.817 MailboxManager Exception in GetMailbox. Path: dossier pourri\encore plus pourri pour voir &aoa- quel moment &aoc-a bug\et la c'est encore pire qu'avant du coup\apr&aog-s faut voir si &aoc-a fonctionne on sait jamais\la ca va &AOo-tre le truc en trop qui va tout casser Root: G:\SmarterMail\Domains\somedomain.com\Users\madjik\Mail. Exception: System.IO.DirectoryNotFoundException: Could not find a part of the path 'G:\SmarterMail\Domains\somedomain.com\Users\madjik\Mail\dossier pourri\encore plus pourri pour voir &aoa- quel moment &aoc-a bug\et la c'est encore pire qu'avant du coup\apr&aog-s faut voir si &aoc-a fonctionne on sait jamais\la ca va &AOo-tre le truc en trop qui va tout casser\'.
[2021.04.07] at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
[2021.04.07] at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj, Boolean checkHost)
[2021.04.07] at System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost)
[2021.04.07] at MailService.Mailboxes.Mailbox.MailboxConstructorFunction()
[2021.04.07] at MailService.Mailboxes.MailboxManager.GetMailbox(String subFolderName, Dictionary`2 timings)
[2021.04.07] 17:41:59.086 MailboxManager Exception in GetMailbox. Path: dossier pourri\encore plus pourri pour voir &aoa- quel moment &aoc-a bug\et la c'est encore pire qu'avant du coup\apr&aog-s faut voir si &aoc-a fonctionne on sait jamais\la ca va &AOo-tre le truc en trop qui va tout casser Root: G:\SmarterMail\Domains\somedomain.com\Users\madjik\Mail. Exception: System.IO.DirectoryNotFoundException: Could not find a part of the path 'G:\SmarterMail\Domains\somedomain.com\Users\madjik\Mail\dossier pourri\encore plus pourri pour voir &aoa- quel moment &aoc-a bug\et la c'est encore pire qu'avant du coup\apr&aog-s faut voir si &aoc-a fonctionne on sait jamais\la ca va &AOo-tre le truc en trop qui va tout casser\'.
[2021.04.07] at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
[2021.04.07] at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj, Boolean checkHost)
[2021.04.07] at System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost)
[2021.04.07] at MailService.Mailboxes.Mailbox.MailboxConstructorFunction()
[2021.04.07] at MailService.Mailboxes.MailboxManager.GetMailbox(String subFolderName, Dictionary`2 timings)
TLDR; It would be great to either support longer path length for mailboxes folders (if it has been enabled on the system) or to prevent too long folder paths to be added in user folders.json for folder that can't be created on the filesystem.
Kind regards