mirror of
https://github.com/mjl-/mox.git
synced 2025-07-10 09:14:39 +03:00
make it harder to forget to set smtputf8 on message.Composer
we should do better: first gather all headers, and only write it when we start on the body, and then calculate smtputf8 ourselves.
This commit is contained in:
@ -366,8 +366,6 @@ func (w Webmail) MessageSubmit(ctx context.Context, m SubmitMessage) {
|
||||
xcheckf(ctx, err, "checking send limit")
|
||||
})
|
||||
|
||||
has8bit := false // We update this later on.
|
||||
|
||||
// We only use smtputf8 if we have to, with a utf-8 localpart. For IDNA, we use ASCII domains.
|
||||
smtputf8 := false
|
||||
for _, a := range recipients {
|
||||
@ -387,7 +385,7 @@ func (w Webmail) MessageSubmit(ctx context.Context, m SubmitMessage) {
|
||||
defer store.CloseRemoveTempFile(log, dataFile, "message to submit")
|
||||
|
||||
// If writing to the message file fails, we abort immediately.
|
||||
xc := message.NewComposer(dataFile, w.maxMessageSize)
|
||||
xc := message.NewComposer(dataFile, w.maxMessageSize, smtputf8)
|
||||
defer func() {
|
||||
x := recover()
|
||||
if x == nil {
|
||||
@ -643,7 +641,7 @@ func (w Webmail) MessageSubmit(ctx context.Context, m SubmitMessage) {
|
||||
Localpart: rcpt.Localpart,
|
||||
IPDomain: dns.IPDomain{Domain: rcpt.Domain},
|
||||
}
|
||||
qm := queue.MakeMsg(fromPath, toPath, has8bit, smtputf8, msgSize, messageID, []byte(rcptMsgPrefix), m.RequireTLS, now)
|
||||
qm := queue.MakeMsg(fromPath, toPath, xc.Has8bit, xc.SMTPUTF8, msgSize, messageID, []byte(rcptMsgPrefix), m.RequireTLS, now)
|
||||
if m.FutureRelease != nil {
|
||||
ival := time.Until(*m.FutureRelease)
|
||||
if ival < 0 {
|
||||
|
Reference in New Issue
Block a user