Documentation
¶
Index ¶
- Constants
- Variables
- func Authenticate(a smtp.Auth, source *Source) error
- type Source
- func (source *Source) Authenticate(ctx context.Context, 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) IsSkipVerify() bool
- 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.
ErrUnsupportedLoginType login source is unknown error
Functions ¶
Types ¶
type Source ¶
type Source struct {
auth.ConfigBase `json:"-"`
Auth string
Host string
Port int
AllowedDomains string `xorm:"TEXT"`
ForceSMTPS bool
SkipVerify bool
HeloHostname string
DisableHelo bool
}
Source holds configuration for the SMTP login source.
func (*Source) Authenticate ¶
func (source *Source) Authenticate(ctx context.Context, 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) FromDB ¶
FromDB fills up an SMTPConfig from serialized format.
func (*Source) IsSkipVerify ¶
IsSkipVerify returns if SkipVerify is set
func (*Source) ToDB ¶
ToDB exports an SMTPConfig to a serialized format.
Source Files
¶
- auth.go
- source.go
- source_authenticate.go
Click to show internal directories.
Click to hide internal directories.