commit 12ed9e8: [Minor] Add pkcs7 content type flag

Vsevolod Stakhov vsevolod at highsecure.ru
Mon Dec 21 17:21:08 UTC 2020


Author: Vsevolod Stakhov
Date: 2020-12-21 16:17:42 +0000
URL: https://github.com/rspamd/rspamd/commit/12ed9e839f63ffd41d7f1d1dda478b9ebc6b3088

[Minor] Add pkcs7 content type flag

---
 src/libmime/content_type.c | 6 ++++++
 src/libmime/content_type.h | 1 +
 2 files changed, 7 insertions(+)

diff --git a/src/libmime/content_type.c b/src/libmime/content_type.c
index 0c06f51fb..7b9c213ca 100644
--- a/src/libmime/content_type.c
+++ b/src/libmime/content_type.c
@@ -706,6 +706,12 @@ rspamd_content_type_parse (const gchar *in,
 				res->flags |= RSPAMD_CONTENT_TYPE_BROKEN;
 				RSPAMD_FTOK_ASSIGN (&res->subtype, "alternative");
 			}
+
+			/* PKCS7 smime */
+			RSPAMD_FTOK_ASSIGN (&srch, "x-pkcs7-mime");
+			if (rspamd_ftok_casecmp (&res->subtype, &srch) == 0) {
+				res->flags |= RSPAMD_CONTENT_TYPE_SMIME;
+			}
 		}
 
 		RSPAMD_FTOK_ASSIGN (&srch, "multipart");
diff --git a/src/libmime/content_type.h b/src/libmime/content_type.h
index 0f7b8e963..6bc7262e7 100644
--- a/src/libmime/content_type.h
+++ b/src/libmime/content_type.h
@@ -33,6 +33,7 @@ enum rspamd_content_type_flags {
 	RSPAMD_CONTENT_TYPE_DSN = 1 << 4,
 	RSPAMD_CONTENT_TYPE_MISSING = 1 << 5,
 	RSPAMD_CONTENT_TYPE_ENCRYPTED = 1 << 6,
+	RSPAMD_CONTENT_TYPE_SMIME = 1 << 7,
 };
 
 enum rspamd_content_param_flags {


More information about the Commits mailing list