@ -58,10 +58,10 @@ var ErrUnsupportedLoginType = errors.New("Login source is unknown")
func Authenticate ( a smtp . Auth , source * Source ) error {
func Authenticate ( a smtp . Auth , source * Source ) error {
tlsConfig := & tls . Config {
tlsConfig := & tls . Config {
InsecureSkipVerify : source . SkipVerify ,
InsecureSkipVerify : source . SkipVerify ,
ServerName : source . Addr ,
ServerName : source . Host ,
}
}
conn , err := net . Dial ( "tcp" , net . JoinHostPort ( source . Addr , strconv . Itoa ( source . Port ) ) )
conn , err := net . Dial ( "tcp" , net . JoinHostPort ( source . Host , strconv . Itoa ( source . Port ) ) )
if err != nil {
if err != nil {
return err
return err
}
}
@ -71,7 +71,7 @@ func Authenticate(a smtp.Auth, source *Source) error {
conn = tls . Client ( conn , tlsConfig )
conn = tls . Client ( conn , tlsConfig )
}
}
client , err := smtp . NewClient ( conn , source . Addr )
client , err := smtp . NewClient ( conn , source . Host )
if err != nil {
if err != nil {
return fmt . Errorf ( "failed to create NewClient: %w" , err )
return fmt . Errorf ( "failed to create NewClient: %w" , err )
}
}