fix: ignore error "starttls command has been already sent"

This commit is contained in:
xiecang 2022-11-16 12:29:20 +08:00
parent 94e0d06e5d
commit ae407fffca
1 changed files with 6 additions and 1 deletions

View File

@ -42,7 +42,12 @@ func (s *SMTPSendingService) Send(mail *models.Mail) error {
if ok, _ := c.Extension("STARTTLS"); ok {
if err = c.StartTLS(nil); err != nil {
return err
errCode := err.(*smtp.SMTPError).Code
if errCode == 503 {
// TLS already active
} else {
return err
}
}
}
if s.auth != nil {