mirror of
https://github.com/mjl-/mox.git
synced 2025-07-14 16:54:36 +03:00
add "RcptTo" to webapi MessageGet result
otherwise, if the recipient was a bcc, there's no good way to see why the message was received. incoming webhooks already have this rcptto field, but that's not always the moment you want to process it. for mattanja on matrix, thanks for reporting!
This commit is contained in:
@ -1245,12 +1245,17 @@ func (s server) MessageGet(ctx context.Context, req webapi.MessageGetRequest) (r
|
||||
if d, err := dns.ParseDomain(m.MsgFromDomain); err == nil {
|
||||
msgFrom = smtp.NewAddress(m.MsgFromLocalpart, d).Pack(true)
|
||||
}
|
||||
var rcptTo string
|
||||
if m.RcptToDomain != "" {
|
||||
rcptTo = m.RcptToLocalpart.String() + "@" + m.RcptToDomain
|
||||
}
|
||||
meta := webapi.MessageMeta{
|
||||
Size: m.Size,
|
||||
DSN: m.DSN,
|
||||
Flags: append(m.Flags.Strings(), m.Keywords...),
|
||||
MailFrom: m.MailFrom,
|
||||
MailFromValidated: m.MailFromValidated,
|
||||
RcptTo: rcptTo,
|
||||
MsgFrom: msgFrom,
|
||||
MsgFromValidated: m.MsgFromValidated,
|
||||
DKIMVerifiedDomains: m.DKIMDomains,
|
||||
|
Reference in New Issue
Block a user