aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/smtp.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/base/smtp.go')
-rw-r--r--plugins/base/smtp.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/plugins/base/smtp.go b/plugins/base/smtp.go
index a6cfd3d..50a2fd0 100644
--- a/plugins/base/smtp.go
+++ b/plugins/base/smtp.go
@@ -73,8 +73,8 @@ func (att *refcountedAttachment) Filename() string {
return att.FileHeader.Filename
}
-func (att *refcountedAttachment) Ref() {
- att.refs += 1
+func (att *refcountedAttachment) Ref(n int) {
+ att.refs += n
}
func (att *refcountedAttachment) Unref() {
@@ -111,6 +111,7 @@ type OutgoingMessage struct {
From string
To []string
Subject string
+ MessageID string
InReplyTo string
Text string
Attachments []Attachment
@@ -170,7 +171,7 @@ func (msg *OutgoingMessage) WriteTo(w io.Writer) error {
h.Set("In-Reply-To", msg.InReplyTo)
}
- h.Set("Message-Id", mail.GenerateMessageID())
+ h.Set("Message-Id", msg.MessageID)
mw, err := mail.CreateWriter(w, h)
if err != nil {
@@ -207,10 +208,10 @@ func (msg *OutgoingMessage) WriteTo(w io.Writer) error {
return nil
}
-func (msg *OutgoingMessage) Ref() {
+func (msg *OutgoingMessage) Ref(n int) {
for _, a := range msg.Attachments {
if a, ok := a.(*refcountedAttachment); ok {
- a.Ref()
+ a.Ref(n)
}
}
}