mirror of
https://github.com/profullstack/agentbbs.git
synced 2026-08-13 22:37:28 +00:00
fix(mailbox): write messages before IMAP append wait (#113)
Co-authored-by: rissrice2105-agent <289161642+rissrice2105-agent@users.noreply.github.com>
This commit is contained in:
parent
03a2ce3f8b
commit
f83edd4351
2 changed files with 95 additions and 1 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue