On 9/30/20 9:25 AM, Mohsen Masoudfar wrote:
Hi,
I am trying to find a way for content filtering to remove executables from the emails sent to the list. I found some hints under: https://mailman.readthedocs.io/en/stable/build/lib/mailman/handlers/docs/fil...
but still not clear how to do it for all type of excecutables.
There are four list settings that affect this. They are pass_types, pass_extensions, filter_types and filter_extensions. the pass_* settings specify message parts the list will accept while the filter_* settings specify message parts the list won't accept. The page at <https://mailman.readthedocs.io/en/stable/src/mailman/handlers/docs/filtering...> only discusses filter_types and needs updating for the others.
Filtering by extension only works on message parts that have an associated file name. Thus, while you can add things like 'exe', 'bat', 'cmd', 'com', 'pif', 'scr', 'vbs' and 'cpl' to filter_extensions, it won't be completely effective.
A better approach is to use MIME types[1] and only allow those you want. For a discussion list, a reasonable set is what this list uses:
multipart message/rfc822 text application/pgp-signature
This will accept any multipart and message/rfc822 parts for further analysis and ultimately accept only text/* and application/pgp-signature elemental parts. If you want to accept images and pdfs, you can add
image application/pdf
See <https://www.iana.org/assignments/media-types/media-types.xhtml> for a list of all registered MIME types. Note that these are all of the form
main_type/sub_type
and putting just
main_type
in *_types passes or filters all subtypes for that maintype.
[1] You can use both, e.g. filter_extensions to remove those you don't want and pass_types to accept the MIME types you do want.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan