---
> go-message already has a helper to generate Message-Id header fields
Oh woops, silly me! Let me know if this patch looks good, it overwrites
the Message-Id header as requested!
The only thing I noticed is that the header is defined as "Message-Id"
rather than "Message-ID", not a big deal but I don't think it's 100%
RFC compliant as is.
Message header names are not case-sensitive, so this shouldn't be an
issue.
plugins/base/smtp.go | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/plugins/base/smtp.go b/plugins/base/smtp.go
index 19c9e0b..de4753f 100644
--- a/plugins/base/smtp.go
+++ b/plugins/base/smtp.go
@@ -138,7 +138,8 @@ func (msg *OutgoingMessage) WriteTo(w io.Writer) error {
if msg.InReplyTo != "" {
h.Set("In-Reply-To", msg.InReplyTo)
}
- // TODO: set Message-ID
+
+ h.Set("Message-Id", mail.GenerateMessageID())
mw, err := mail.CreateWriter(w, h)
if err != nil {
--
2.28.0
Thanks! Pushed with a minor edit to change indentation to tabs instead
of spaces.