Make IMAP and SMTP sessions check for passwords
This commit is contained in:
@@ -5,6 +5,8 @@ import (
|
||||
"log"
|
||||
|
||||
imapbackend "github.com/emersion/go-imap/backend"
|
||||
|
||||
"ur.gs/crockery/internal/store"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -14,12 +16,12 @@ var (
|
||||
// type Session implements the User interface for emersion/go-imap
|
||||
type Session struct {
|
||||
ID uint64
|
||||
AccountName string
|
||||
Account *store.Account
|
||||
ServiceName string
|
||||
}
|
||||
|
||||
func (s *Session) Username() string {
|
||||
return s.AccountName
|
||||
return s.Account.Username
|
||||
}
|
||||
|
||||
func (s *Session) ListMailboxes(subscribed bool) ([]imapbackend.Mailbox, error) {
|
||||
@@ -43,7 +45,7 @@ func (s *Session) RenameMailbox(existingName, newName string) error {
|
||||
}
|
||||
|
||||
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.Username())
|
||||
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user