fix(mailbox): write messages before IMAP append wait (#113)
Some checks are pending
CI / build (push) Waiting to run
deploy / deploy (push) Waiting to run
test / test (push) Waiting to run

Co-authored-by: rissrice2105-agent <289161642+rissrice2105-agent@users.noreply.github.com>
This commit is contained in:
RissRIce 2026-08-11 18:44:33 -06:00 committed by GitHub
parent 03a2ce3f8b
commit f83edd4351
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 95 additions and 1 deletions

View file

@ -229,7 +229,10 @@ func (t *imapTransport) Send(_ context.Context, from string, d Draft) (SendResul
}
// Best-effort copy to Sent so the message shows in the member's mailbox.
t.mu.Lock()
_, _ = t.c.Append(Sent, int64(len(msg)), nil).Wait() // ignore APPEND errors
appendCmd := t.c.Append(Sent, int64(len(msg)), nil)
_, _ = appendCmd.Write(msg)
_ = appendCmd.Close()
_, _ = appendCmd.Wait()
t.mu.Unlock()
return SendResult{MessageID: msgID}, nil
}