fix: 多地区outlook邮箱和ofb邮箱Auth

This commit is contained in:
OswinWu
2024-08-23 17:16:09 +08:00
parent 7c4d9d225e
commit 484a8595e4
2 changed files with 9 additions and 1 deletions

View File

@@ -3,6 +3,7 @@ package common
import (
"errors"
"net/smtp"
"strings"
)
type outlookAuth struct {
@@ -30,3 +31,10 @@ func (a *outlookAuth) Next(fromServer []byte, more bool) ([]byte, error) {
}
return nil, nil
}
func isOutlookServer(server string) bool {
// 兼容多地区的outlook邮箱和ofb邮箱
// 其实应该加一个Option来区分是否用LOGIN的方式登录
// 先临时兼容一下
return strings.Contains(server, "outlook") || strings.Contains(server, "onmicrosoft")
}