补齐收件回复入口并限制原邮件归属与类型
Security Checks / security (push) Waiting to run

This commit is contained in:
xuans committed 2026-09-27 20:51:16 +08:00
1 parent d5073cccbe
commit 6a35d0d2b7
6 files changed
+13 -3

No files matched your search

+2 -1
View File
@@ -18,7 +18,7 @@ func applyReplyThread(ctx *context.Context, input sendRequest, message *parsemai
if id == 0 {
return nil
}
if id < 0 || ctx == nil || ctx.UserID <= 0 || db.Instance == nil || message == nil {
if id < 0 || ctx == nil || ctx.UserID <= 0 || db.Instance == nil {
return validation.ErrInvalidEmail
}
if input.DraftID > 0 {
@@ -37,6 +37,7 @@ func applyReplyThread(ctx *context.Context, input sendRequest, message *parsemai
var original models.Email
found, err := db.Instance.ID(id).
Where("status <> ?", consts.EmailStatusDrafts).
And("type = ?", consts.EmailTypeReceive).
And("EXISTS (SELECT 1 FROM user_email WHERE email_id = ? AND user_id = ? AND is_deleted = 0)", id, ctx.UserID).
Get(&original)
if err != nil {
@@ -103,7 +103,6 @@ func buildEnvelope(email *response.EmailResponseData, traEmail *parsemail.Email)
Bcc: usersToAddresses(traEmail.Bcc),
MessageID: messageID,
InReplyTo: parsemail.ThreadMessageIDs(email.InReplyTo),
// InReplyTo 和 References 暂不支持
}
}