Skip to content

Commit 32d0206

Browse files
committed
throw an error if the remote is configured for starttls and the server does not have the extension
1 parent b7f3701 commit 32d0206

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

smtp.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,8 @@ func SendMail(r *Remote, from string, to []string, msg []byte) error {
374374
if err = c.StartTLS(config); err != nil {
375375
return err
376376
}
377+
} else if r.Scheme == "starttls" {
378+
return errors.New("starttls: server does not support extension, check remote scheme")
377379
}
378380
}
379381
if r.Auth != nil && c.ext != nil {

0 commit comments

Comments
 (0)