public Task<Message> CreateAccountLevelMessageAsync(Message message, Account account, Folder folder) { if (message == null) throw new ArgumentNullException(nameof(message)); if (account == null) throw new ArgumentNullException(nameof(account)); var clonedMessage = message.Clone(); clonedMessage.Id = 0; clonedMessage.AccountId = account.Id; clonedMessage.FolderId = folder.Id; clonedMessage.Filename = Path.ChangeExtension(Guid.NewGuid().ToString(), ".eml"); clonedMessage.Recipients = new List<Recipient>(); var messageFileFullPath = GetMessageFullFileName(account, clonedMessage); var messageDirectory = Path.GetDirectoryName(messageFileFullPath); // TODO: Should be possible to do this asynchronously. Directory.CreateDirectory(messageDirectory); File.Copy(Path.Combine(_dataDirectory, message.Filename), messageFileFullPath); return Task.FromResult(clonedMessage); }