|
| 1 | +.. image:: https://odoo-community.org/readme-banner-image |
| 2 | + :target: https://odoo-community.org/get-involved?utm_source=readme |
| 3 | + :alt: Odoo Community Association |
| 4 | + |
| 5 | +================================ |
| 6 | +Attachment MIME Type Restriction |
| 7 | +================================ |
| 8 | + |
| 9 | +.. |
| 10 | + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 11 | + !! This file is generated by oca-gen-addon-readme !! |
| 12 | + !! changes will be overwritten. !! |
| 13 | + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 14 | + !! source digest: sha256:97078c2e3e231052fbfc80c9c3181fd9223d0fa5d7e0c7b6b8b1b22ef6932c25 |
| 15 | + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 16 | +
|
| 17 | +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png |
| 18 | + :target: https://odoo-community.org/page/development-status |
| 19 | + :alt: Beta |
| 20 | +.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png |
| 21 | + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html |
| 22 | + :alt: License: AGPL-3 |
| 23 | +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fsocial-lightgray.png?logo=github |
| 24 | + :target: https://github.com/OCA/social/tree/15.0/attachment_mimetype_restriction |
| 25 | + :alt: OCA/social |
| 26 | +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png |
| 27 | + :target: https://translation.odoo-community.org/projects/social-15-0/social-15-0-attachment_mimetype_restriction |
| 28 | + :alt: Translate me on Weblate |
| 29 | +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png |
| 30 | + :target: https://runboat.odoo-community.org/builds?repo=OCA/social&target_branch=15.0 |
| 31 | + :alt: Try me on Runboat |
| 32 | + |
| 33 | +|badge1| |badge2| |badge3| |badge4| |badge5| |
| 34 | + |
| 35 | +This module restricts attachment uploads to an explicit allowlist of MIME types |
| 36 | +using content-based detection rather than filename extensions. Only configured |
| 37 | +MIME types are accepted; everything else is rejected. Leaving the allowlist |
| 38 | +empty disables the restriction and allows all file types. |
| 39 | + |
| 40 | +For incoming emails, the email itself is always accepted, but any attachments |
| 41 | +whose MIME type is not in the allowlist are stripped out before the message is |
| 42 | +saved. A security notice is then posted on the related record listing the |
| 43 | +removed files, so users can see what was filtered. |
| 44 | + |
| 45 | +**Table of contents** |
| 46 | + |
| 47 | +.. contents:: |
| 48 | + :local: |
| 49 | + |
| 50 | +Configuration |
| 51 | +============= |
| 52 | + |
| 53 | +**Global Configuration (Company-wide):** |
| 54 | + |
| 55 | +#. Go to Settings → General Settings |
| 56 | +#. In the "Allowed Attachment Types" field, enter comma-separated MIME types |
| 57 | +#. Example: ``image/png,application/pdf`` |
| 58 | +#. Leave empty to allow all file types |
| 59 | + |
| 60 | +**Per-Model Configuration (Optional):** |
| 61 | + |
| 62 | +#. Go to Settings → Technical → Database Structure → Models |
| 63 | +#. Select a model (e.g., "Contact" for res.partner) |
| 64 | +#. In the "Allowed Attachment Types" field, enter comma-separated MIME types |
| 65 | +#. Empty value = use global config; set value = override global config |
| 66 | + |
| 67 | +**Configuration Hierarchy:** |
| 68 | + |
| 69 | +Per-model settings override global settings when defined. |
| 70 | + |
| 71 | +Bug Tracker |
| 72 | +=========== |
| 73 | + |
| 74 | +Bugs are tracked on `GitHub Issues <https://github.com/OCA/social/issues>`_. |
| 75 | +In case of trouble, please check there if your issue has already been reported. |
| 76 | +If you spotted it first, help us to smash it by providing a detailed and welcomed |
| 77 | +`feedback <https://github.com/OCA/social/issues/new?body=module:%20attachment_mimetype_restriction%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. |
| 78 | + |
| 79 | +Do not contact contributors directly about support or help with technical issues. |
| 80 | + |
| 81 | +Credits |
| 82 | +======= |
| 83 | + |
| 84 | +Authors |
| 85 | +~~~~~~~ |
| 86 | + |
| 87 | +* Quartile |
| 88 | + |
| 89 | +Contributors |
| 90 | +~~~~~~~~~~~~ |
| 91 | + |
| 92 | +- Quartile \<<https://www.quartile.co>\> |
| 93 | + - Aung Ko Ko Lin |
| 94 | + |
| 95 | +Maintainers |
| 96 | +~~~~~~~~~~~ |
| 97 | + |
| 98 | +This module is maintained by the OCA. |
| 99 | + |
| 100 | +.. image:: https://odoo-community.org/logo.png |
| 101 | + :alt: Odoo Community Association |
| 102 | + :target: https://odoo-community.org |
| 103 | + |
| 104 | +OCA, or the Odoo Community Association, is a nonprofit organization whose |
| 105 | +mission is to support the collaborative development of Odoo features and |
| 106 | +promote its widespread use. |
| 107 | + |
| 108 | +.. |maintainer-yostashiro| image:: https://github.com/yostashiro.png?size=40px |
| 109 | + :target: https://github.com/yostashiro |
| 110 | + :alt: yostashiro |
| 111 | +.. |maintainer-aungkokolin1997| image:: https://github.com/aungkokolin1997.png?size=40px |
| 112 | + :target: https://github.com/aungkokolin1997 |
| 113 | + :alt: aungkokolin1997 |
| 114 | + |
| 115 | +Current `maintainers <https://odoo-community.org/page/maintainer-role>`__: |
| 116 | + |
| 117 | +|maintainer-yostashiro| |maintainer-aungkokolin1997| |
| 118 | + |
| 119 | +This module is part of the `OCA/social <https://github.com/OCA/social/tree/15.0/attachment_mimetype_restriction>`_ project on GitHub. |
| 120 | + |
| 121 | +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
0 commit comments