Skip to content

Commit 15c54ed

Browse files
committed
added all possible headers
1 parent b2c4cb9 commit 15c54ed

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

main.go

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,30 @@ func main() {
2525

2626
req := resty.New().R()
2727

28-
// set the url-encoded-data
29-
req.SetFormData(map[string]string{
28+
formData := map[string]string{
3029
"id": msg.MessageID,
30+
"date": msg.Date.String(),
3131
"subject": msg.Subject,
3232
"body[text]": string(msg.TextBody),
3333
"body[html]": string(msg.HTMLBody),
3434
"addresses[from]": c.From().Address,
3535
"addresses[to]": strings.Join(extractEmails(msg.To), ","),
36+
"addresses[reply-to]": strings.Join(extractEmails(msg.ReplyTo), ","),
37+
"addresses[resent-to]": strings.Join(extractEmails(msg.ResentTo), ","),
38+
"addresses[resent-cc]": strings.Join(extractEmails(msg.ResentCc), ","),
39+
"addresses[resent-bcc]": strings.Join(extractEmails(msg.ResentBcc), ","),
40+
"addresses[resent-from]": strings.Join(extractEmails(msg.ResentFrom), ","),
3641
"addresses[in-reply-to]": strings.Join(msg.InReplyTo, ","),
3742
"addresses[cc]": strings.Join(extractEmails(msg.Cc), ","),
3843
"addresses[bcc]": strings.Join(extractEmails(msg.Bcc), ","),
44+
"resent-date": msg.ResentDate.String(),
45+
"resent-id": msg.ResentMessageID,
46+
"references": strings.Join(msg.References, "m"),
3947
"spf_result": strings.ToLower(spfResult.String()),
40-
})
48+
}
49+
50+
// set the url-encoded-data
51+
req.SetFormData(formData)
4152

4253
// set the files "attachments"
4354
for i, file := range msg.Attachments {

0 commit comments

Comments
 (0)