mirror of
https://github.com/profullstack/agentbbs.git
synced 2026-08-14 14:57:27 +00:00
fix(mailbox): write messages before IMAP append wait
This commit is contained in:
parent
03a2ce3f8b
commit
40407e061d
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