Skip to main content
Odoo Community Association

Attachment MIME Type Restriction

Beta License: AGPL-3 OCA/social Translate me on Weblate Try me on Runboat

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):

  1. Go to Settings → General Settings

  2. In the “Allowed Attachment Types” field, enter comma-separated MIME types

  3. Example: image/png,application/pdf

  4. Leave empty to allow all file types

Per-Model Configuration (Optional):

  1. Go to Settings → Technical → Database Structure → Models

  2. Select a model (e.g., “Contact” for res.partner)

  3. In the “Allowed Attachment Types” field, enter comma-separated MIME types

  4. 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

Authors

  • Quartile

Contributors

Maintainers

This module is maintained by the OCA.

Odoo Community Association

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:

yostashiro aungkokolin1997

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)

Table of built distributions (wheels) for odoo-addon-attachment-mimetype-restriction 15.0.1.0.0.2
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

15.0.1.0.0.2 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page