插件迭代、收信规则bug修复
修复邮箱地址解析错误
修改pop删除命令为软删除
升级所有依赖
This commit is contained in:
jinnrry committed 2024-04-13 08:55:03 +08:00
1 parent e95930cc1a
commit 096b4b8fed
22 files changed
+431 -231

No files matched your search

+10
View File
@@ -65,8 +65,14 @@ func DoRule(ctx *context.Context, rule *dto.Rule, email *parsemail.Email) {
switch rule.Action {
case dto.READ:
email.IsRead = 1
if email.MessageId > 0 {
db.Instance.Exec(db.WithContext(ctx, "update email set is_read=1 where id =?"), email.MessageId)
}
case dto.DELETE:
email.Status = 3
if email.MessageId > 0 {
db.Instance.Exec(db.WithContext(ctx, "update email set status=3 where id =?"), email.MessageId)
}
case dto.FORWARD:
if strings.Contains(rule.Params, config.Instance.Domain) {
log.WithContext(ctx).Errorf("Forward Error! loop forwarding!")
@@ -78,5 +84,9 @@ func DoRule(ctx *context.Context, rule *dto.Rule, email *parsemail.Email) {
}
case dto.MOVE:
email.GroupId = cast.ToInt(rule.Params)
if email.MessageId > 0 {
db.Instance.Exec(db.WithContext(ctx, "update email set group_id=? where id =?"), email.GroupId, email.MessageId)
}
}
}