diff --git a/backend.go b/backend.go index 6a00873..70881a4 100644 --- a/backend.go +++ b/backend.go @@ -69,7 +69,7 @@ type Session interface { Logout() error // Set return path for currently processed message. - Mail(from string, opts MailOptions) error + Mail(from string, opts *MailOptions) error // Add recipient for currently processed message. Rcpt(to string) error // Set currently processed message contents and send it. diff --git a/backendutil/transform.go b/backendutil/transform.go index a5ff666..48d7cad 100755 --- a/backendutil/transform.go +++ b/backendutil/transform.go @@ -43,7 +43,7 @@ func (s *transformSession) Reset() { s.Session.Reset() } -func (s *transformSession) Mail(from string, opts smtp.MailOptions) error { +func (s *transformSession) Mail(from string, opts *smtp.MailOptions) error { if s.be.TransformMail != nil { var err error from, err = s.be.TransformMail(from) diff --git a/backendutil/transform_test.go b/backendutil/transform_test.go index 3c77638..d745909 100755 --- a/backendutil/transform_test.go +++ b/backendutil/transform_test.go @@ -63,7 +63,7 @@ func (s *session) Logout() error { return nil } -func (s *session) Mail(from string, opts smtp.MailOptions) error { +func (s *session) Mail(from string, opts *smtp.MailOptions) error { s.Reset() s.msg.From = from return nil diff --git a/conn.go b/conn.go index f033423..e925306 100644 --- a/conn.go +++ b/conn.go @@ -331,7 +331,7 @@ func (c *Conn) handleMail(arg string) { } from = strings.Trim(from, "<>") - opts := MailOptions{} + opts := &MailOptions{} c.binarymime = false // This is where the Conn may put BODY=8BITMIME, but we already diff --git a/example_test.go b/example_test.go index 607c971..6665a3c 100644 --- a/example_test.go +++ b/example_test.go @@ -108,7 +108,7 @@ func (bkd *Backend) AnonymousLogin(state *smtp.ConnectionState) (smtp.Session, e // A Session is returned after successful login. type Session struct{} -func (s *Session) Mail(from string, opts smtp.MailOptions) error { +func (s *Session) Mail(from string, opts *smtp.MailOptions) error { log.Println("Mail from:", from) return nil } diff --git a/server_test.go b/server_test.go index f2bfe9f..d3a977c 100644 --- a/server_test.go +++ b/server_test.go @@ -17,7 +17,7 @@ type message struct { From string To []string Data []byte - Opts smtp.MailOptions + Opts *smtp.MailOptions } type backend struct { @@ -91,7 +91,7 @@ func (s *session) Logout() error { return nil } -func (s *session) Mail(from string, opts smtp.MailOptions) error { +func (s *session) Mail(from string, opts *smtp.MailOptions) error { if s.backend.panicOnMail { panic("Everything is on fire!") }