Skip to content

Commit

Permalink
Change smtp.MailOptions to a pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
kayrus authored and foxcpp committed Jul 22, 2021
1 parent 30d7182 commit 64a19b7
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ type Session interface {
AuthPlain(username, password string) 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.
Expand Down
2 changes: 1 addition & 1 deletion backendutil/transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (s *transformSession) AuthPlain(username, password string) error {
return s.Session.AuthPlain(username, password)
}

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)
Expand Down
2 changes: 1 addition & 1 deletion backendutil/transform_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (s *session) AuthPlain(username, password string) 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.userErr != nil {
return s.backend.userErr
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/smtp-debug-server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func (s *session) AuthPlain(username, password string) error {
return nil
}

func (s *session) Mail(from string, opts smtp.MailOptions) error {
func (s *session) Mail(from string, opts *smtp.MailOptions) error {
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,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
Expand Down
2 changes: 1 addition & 1 deletion example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func (s *Session) AuthPlain(username, password string) error {
return nil
}

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
}
Expand Down
4 changes: 2 additions & 2 deletions server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type message struct {
From string
To []string
Data []byte
Opts smtp.MailOptions
Opts *smtp.MailOptions
}

type backend struct {
Expand Down Expand Up @@ -79,7 +79,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.userErr != nil {
return s.backend.userErr
}
Expand Down

0 comments on commit 64a19b7

Please sign in to comment.