Attachment MIME Type Restriction
This module restricts attachment uploads to an explicit allowlist of MIME types using content-based detection rather than filename extensions. Only configured MIME types are accepted; everything else is rejected. Leaving the allowlist empty disables the restriction and allows all file types.
For incoming emails, the email itself is always accepted, but any attachments whose MIME type is not in the allowlist are stripped out before the message is saved. A security notice is then posted on the related record listing the removed files, so users can see what was filtered.
Table of contents
Configuration
Global Configuration (Company-wide):
Go to Settings → General Settings
In the “Allowed Attachment Types” field, enter comma-separated MIME types
Example: image/png,application/pdf
Leave empty to allow all file types
Per-Model Configuration (Optional):
Go to Settings → Technical → Database Structure → Models
Select a model (e.g., “Contact” for res.partner)
In the “Allowed Attachment Types” field, enter comma-separated MIME types
Empty value = use global config; set value = override global config
Configuration Hierarchy:
Per-model settings override global settings when defined.
Bug Tracker
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed feedback.
Do not contact contributors directly about support or help with technical issues.
Credits
Contributors
Quartile <<https://www.quartile.co>> - Aung Ko Ko Lin
Maintainers
This module is maintained by the OCA.
OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.
Current maintainers:
This module is part of the OCA/social project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Release files for odoo-addon-attachment-mimetype-restriction 15.0.1.0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| odoo_addon_attachment_mimetype_restriction-15.0.1.0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Release files / odoo_addon_attachment_mimetype_restriction-15.0.1.0.0.2-py3-none-any.whl
| Download URL | odoo_addon_attachment_mimetype_restriction-15.0.1.0.0.2-py3-none-any.whl |
|---|---|
| Size | 32.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
acec0d4e784f6db19f41d77f5da1295814df4328018105029ae82ee298b89665
|
|
BLAKE2b-256 checksum How to use checksums |
702747564e326f40e2b5fb6ce8ecd6a7c7068f81f6c0fe6165412d70d0b6e82e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|