OdooWiki OCA HUB
Tools License: AGPL-3

This module allows to:

  • mark e-mails older than x days as read,
  • move those messages in a specific folder,
  • remove messages older than x days on IMAP servers, just before fetching them.

Since the main "mail" module does not mark unroutable e-mails as read, this means that if junk mail arrives in the catch-all address without any default route, fetching newer e-mails will happen after re-parsing those unroutable e-mails.

auto_awesome What this module does

AI-generated from the code · Odoo 18.0

Adds cleanup options to incoming mail servers so old emails are automatically marked as read, moved to a folder, or deleted before each fetch.

This module extends the incoming mail server configuration in Odoo (the fetchmail.server model) with three new settings that control what happens to old messages on the mail server itself.

On the incoming mail server form you get: - Expiration days: messages older than this number of days are marked as read. - Expiration folder: if filled in, those marked-as-read messages are also moved to this folder. - Deletion days: messages older than this number of days are permanently removed.

These actions run automatically every time Odoo fetches mail from an IMAP server, just before the new messages are retrieved. Only IMAP servers are affected; the cleanup steps are skipped for other server types. If a value is left at zero, that particular cleanup step is not performed.

Failures on individual messages are logged and counted, and the rest of the cleanup continues. The module also lets these three settings be supplied through server environment configuration, so they can be managed outside the database.

The new fields appear on the standard incoming mail server screen, after the SSL and password fields.

Models and fields (1)
  • fetchmail.server · extends an existing modelpurge_days (Deletion days), cleanup_days (Expiration days), cleanup_folder (Expiration folder)

Text generated by AI (DeepSeek) from reading the Odoo 18.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub

Availability by version

Reviewed: 2026-11-03
Confirmed (verified in repository and branch) Estimated (unverified) No information

Confirmation status: 4 confirmed, 5 with no information of 9 versions.

Sources · Odoo 16.0

Confirmed on 2026-11-03 in branch 16.0 of OCA/server-tools.

terminal Installation and usage

OCA documentation · Odoo 18.0

This module depends on mail_environment in order to add "expiration dates" per server.

Example of a configuration file (add those values to your server):

[incoming_mail.openerp_imap_mail1] cleanup_days = False # default value purge_days = False # default value cleanup_folder = NotParsed # optional parameter

No verified information in OCA: Installation, Usage.

info

Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.