Skip to content

Commit

Permalink
readme: update example with latest API
Browse files Browse the repository at this point in the history
  • Loading branch information
emersion committed Mar 18, 2019
1 parent 7006326 commit ffb207c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ import (
type Backend struct{}

// Login handles a login command with username and password.
func (bkd *Backend) Login(username, password string) (smtp.User, error) {
func (bkd *Backend) Login(state *smtp.ConnectionState, username, password string) (smtp.User, error) {
if username != "username" || password != "password" {
return nil, errors.New("Invalid username or password")
}
return &User{}, nil
}

// AnonymousLogin requires clients to authenticate using SMTP AUTH before sending emails
func (bkd *Backend) AnonymousLogin() (smtp.User, error) {
func (bkd *Backend) AnonymousLogin(state *smtp.ConnectionState) (smtp.User, error) {
return nil, smtp.ErrAuthRequired
}

Expand Down

0 comments on commit ffb207c

Please sign in to comment.