mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-14 11:58:02 +00:00
23 lines
569 B
Go
23 lines
569 B
Go
|
package smtp
|
||
|
|
||
|
import (
|
||
|
"net/smtp"
|
||
|
)
|
||
|
|
||
|
type unencryptedAuth struct {
|
||
|
smtp.Auth
|
||
|
}
|
||
|
|
||
|
// PlainAuth returns an Auth that implements the PLAIN authentication
|
||
|
// mechanism as defined in RFC 4616. The returned Auth uses the given
|
||
|
// username and password to authenticate to host and act as identity.
|
||
|
// Usually identity should be the empty string, to act as username.
|
||
|
//
|
||
|
// This reimplementation allows it to work over non-TLS connections
|
||
|
|
||
|
func (a unencryptedAuth) Start(server *smtp.ServerInfo) (string, []byte, error) {
|
||
|
s := *server
|
||
|
s.TLS = true
|
||
|
return a.Auth.Start(&s)
|
||
|
}
|