From b91c39494e7d77b044a9e2e335a43f43988eb70b Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 21 Mar 2016 12:40:03 +0000 Subject: [PATCH] [Doc] Add mime_types documentation --- doc/markdown/modules/mime_types.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 doc/markdown/modules/mime_types.md diff --git a/doc/markdown/modules/mime_types.md b/doc/markdown/modules/mime_types.md new file mode 100644 index 000000000..4910fcae9 --- /dev/null +++ b/doc/markdown/modules/mime_types.md @@ -0,0 +1,30 @@ +# Rspamd mime types module + +This module is intended to do some mime types sanity checks. That includes the following: + +1. Checks whether mime type is from the `good` list (e.g. `multipart/alternative` or `text/html`) +2. Checks if a mime type is from the `bad` list (e.g. `multipart/form-data`) +3. Checks if an attachement filename extension is different from the intended mime type + +## Configuration + +`mime_types` module reads mime types map specified in `file` option. This map contains binding + +``` +type/subtype score +``` + +When score is more than `0` then it is considered as `bad` if it is less than `0` it is considered as `good` (with the corresponding multiplier). +When mime type is not listed then `MIME_UNKNOWN` symbol is inserted. + +`extension_map` option allows to specify map from a known extension to a specific mime type: + +~~~ucl +extension_map = { + html = "text/html"; + txt = "text/plain"; + pdf = "application/pdf"; +} +~~~ + +When an attachement extension matches left part but the content type does not match the right part then symbol `MIME_BAD_ATTACHMENT` is inserted. -- 2.39.5