Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change smtp.MailOptions to a pointer #145

Merged
merged 1 commit into from
Jul 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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