Skip to main content

Restrict attachment uploads to an allowlist of MIME types

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file odoo_addon_attachment_mimetype_restriction-15.0.1.0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for odoo_addon_attachment_mimetype_restriction-15.0.1.0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 acec0d4e784f6db19f41d77f5da1295814df4328018105029ae82ee298b89665
MD5 93f9fab7927a088c4079ee27dd10db10
BLAKE2b-256 702747564e326f40e2b5fb6ce8ecd6a7c7068f81f6c0fe6165412d70d0b6e82e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page