Cleanup temporary files created during IMAP APPEND command.

Since a recent change (likely since implementing MULTIAPPEND), the temporary
files weren't removed any more. When changing it, I must have had the wrong
mental model about the MessageAdd method, assuming it would remove the temp
file.

Noticed during tests.
This commit is contained in:
Mechiel Lukkien
2025-03-10 09:26:24 +01:00
parent 0857e81a6c
commit a553a107f0
3 changed files with 20 additions and 26 deletions

View File

@ -2043,6 +2043,11 @@ type AddOpts struct {
// MessageAdd delivers a mail message to the account.
//
// The file is hardlinked or copied, the caller must clean up the original file. If
// this call succeeds, but the database transaction with the change can't be
// committed, the caller must clean up the delivered message file identified by
// m.ID.
//
// If the message does not fit in the quota, an error with ErrOverQuota is returned
// and the mailbox and message are unchanged and the transaction can continue. For
// other errors, the caller must abort the transaction.