فهرست منبع

throw an error if the remote is configured for starttls and the server does not have the extension

Mark Gardner 3 سال پیش
والد
کامیت
32d0206af0
1فایلهای تغییر یافته به همراه2 افزوده شده و 0 حذف شده
  1. 2 0
      smtp.go

+ 2 - 0
smtp.go

@@ -374,6 +374,8 @@ func SendMail(r *Remote, from string, to []string, msg []byte) error {
 			if err = c.StartTLS(config); err != nil {
 			if err = c.StartTLS(config); err != nil {
 				return err
 				return err
 			}
 			}
+		} else if r.Scheme == "starttls" {
+			return errors.New("starttls: server does not support extension, check remote scheme")
 		}
 		}
 	}
 	}
 	if r.Auth != nil && c.ext != nil {
 	if r.Auth != nil && c.ext != nil {