禁止设置安全入口为登录地址

This commit is contained in:
zhangchenhao
2025-05-08 16:34:52 +08:00
parent 4c196c8dbf
commit bb0b610cc6
2 changed files with 16 additions and 2 deletions

View File

@@ -181,9 +181,19 @@ func NotifyMail(params map[string]any) error {
InsecureSkipVerify: true, // 开发阶段跳过证书验证,生产建议关闭
ServerName: config["smtpHost"],
}
return e.SendWithTLS(addr, auth, tlsConfig)
err = e.SendWithTLS(addr, auth, tlsConfig)
if err != nil && (err.Error() == "EOF" || err.Error() == "short response" || err.Error() == "server response incomplete") {
// 忽略短响应错误
return nil
}
return err
}
// 普通明文发送25端口非推荐
return e.Send(addr, auth)
err = e.Send(addr, auth)
if err != nil && (err.Error() == "EOF" || err.Error() == "short response" || err.Error() == "server response incomplete") {
// 忽略短响应错误
return nil
}
return err
}