diff options
Diffstat (limited to 'plugins/base/smtp.go')
-rw-r--r-- | plugins/base/smtp.go | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/plugins/base/smtp.go b/plugins/base/smtp.go index 40967dc..14bff07 100644 --- a/plugins/base/smtp.go +++ b/plugins/base/smtp.go @@ -53,37 +53,6 @@ func (att *formAttachment) Filename() string { return att.FileHeader.Filename } -type refcountedAttachment struct { - *multipart.FileHeader - *multipart.Form - refs int -} - -func (att *refcountedAttachment) Open() (io.ReadCloser, error) { - return att.FileHeader.Open() -} - -func (att *refcountedAttachment) MIMEType() string { - // TODO: retain params, e.g. "charset"? - t, _, _ := mime.ParseMediaType(att.FileHeader.Header.Get("Content-Type")) - return t -} - -func (att *refcountedAttachment) Filename() string { - return att.FileHeader.Filename -} - -func (att *refcountedAttachment) Ref(n int) { - att.refs += n -} - -func (att *refcountedAttachment) Unref() { - att.refs -= 1 - if att.refs == 0 { - att.Form.RemoveAll() - } -} - type imapAttachment struct { Mailbox string Uid uint32 @@ -211,22 +180,6 @@ func (msg *OutgoingMessage) WriteTo(w io.Writer) error { return nil } -func (msg *OutgoingMessage) Ref(n int) { - for _, a := range msg.Attachments { - if a, ok := a.(*refcountedAttachment); ok { - a.Ref(n) - } - } -} - -func (msg *OutgoingMessage) Unref() { - for _, a := range msg.Attachments { - if a, ok := a.(*refcountedAttachment); ok { - a.Unref() - } - } -} - func sendMessage(c *smtp.Client, msg *OutgoingMessage) error { if err := c.Mail(msg.From, nil); err != nil { return fmt.Errorf("MAIL FROM failed: %v", err) |