~bigbes/core-go: db4d67a2

email: fix empty emails sent on retries

io.Reader objects can only be consumed once. On retry, re-reading from
them will return 0 bytes all the time.

Change NewTask to take in a bytes array instead of a reader. Create
a new reader on each retry.

Also remove SendRaw which has an inherent issue related to retry as
well. message.Entity is virtually a reader that can only be consumed
once.

Update EnqueueRaw to take a bytes array directly and have it call
NewTask() like EnqueueStd does.

Fixes: 78cfc5d87a7d ("email: allow sending raw emails")
Signed-off-by: Robin Jarry <robin@jarry.cc>

Robin Jarry <robin@jarry.cc> — 2025-01-12 20:28:33 UTC

Commit db4d67a2a6fb43da1f64b632a7d0c5a0e8b0e421view raw patch

Parent(s): 6eae2199

2 changed file(s)

FileStatus+
email/send.go M -46
email/worker.go M +16 -23