ソースを参照

[Minor] Deal with DSN messages

tags/1.5.2
Vsevolod Stakhov 7年前
コミット
39adeb7897
3個のファイルの変更10行の追加2行の削除
  1. 1
    1
      rules/misc.lua
  2. 8
    1
      src/libmime/content_type.c
  3. 1
    0
      src/libmime/content_type.h

+ 1
- 1
rules/misc.lua ファイルの表示

@@ -188,7 +188,7 @@ rspamd_config.BROKEN_CONTENT_TYPE = {
return fun.any(function(p) return p:is_broken() end,
task:get_parts())
end,
score = 3.0,
score = 1.5,
group = 'header',
description = 'Message has part with broken content type'
}

+ 8
- 1
src/libmime/content_type.c ファイルの表示

@@ -144,7 +144,14 @@ rspamd_content_type_parse (const gchar *in,
RSPAMD_FTOK_ASSIGN (&srch, "message");

if (rspamd_ftok_cmp (&res->type, &srch) == 0) {
res->flags |= RSPAMD_CONTENT_TYPE_MESSAGE;
RSPAMD_FTOK_ASSIGN (&srch, "delivery-status");

if (rspamd_ftok_cmp (&res->subtype, &srch) == 0) {
res->flags |= RSPAMD_CONTENT_TYPE_TEXT|RSPAMD_CONTENT_TYPE_DSN;
}
else {
res->flags |= RSPAMD_CONTENT_TYPE_MESSAGE;
}
}
}
}

+ 1
- 0
src/libmime/content_type.h ファイルの表示

@@ -26,6 +26,7 @@ enum rspamd_content_type_flags {
RSPAMD_CONTENT_TYPE_MULTIPART = 1 << 1,
RSPAMD_CONTENT_TYPE_TEXT = 1 << 2,
RSPAMD_CONTENT_TYPE_MESSAGE = 1 << 3,
RSPAMD_CONTENT_TYPE_DSN = 1 << 4,
};

#define IS_CT_MULTIPART(ct) ((ct)->flags & RSPAMD_CONTENT_TYPE_MULTIPART)

読み込み中…
キャンセル
保存