From: Vsevolod Stakhov Date: Mon, 21 Mar 2016 12:40:03 +0000 (+0000) Subject: [Doc] Add mime_types documentation X-Git-Tag: 1.2.0~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b91c39494e7d77b044a9e2e335a43f43988eb70b;p=thirdparty%2Frspamd.git [Doc] Add mime_types documentation --- diff --git a/doc/markdown/modules/mime_types.md b/doc/markdown/modules/mime_types.md new file mode 100644 index 0000000000..4910fcae94 --- /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.