diff --git a/server/config/config.go b/server/config/config.go index dffd71f2..ddfb1fec 100644 --- a/server/config/config.go +++ b/server/config/config.go @@ -38,7 +38,7 @@ type Config struct { //go:embed tables/* var tableConfig embed.FS -const Version = "2.2.0" +const Version = "2.2.1" const DBTypeMySQL = "mysql" const DBTypeSQLite = "sqlite" diff --git a/server/utils/send/send.go b/server/utils/send/send.go index 8ad12b14..83188af7 100644 --- a/server/utils/send/send.go +++ b/server/utils/send/send.go @@ -69,8 +69,12 @@ func Forward(ctx *context.Context, e *parsemail.Email, forwardAddress string) er // 先使用smtps协议尝试 err := smtp.SendMailWithTls("", domain.mxHost+":465", nil, e.From.EmailAddress, buildAddress(tos), b) if err != nil { + log.WithContext(ctx).Errorf("SMTPS Send Error! Error:%+v", err) // smtps发送失败,尝试smtp err = smtp.SendMail("", domain.mxHost+":25", nil, e.From.EmailAddress, buildAddress(tos), b) + if err != nil { + log.WithContext(ctx).Errorf("SMTP Send Error! Error:%+v", err) + } } // 重新选取证书域名 @@ -82,9 +86,12 @@ func Forward(ctx *context.Context, e *parsemail.Email, forwardAddress string) er // 先使用smtps协议尝试 err = smtp.SendMailWithTls(domainMatch(domain.domain, certificateHostName), domain.mxHost+":465", nil, e.From.EmailAddress, buildAddress(tos), b) if err != nil { - log.Infoln(err) + log.WithContext(ctx).Errorf("SMTPS Send Error! Error:%+v", err) // smtps发送失败,尝试smtp err = smtp.SendMail(domainMatch(domain.domain, certificateHostName), domain.mxHost+":25", nil, e.From.EmailAddress, buildAddress(tos), b) + if err != nil { + log.WithContext(ctx).Errorf("SMTP Send Error! Error:%+v", err) + } } } } @@ -156,8 +163,12 @@ func Send(ctx *context.Context, e *parsemail.Email) (error, map[string]error) { // 先使用smtps协议尝试 err := smtp.SendMailWithTls("", domain.mxHost+":465", nil, e.From.EmailAddress, buildAddress(tos), b) if err != nil { + log.WithContext(ctx).Errorf("SMTPS Send Error! Error:%+v", err) // smtps发送失败,尝试smtp err = smtp.SendMail("", domain.mxHost+":25", nil, e.From.EmailAddress, buildAddress(tos), b) + if err != nil { + log.WithContext(ctx).Errorf("SMTP Send Error! Error:%+v", err) + } } // 重新选取证书域名 @@ -169,8 +180,12 @@ func Send(ctx *context.Context, e *parsemail.Email) (error, map[string]error) { // 先使用smtps协议尝试 err = smtp.SendMailWithTls(domainMatch(domain.domain, certificateHostName), domain.mxHost+":465", nil, e.From.EmailAddress, buildAddress(tos), b) if err != nil { + log.WithContext(ctx).Errorf("SMTPS Send Error! Error:%+v", err) // smtps发送失败,尝试smtp err = smtp.SendMail(domainMatch(domain.domain, certificateHostName), domain.mxHost+":25", nil, e.From.EmailAddress, buildAddress(tos), b) + if err != nil { + log.WithContext(ctx).Errorf("SMTP Send Error! Error:%+v", err) + } } } }