fix
This commit is contained in:
parent
28bae50630
commit
5f26d2b18e
@ -64,6 +64,24 @@ func (s *Session) Data(r io.Reader) error {
|
|||||||
// 判断是收信还是转发,只要是登陆了,都当成转发处理
|
// 判断是收信还是转发,只要是登陆了,都当成转发处理
|
||||||
//account, domain := email.From.GetDomainAccount()
|
//account, domain := email.From.GetDomainAccount()
|
||||||
if s.Ctx.UserID > 0 {
|
if s.Ctx.UserID > 0 {
|
||||||
|
|
||||||
|
log.WithContext(ctx).Debugf("开始执行插件SendBefore!")
|
||||||
|
as2 := async.New(ctx)
|
||||||
|
for _, hook := range hooks.HookList {
|
||||||
|
if hook == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
as2.WaitProcess(func(hk any) {
|
||||||
|
hk.(framework.EmailHook).SendBefore(ctx, email)
|
||||||
|
}, hook)
|
||||||
|
}
|
||||||
|
as2.Wait()
|
||||||
|
log.WithContext(ctx).Debugf("开始执行插件SendBefore!End")
|
||||||
|
|
||||||
|
if email == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// 转发
|
// 转发
|
||||||
err := saveEmail(ctx, email, 1, true, true)
|
err := saveEmail(ctx, email, 1, true, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -86,10 +104,7 @@ func (s *Session) Data(r io.Reader) error {
|
|||||||
|
|
||||||
SPFStatus = spfCheck(s.RemoteAddress.String(), email.Sender, email.Sender.EmailAddress)
|
SPFStatus = spfCheck(s.RemoteAddress.String(), email.Sender, email.Sender.EmailAddress)
|
||||||
|
|
||||||
saveEmail(ctx, email, 0, SPFStatus, dkimStatus)
|
|
||||||
|
|
||||||
log.WithContext(ctx).Debugf("开始执行插件ReceiveParseAfter!")
|
log.WithContext(ctx).Debugf("开始执行插件ReceiveParseAfter!")
|
||||||
|
|
||||||
as2 := async.New(ctx)
|
as2 := async.New(ctx)
|
||||||
for _, hook := range hooks.HookList {
|
for _, hook := range hooks.HookList {
|
||||||
if hook == nil {
|
if hook == nil {
|
||||||
@ -102,6 +117,12 @@ func (s *Session) Data(r io.Reader) error {
|
|||||||
as2.Wait()
|
as2.Wait()
|
||||||
log.WithContext(ctx).Debugf("开始执行插件ReceiveParseAfter!End")
|
log.WithContext(ctx).Debugf("开始执行插件ReceiveParseAfter!End")
|
||||||
|
|
||||||
|
if email == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
saveEmail(ctx, email, 0, SPFStatus, dkimStatus)
|
||||||
|
|
||||||
log.WithContext(ctx).Debugf("开始执行邮件规则!")
|
log.WithContext(ctx).Debugf("开始执行邮件规则!")
|
||||||
// 执行邮件规则
|
// 执行邮件规则
|
||||||
rs := rule.GetAllRules(ctx)
|
rs := rule.GetAllRules(ctx)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user