ensure senderaccount is always set for messages in queue

before, the smtpserver that queued a dsn would set an empty senderaccount,
which was interpreted in a few places as the globally configured postmaster
cacount. the empty senderaccount would be used by the smtpserver that queued a
dsn with null return path. we now set the postmaster account when we add a
message to the queue. more code in the queue pretty much needs a non-empty
senderaccount, such as the filters when listing, and the suppression list.
This commit is contained in:
Mechiel Lukkien
2024-04-28 11:03:47 +02:00
parent 6e7f15e0e4
commit e2924af8d2
3 changed files with 21 additions and 25 deletions

View File

@ -56,7 +56,7 @@ func queueDSN(ctx context.Context, log mlog.Log, c *conn, rcptTo smtp.Path, m ds
}
qm := queue.MakeMsg(smtp.Path{}, rcptTo, has8bit, smtputf8, int64(len(buf)), m.MessageID, nil, reqTLS, time.Now(), m.Subject)
qm.DSNUTF8 = bufUTF8
if err := queue.Add(ctx, c.log, "", f, qm); err != nil {
if err := queue.Add(ctx, c.log, mox.Conf.Static.Postmaster.Account, f, qm); err != nil {
return err
}
return nil