Make IMAP and SMTP sessions check for passwords

This commit is contained in:
2018-03-06 00:49:35 +00:00
parent 5aa6607746
commit 32df489b50
5 changed files with 51 additions and 14 deletions

View File

@@ -5,12 +5,14 @@ import (
"io"
"io/ioutil"
"log"
"ur.gs/crockery/internal/store"
)
// type Session implements the User interface for emersion/go-smtp
type Session struct {
ID uint64
AccountName string
Account *store.Account
ServiceName string
}
@@ -20,13 +22,13 @@ func (s *Session) Send(from string, to []string, r io.Reader) error {
return err
}
log.Printf("%s session %d for %s: from=%s, to=%s, r=<<EOF\n%s\nEOF", s.ServiceName, s.ID, s.AccountName, from, to, string(data))
log.Printf("%s session %d for %s: from=%s, to=%s, r=<<EOF\n%s\nEOF", s.ServiceName, s.ID, s.Account.Username, from, to, string(data))
return fmt.Errorf("Not yet implemented")
}
func (s *Session) Logout() error {
log.Printf("Ending %s session %d for %s", s.ServiceName, s.ID, s.AccountName)
log.Printf("Ending %s session %d for %s", s.ServiceName, s.ID, s.Account.Username)
return nil
}