Documentation ¶
Index ¶
- Constants
- Variables
- func Authenticate(a smtp.Auth, source *Source) error
- type Source
- func (source *Source) Authenticate(user *user_model.User, userName, password string) (*user_model.User, error)
- func (source *Source) FromDB(bs []byte) error
- func (source *Source) HasTLS() bool
- func (source *Source) IsSkipLocalTwoFA() bool
- func (source *Source) IsSkipVerify() bool
- func (source *Source) SetAuthSource(authSource *auth.Source)
- func (source *Source) ToDB() ([]byte, error)
- func (source *Source) UseTLS() bool
Constants ¶
View Source
const ( PlainAuthentication = "PLAIN" LoginAuthentication = "LOGIN" CRAMMD5Authentication = "CRAM-MD5" )
SMTP authentication type names.
Variables ¶
View Source
var Authenticators = []string{PlainAuthentication, LoginAuthentication, CRAMMD5Authentication}
Authenticators contains available SMTP authentication type names.
View Source
var ( // ErrUnsupportedLoginType login source is unknown error ErrUnsupportedLoginType = errors.New("Login source is unknown") )
Functions ¶
Types ¶
type Source ¶
type Source struct { Auth string Host string Port int AllowedDomains string `xorm:"TEXT"` ForceSMTPS bool SkipVerify bool HeloHostname string DisableHelo bool SkipLocalTwoFA bool `json:",omitempty"` // contains filtered or unexported fields }
Source holds configuration for the SMTP login source.
func (*Source) Authenticate ¶
func (source *Source) Authenticate(user *user_model.User, userName, password string) (*user_model.User, error)
Authenticate queries if the provided login/password is authenticates against the SMTP server Users will be autoregistered as required
func (*Source) IsSkipLocalTwoFA ¶
IsSkipLocalTwoFA returns if this source should skip local 2fa for password authentication
func (*Source) IsSkipVerify ¶
IsSkipVerify returns if SkipVerify is set
func (*Source) SetAuthSource ¶
SetAuthSource sets the related AuthSource
Click to show internal directories.
Click to hide internal directories.