private async Task <string> ApplyEnqueuedModificationsAsync(MBoxWriteReference mbox)
        {
            var targetMailbox = mbox.Mailbox;
            var name          = MailUtilities.GetNameFromMailbox(targetMailbox);
            var rootName      = StripExtension(name);
            var currentPath   = mbox.TempPath;

            if (name != rootName)
            {
                currentPath = await AugmentReferencesAsync(currentPath, targetMailbox);
            }

            return(currentPath);
        }
        private string GetFolderPath(string mailbox, string folder, string status)
        {
            // Turn foo/bar into .foo.bar, because that's what maildir says
            string folderPart = string.Join(
                "",
                folder.Split(FolderSeparator, StringSplitOptions.RemoveEmptyEntries)
                .Select(s => "." + s)
                .ToArray()
                );

            var nameFromMailbox = MailUtilities.GetNameFromMailbox(mailbox);


            return(Path.Combine(
                       _settings.MailLocalPath,
                       MailUtilities.GetDomainFromMailbox(mailbox),
                       StripExtension(nameFromMailbox),
                       folderPart,
                       status));
        }