Email gateway - folders

fetchmail_attach_from_folder
REPOSITORY
REPOSITORYOCA/server-tools
GIT
GIThttps://github.com/OCA/server-tools.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-tools/tree/18.0/fetchmail_attach_from_folder
VERSION
VERSION 2.0.0
CATEGORY
CATEGORYTools
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Therp BV
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Therp BV
COMMITTERS
COMMITTERSRonald Portier, Weblate, OCA-git-bot, Tom, oca-ci, adrip-s73, AlexGarS73
WEBSITE
WEBSITEhttps://github.com/OCA/server-tools
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 19:30:07
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - mail
    - base
    - base_setup
    - web
    - bus
    - web_tour
    - html_editor
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION
Adds the possibility to attach emails from a certain IMAP folder to objects,
ie partners. Matching is done via several algorithms, ie email address, email
address's domain or the original Odoo algorithm.

This gives a simple possibility to archive emails in Odoo without a mail
client integration.

Code Analysis

Views touched (2)
XML IDNameModelTypeStatus
view_attach_mail_manually fetchmail.attach.mail.manually fetchmail.attach.mail.manually form New
view_email_server_form fetchmail.server.form fetchmail.server field Inherits mail.view_email_server_form
Models touched (4)

New fields (3)
  • folder_id Many2one → fetchmail.server.folder
    comodel_name='fetchmail.server.folder'
  • mail_ids One2many → fetchmail.attach.mail.manually.mail
    args: 'fetchmail.attach.mail.manually.mail', 'wizard_id', 'Emails'
  • name Char
Public methods (3)
  • attach_mails(self)
  • default_get(self, fields_list)
    @api.model
  • fields_view_get(self, view_id=None, view_type='form', toolbar=False, submenu=False)
    @api.model

New fields (7)
  • body Html
    readonly=True
  • date Datetime
    readonly=True
  • email_from Char
    readonly=True args: 'From'
  • message_uid Char
    readonly=True args: 'Message id'
  • object_id Reference
    args: <expr>
  • subject Char
    readonly=True
  • wizard_id Many2one → fetchmail.attach.mail.manually
    readonly=True args: 'fetchmail.attach.mail.manually'
Public methods (0)

No public methods.

New fields (5)
  • folder_ids One2many → fetchmail.server.folder
    comodel_name='fetchmail.server.folder' context={'active_test': False} inverse_name='server_id' string='Folders'
  • folders_available Text
    compute='_compute_folders_available' string='Available folders'
  • folders_only Boolean
    help='Enable this option to ignore the default IMAP inbox processing and retrieve emails only from the specified folders.' string='Process Only Specified Folders'
  • object_id Many2one
    required=False
  • server_type Selection
    default='imap'
Public methods (2)
  • fetch_mail(self, **kwargs)
  • onchange_server_type(self)
    @api.onchange('server_type', 'is_ssl', 'object_id')

New fields (20)
  • action_id Many2one → ir.actions.server
    comodel_name='ir.actions.server' help='Specify an optional custom server action to trigger for each incoming email. The action will run on the record that was created or updated by this email.' string='Server Action'
  • active Boolean
    default=True
  • archive_path Char
    help='Specify the folder where successfully retrieved emails will be moved after processing. If left empty, emails will remain in the original folder.' string='Archive Folder'
  • delete_matching Boolean
    help='Enable this option to delete emails after they are successfully processed and matched.' string='Delete Matched Emails'
  • domain Char
    help='Define a search filter to narrow down objects for email matching.' string='Matching Domain'
  • fetch_last_day_only Boolean
    help='By default, all emails in the folder are searched. Enable this option to only fetch emails received in the last 24 hours. This helps avoid reprocessing emails if they are not deleted after processing.' string='Fetch Last 24 Hours Only'
  • fetch_unseen_only Boolean
    help='By default, all undeleted emails are retrieved. Enable this option to fetch only unread emails.'
  • flag_nonmatching Boolean
    default=True help='Enable this option to mark emails as important if they do not match any object in Odoo.' string='Flag Non-Matching Emails'
  • mail_field Char
    help="Specify the field in the email used for matching. Typically, this is 'to', 'from' or 'reply_to'." string='Email Field'
  • match_algorithm Selection
    help='Select the algorithm used to determine which object an email matches.' required=True selection=[('odoo_standard', 'Odoo Standard'), ('email_domain', 'Domain of Email Address'), ('email_exact', 'Exact Email Address')] string='Matching Algorithm'
  • match_first Boolean
    help='If there are multiple matches, use the first one. If disabled, multiple matches will be considered as no match.' string='Use First Match'
  • model_field Char
    help="Specify the field in the model that will be used for email matching.\nExamples:\n- 'email' if your model is res.partner\n- 'partner_id.email' if matching sale orders."
  • model_id Many2one → ir.model
    comodel_name='ir.model' help='The model to attach emails to' ondelete='cascade' required=True string='Target Model'
  • model_order Char
    help="Specify the field(s) to order by when matching emails. This is mostly useful in conjunction with 'Use 1st Match'."
  • msg_state Selection
    default='received' help='The state messages fetched from this folder should be assigned in Odoo' selection=[('sent', 'Sent'), ('received', 'Received')] string='Message state'
  • path Char
    help="Specify the IMAP folder path to retrieve emails from. Typically, this would be something like 'INBOX.myfolder'." required=True string='Fetch from Folder'
  • seen Selection
    default='on_fetch' required=True selection=[('on_fetch', 'Immediately on Fetch'), ('all', 'After Processing'), ('matching', 'When matching'), ('none', 'Never')] string='Mark email as seen'
  • sequence Integer
  • server_id Many2one → fetchmail.server
    args: 'fetchmail.server'
  • state Selection
    copy=False default='draft' readonly=True required=True string='Status' args: [('draft', 'Not Confirmed'), ('done', 'Confirmed')]
Public methods (13)
  • apply_matching(self, connection, message_uid)
    Return id of object matched (which will be the thread_id).
  • attach_mail(self, match_object, message_dict)
    Attach mail to match_object.
  • button_attach_mail_manually(self)
  • button_confirm_folder(self)
  • check_imap_archive_folder(self, connection)
    If archive folder specified, check existance and create when needed.
  • fetch_mail(self)
    Retrieve all mails for IMAP folders. We will use a separate connection for each folder.
  • fetch_msg(self, connection, message_uid)
    Select a single message from a folder.
  • get_criteria(self)
  • get_message_uids(self, connection, criteria)
    Return imap ids of messages to process
  • retrieve_imap_folder(self, connection)
    Retrieve all mails for one IMAP folder.
  • run_server_action(self, matched_object_ids)
  • set_draft(self)
  • update_msg(self, connection, message_uid, matched=True, flagged=False)
    Update msg in imap folder depending on match and settings.
REPOSITORY
REPOSITORYOCA/server-tools
GIT
GIThttps://github.com/OCA/server-tools.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-tools/tree/17.0/fetchmail_attach_from_folder
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYTools
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Therp BV
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Therp BV
COMMITTERS
COMMITTERSWeblate, OCA-git-bot, oca-ci, Jose Zambudio
WEBSITE
WEBSITEhttps://github.com/OCA/server-tools
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 19:20:01
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - mail
    - base
    - base_setup
    - web
    - bus
    - web_tour
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION
Adds the possibility to attach emails from a certain IMAP folder to objects,
ie partners. Matching is done via several algorithms, ie email address, email
address's domain or the original Odoo algorithm.

This gives a simple possibility to archive emails in Odoo without a mail
client integration.

Code Analysis

Views touched (2)
XML IDNameModelTypeStatus
view_attach_mail_manually fetchmail.attach.mail.manually fetchmail.attach.mail.manually form New
view_email_server_form fetchmail.server.form fetchmail.server field Inherits mail.view_email_server_form
Models touched (4)

New fields (3)
  • folder_id Many2one → fetchmail.server.folder
    comodel_name='fetchmail.server.folder'
  • mail_ids One2many → fetchmail.attach.mail.manually.mail
    args: 'fetchmail.attach.mail.manually.mail', 'wizard_id', 'Emails'
  • name Char
Public methods (3)
  • attach_mails(self)
  • default_get(self, fields_list)
    @api.model
  • fields_view_get(self, view_id=None, view_type='form', toolbar=False, submenu=False)
    @api.model

New fields (7)
  • body Html
    readonly=True
  • date Datetime
    readonly=True
  • email_from Char
    readonly=True args: 'From'
  • msgid Char
    readonly=True args: 'Message id'
  • object_id Reference
    args: <expr>
  • subject Char
    readonly=True
  • wizard_id Many2one → fetchmail.attach.mail.manually
    readonly=True args: 'fetchmail.attach.mail.manually'
Public methods (0)

No public methods.

New fields (5)
  • folder_ids One2many → fetchmail.server.folder
    comodel_name='fetchmail.server.folder' context={'active_test': False} inverse_name='server_id' string='Folders'
  • folders_available Text
    compute='_compute_folders_available' string='Available folders'
  • folders_only Boolean
    help='Check this field to leave imap inbox alone and only retrieve mail from configured folders.' string='Only folders, not inbox'
  • object_id Many2one
    required=False
  • server_type Selection
    default='imap'
Public methods (2)
  • fetch_mail(self)
  • onchange_server_type(self)
    @api.onchange('server_type', 'is_ssl', 'object_id')

New fields (18)
  • action_id Many2one → ir.actions.server
    comodel_name='ir.actions.server' help='Optional custom server action to trigger for each incoming mail, on the record that was created or updated by this mail' name='Server action'
  • active Boolean
    default=True
  • archive_path Char
    help='The path where successfully retrieved messages will be stored.'
  • delete_matching Boolean
    help='Delete matched emails from server' args: 'Delete matches'
  • domain Char
    help='Fill in a search filter to narrow down objects to match'
  • fetch_unseen_only Boolean
    help='By default all undeleted emails are searched. Checking this field adds the unread condition.'
  • flag_nonmatching Boolean
    default=True help="Flag emails in the server that don't match any object in Odoo"
  • mail_field Char
    help="The field in the email used for matching. Typically this is 'to' or 'from'" args: 'Field (email)'
  • match_algorithm Selection
    help='The algorithm used to determine which object an email matches.' required=True selection=[('odoo_standard', 'Odoo standard'), ('email_domain', 'Domain of email address'), ('email_exact', 'Exact mailadress')]
  • match_first Boolean
    help='If there are multiple matches, use the first one. If not checked, multiple matches count as no match at all' args: 'Use 1st match'
  • model_field Char
    help="The field in your model that contains the field to match against.\nExamples:\n'email' if your model is res.partner, or 'partner_id.email' if you're matching sale orders" args: 'Field (model)'
  • model_id Many2one → ir.model
    comodel_name='ir.model' help='The model to attach emails to' ondelete='cascade' required=True
  • model_order Char
    help="Field(s) to order by, this mostly useful in conjunction with 'Use 1st match'" args: 'Order (model)'
  • msg_state Selection
    default='received' help='The state messages fetched from this folder should be assigned in Odoo' selection=[('sent', 'Sent'), ('received', 'Received')] string='Message state'
  • path Char
    help="The path to your mail folder. Typically would be something like 'INBOX.myfolder'" required=True
  • sequence Integer
  • server_id Many2one → fetchmail.server
    args: 'fetchmail.server'
  • state Selection
    copy=False default='draft' readonly=True required=True string='Status' args: [('draft', 'Not Confirmed'), ('done', 'Confirmed')]
Public methods (13)
  • apply_matching(self, connection, msgid)
    Return id of object matched (which will be the thread_id).
  • attach_mail(self, match_object, message_dict)
    Attach mail to match_object.
  • button_attach_mail_manually(self)
  • button_confirm_folder(self)
  • check_imap_archive_folder(self, connection)
    If archive folder specified, check existance and create when needed.
  • fetch_mail(self)
    Retrieve all mails for IMAP folders. We will use a separate connection for each folder.
  • fetch_msg(self, connection, msgid)
    Select a single message from a folder.
  • get_criteria(self)
  • get_msgids(self, connection, criteria)
    Return imap ids of messages to process
  • retrieve_imap_folder(self, connection)
    Retrieve all mails for one IMAP folder.
  • run_server_action(self, matched_object_ids)
  • set_draft(self)
  • update_msg(self, connection, msgid, matched=True, flagged=False)
    Update msg in imap folder depending on match and settings.
REPOSITORY
REPOSITORYOCA/server-tools
GIT
GIThttps://github.com/OCA/server-tools.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-tools/tree/16.0/fetchmail_attach_from_folder
VERSION
VERSION 2.0.0
CATEGORY
CATEGORYTools
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Therp BV
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Therp BV
COMMITTERS
COMMITTERSRonald Portier, Weblate, OCA-git-bot, Tom, oca-ci, Jose Zambudio
WEBSITE
WEBSITEhttps://github.com/OCA/server-tools
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 19:11:53
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - mail
    - base
    - base_setup
    - web
    - bus
    - web_tour
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION
Adds the possibility to attach emails from a certain IMAP folder to objects,
ie partners. Matching is done via several algorithms, ie email address, email
address's domain or the original Odoo algorithm.

This gives a simple possibility to archive emails in Odoo without a mail
client integration.

Code Analysis

Views touched (2)
XML IDNameModelTypeStatus
view_attach_mail_manually fetchmail.attach.mail.manually fetchmail.attach.mail.manually form New
view_email_server_form fetchmail.server.form fetchmail.server field Inherits mail.view_email_server_form
Models touched (4)

New fields (3)
  • folder_id Many2one → fetchmail.server.folder
    comodel_name='fetchmail.server.folder' readonly=True
  • mail_ids One2many → fetchmail.attach.mail.manually.mail
    args: 'fetchmail.attach.mail.manually.mail', 'wizard_id', 'Emails'
  • name Char
Public methods (3)
  • attach_mails(self)
  • default_get(self, fields_list)
    @api.model
  • fields_view_get(self, view_id=None, view_type='form', toolbar=False, submenu=False)
    @api.model

New fields (7)
  • body Html
    readonly=True
  • date Datetime
    readonly=True
  • email_from Char
    readonly=True args: 'From'
  • message_uid Char
    readonly=True args: 'Message id'
  • object_id Reference
    args: <expr>
  • subject Char
    readonly=True
  • wizard_id Many2one → fetchmail.attach.mail.manually
    readonly=True args: 'fetchmail.attach.mail.manually'
Public methods (0)

No public methods.

New fields (5)
  • folder_ids One2many → fetchmail.server.folder
    comodel_name='fetchmail.server.folder' context={'active_test': False} inverse_name='server_id' string='Folders'
  • folders_available Text
    compute='_compute_folders_available' readonly=True string='Available folders'
  • folders_only Boolean
    help='Enable this option to ignore the default IMAP inbox processing and retrieve emails only from the specified folders.' string='Process Only Specified Folders'
  • object_id Many2one
    required=False
  • server_type Selection
    default='imap'
Public methods (2)
  • fetch_mail(self)
  • onchange_server_type(self)
    @api.onchange('server_type', 'is_ssl', 'object_id')

New fields (20)
  • action_id Many2one → ir.actions.server
    comodel_name='ir.actions.server' help='Specify an optional custom server action to trigger for each incoming email. The action will run on the record that was created or updated by this email.' string='Server Action'
  • active Boolean
    default=True
  • archive_path Char
    help='Specify the folder where successfully retrieved emails will be moved after processing. If left empty, emails will remain in the original folder.' string='Archive Folder'
  • delete_matching Boolean
    help='Enable this option to delete emails after they are successfully processed and matched.' string='Delete Matched Emails'
  • domain Char
    help='Define a search filter to narrow down objects for email matching.' string='Matching Domain'
  • fetch_last_day_only Boolean
    help='By default, all emails in the folder are searched. Enable this option to only fetch emails received in the last 24 hours. This helps avoid reprocessing emails if they are not deleted after processing.' string='Fetch Last 24 Hours Only'
  • fetch_unseen_only Boolean
    help='By default, all undeleted emails are retrieved. Enable this option to fetch only unread emails.'
  • flag_nonmatching Boolean
    default=True help='Enable this option to mark emails as important if they do not match any object in Odoo.' string='Flag Non-Matching Emails'
  • mail_field Char
    help="Specify the field in the email used for matching. Typically, this is 'to', 'from' or 'reply_to'." string='Email Field'
  • match_algorithm Selection
    help='Select the algorithm used to determine which object an email matches.' required=True selection=[('odoo_standard', 'Odoo Standard'), ('email_domain', 'Domain of Email Address'), ('email_exact', 'Exact Email Address')] string='Matching Algorithm'
  • match_first Boolean
    help='If there are multiple matches, use the first one. If disabled, multiple matches will be considered as no match.' string='Use First Match'
  • model_field Char
    help="Specify the field in the model that will be used for email matching.\nExamples:\n- 'email' if your model is res.partner\n- 'partner_id.email' if matching sale orders."
  • model_id Many2one → ir.model
    comodel_name='ir.model' help='The model to attach emails to' ondelete='cascade' required=True string='Target Model'
  • model_order Char
    help="Specify the field(s) to order by when matching emails. This is mostly useful in conjunction with 'Use 1st Match'."
  • msg_state Selection
    default='received' help='The state messages fetched from this folder should be assigned in Odoo' selection=[('sent', 'Sent'), ('received', 'Received')] string='Message state'
  • path Char
    help="Specify the IMAP folder path to retrieve emails from. Typically, this would be something like 'INBOX.myfolder'." required=True string='Fetch from Folder'
  • seen Selection
    default='on_fetch' required=True selection=[('on_fetch', 'Immediately on Fetch'), ('all', 'After Processing'), ('matching', 'When matching'), ('none', 'Never')] string='Mark email as seen'
  • sequence Integer
  • server_id Many2one → fetchmail.server
    args: 'fetchmail.server'
  • state Selection
    copy=False default='draft' readonly=True required=True string='Status' args: [('draft', 'Not Confirmed'), ('done', 'Confirmed')]
Public methods (13)
  • apply_matching(self, connection, message_uid)
    Return id of object matched (which will be the thread_id).
  • attach_mail(self, match_object, message_dict)
    Attach mail to match_object.
  • button_attach_mail_manually(self)
  • button_confirm_folder(self)
  • check_imap_archive_folder(self, connection)
    If archive folder specified, check existance and create when needed.
  • fetch_mail(self)
    Retrieve all mails for IMAP folders. We will use a separate connection for each folder.
  • fetch_msg(self, connection, message_uid)
    Select a single message from a folder.
  • get_criteria(self)
  • get_message_uids(self, connection, criteria)
    Return imap ids of messages to process
  • retrieve_imap_folder(self, connection)
    Retrieve all mails for one IMAP folder.
  • run_server_action(self, matched_object_ids)
  • set_draft(self)
  • update_msg(self, connection, message_uid, matched=True, flagged=False)
    Update msg in imap folder depending on match and settings.
REPOSITORY
REPOSITORYOCA/server-tools
GIT
GIThttps://github.com/OCA/server-tools.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-tools/tree/10.0/fetchmail_attach_from_folder
VERSION
VERSION 1.1.0
CATEGORY
CATEGORYTools
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Therp BV
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Therp BV
COMMITTERS
COMMITTERSHolger Brunn, Pedro M. Baeza, oca-travis, Weblate, OCA-git-bot
WEBSITE
WEBSITEhttp://www.therp.nl
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:19:59
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - fetchmail
    - mail
    - base
    - base_setup
    - web_kanban
    - web
    - bus
    - web_tour
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (2)
XML IDNameModelTypeStatus
view_attach_mail_manually fetchmail.attach.mail.manually fetchmail.attach.mail.manually form New
view_email_server_form fetchmail.server.form fetchmail.server field Inherits fetchmail.view_email_server_form
Models touched (4)

New fields (3)
  • folder_id Many2one → fetchmail.server.folder
    readonly=True args: 'fetchmail.server.folder', 'Folder'
  • mail_ids One2many → fetchmail.attach.mail.manually.mail
    args: 'fetchmail.attach.mail.manually.mail', 'wizard_id', 'Emails'
  • name Char
Public methods (3)
  • attach_mails(self)
    @api.multi
  • default_get(self, fields_list)
    @api.model
  • fields_view_get(self, view_id=None, view_type='form', toolbar=False, submenu=False)
    @api.model

New fields (7)
  • body Html
    readonly=True args: 'Body'
  • date Datetime
    readonly=True args: 'Date'
  • email_from Char
    readonly=True args: 'From'
  • msgid Char
    readonly=True args: 'Message id'
  • object_id Reference
    string='Object' args: <expr>
  • subject Char
    readonly=True args: 'Subject'
  • wizard_id Many2one → fetchmail.attach.mail.manually
    readonly=True args: 'fetchmail.attach.mail.manually'
Public methods (0)

No public methods.

New fields (5)
  • folder_ids One2many → fetchmail.server.folder
    comodel_name='fetchmail.server.folder' context={'active_test': False} inverse_name='server_id' string='Folders'
  • folders_available Text
    compute='_compute_folders_available' readonly=True string='Available folders'
  • folders_only Boolean
    help='Check this field to leave imap inbox alone and only retrieve mail from configured folders.' string='Only folders, not inbox'
  • object_id Many2one
    required=False
  • type Selection
    default='imap'
Public methods (3)
  • fetch_mail(self)
    @api.multi
  • fields_view_get(self, view_id=None, view_type='form', toolbar=False, submenu=False)
    Set modifiers for form fields in folder_ids depending on algorithm. A field will be readonly and/or required if this is specified in the algorithm.
  • onchange_server_type(self)
    @api.onchange('type', 'is_ssl', 'object_id')

New fields (15)
  • active Boolean
    default=True args: 'Active'
  • delete_matching Boolean
    help='Delete matched emails from server' args: 'Delete matches'
  • domain Char
    help='Fill in a search filter to narrow down objects to match' args: 'Domain'
  • flag_nonmatching Boolean
    default=True help="Flag emails in the server that don't match any object in Odoo" args: 'Flag nonmatching'
  • mail_field Char
    help="The field in the email used for matching. Typically this is 'to' or 'from'" args: 'Field (email)'
  • match_algorithm Selection
    help='The algorithm used to determine which object an email matches.' required=True args: _get_match_algorithms_sel, 'Match algorithm'
  • match_first Boolean
    help='If there are multiple matches, use the first one. If not checked, multiple matches count as no match at all' args: 'Use 1st match'
  • model_field Char
    help="The field in your model that contains the field to match against.\nExamples:\n'email' if your model is res.partner, or 'partner_id.email' if you're matching sale orders" args: 'Field (model)'
  • model_id Many2one → ir.model
    help='The model to attach emails to' required=True args: 'ir.model', 'Model'
  • model_order Char
    help="Field(s) to order by, this mostly useful in conjunction with 'Use 1st match'" args: 'Order (model)'
  • msg_state Selection
    default='received' help='The state messages fetched from this folder should be assigned in Odoo' selection=[('sent', 'Sent'), ('received', 'Received')] string='Message state'
  • path Char
    help="The path to your mail folder. Typically would be something like 'INBOX.myfolder'" required=True args: 'Path'
  • sequence Integer
    args: 'Sequence'
  • server_id Many2one → fetchmail.server
    args: 'fetchmail.server', 'Server'
  • state Selection
    copy=False default='draft' readonly=True required=True string='Status' args: [('draft', 'Not Confirmed'), ('done', 'Confirmed')]
Public methods (11)
  • apply_matching(self, connection, msgid, match_algorithm)
    @api.multi
    Return ids of objects matched
  • attach_mail(self, match_object, mail_message)
    @api.multi
    Attach mail to match_object.
  • button_attach_mail_manually(self)
    @api.multi
  • button_confirm_folder(self)
    @api.multi
  • fetch_mail(self)
    @api.multi
    Retrieve all mails for IMAP folders. We will use a separate connection for each folder.
  • fetch_msg(self, connection, msgid)
    @api.multi
    Select a single message from a folder.
  • get_algorithm(self)
    @api.multi
  • get_msgids(self, connection, criteria)
    @api.multi
    Return imap ids of messages to process
  • retrieve_imap_folder(self, connection)
    @api.multi
    Retrieve all mails for one IMAP folder.
  • set_draft(self)
    @api.multi
  • update_msg(self, connection, msgid, matched=True, flagged=False)
    @api.multi
    Update msg in imap folder depending on match and settings.
REPOSITORY
REPOSITORYOCA/server-tools
GIT
GIThttps://github.com/OCA/server-tools.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-tools/tree/9.0/fetchmail_attach_from_folder
VERSION
VERSION 1.0.1
CATEGORY
CATEGORYTools
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Therp BV
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Therp BV
COMMITTERS
COMMITTERSAlexandre Fayolle, Pedro M. Baeza
WEBSITE
WEBSITEhttp://www.therp.nl
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:15:22
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - fetchmail
    - mail
    - base
    - base_setup
    - web_kanban
    - web
    - bus
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (2)
XML IDNameModelTypeStatus
view_attach_mail_manually fetchmail.attach.mail.manually fetchmail.attach.mail.manually form New
view_email_server_form fetchmail.server.form fetchmail.server data Inherits fetchmail.view_email_server_form
Models touched (4)

New fields (2)
  • folder_id Many2one → fetchmail.server.folder
    readonly=True args: 'fetchmail.server.folder', 'Folder'
  • mail_ids One2many → fetchmail.attach.mail.manually.mail
    args: 'fetchmail.attach.mail.manually.mail', 'wizard_id', 'Emails'
Public methods (3)
  • attach_mails(self, cr, uid, ids, context=None)
  • default_get(self, cr, uid, fields_list, context=None)
  • fields_view_get(self, cr, user, view_id=None, view_type='form', context=None, toolbar=False, submenu=False)

New fields (5)
  • date Datetime
    readonly=True args: 'Date'
  • msgid Char
    readonly=True args: 'Message id'
  • object_id Reference
    string='Object' args: <expr>
  • subject Char
    readonly=True args: 'Subject'
  • wizard_id Many2one → fetchmail.attach.mail.manually
    readonly=True args: 'fetchmail.attach.mail.manually'
Public methods (0)

No public methods.

New fields (2)
  • folder_ids One2many → fetchmail.server.folder
    context={'active_test': False} args: 'fetchmail.server.folder', 'server_id', 'Folders'
  • object_id Many2one
    required=False
Public methods (8)
  • apply_matching(self, connection, folder, msgid, match_algorithm)
    @api.multi
    Return ids of objects matched
  • attach_mail(self, connection, object_id, folder, mail_message, msgid)
    @api.multi
    Return ids of messages created
  • button_confirm_login(self, cr, uid, ids, context=None)
  • fetch_mail(self, cr, uid, ids, context=None)
  • fields_view_get(self, cr, user, view_id=None, view_type='form', context=None, toolbar=False, submenu=False)
  • get_msgids(self, connection)
    @api.multi
    Return imap ids of messages to process
  • handle_folder(self, connection, folder)
    @api.multi
    Return ids of objects matched
  • onchange_server_type(self, cr, uid, ids, server_type=False, ssl=False, object_id=False)

New fields (14)
  • active Boolean
    args: 'Active'
  • delete_matching Boolean
    help='Delete matched emails from server' args: 'Delete matches'
  • domain Char
    help='Fill in a search filter to narrow down objects to match' args: 'Domain'
  • flag_nonmatching Boolean
    help="Flag emails in the server that don't match any object in Odoo" args: 'Flag nonmatching'
  • mail_field Char
    help="The field in the email used for matching. Typically this is 'to' or 'from'" args: 'Field (email)'
  • match_algorithm Selection
    help='The algorithm used to determine which object an email matches.' required=True args: _get_match_algorithms_sel, 'Match algorithm'
  • match_first Boolean
    help='If there are multiple matches, use the first one. If not checked, multiple matches count as no match at all' args: 'Use 1st match'
  • model_field Char
    help="The field in your model that contains the field to match against.\nExamples:\n'email' if your model is res.partner, or 'partner_id.email' if you're matching sale orders" args: 'Field (model)'
  • model_id Many2one → ir.model
    help='The model to attach emails to' required=True args: 'ir.model', 'Model'
  • model_order Char
    help="Field(s) to order by, this mostly useful in conjunction with 'Use 1st match'" args: 'Order (model)'
  • msg_state Selection
    help='The state messages fetched from this folder should be assigned in Odoo' args: [('sent', 'Sent'), ('received', 'Received')], 'Message state'
  • path Char
    help="The path to your mail folder. Typically would be something like 'INBOX.myfolder'" required=True args: 'Path'
  • sequence Integer
    args: 'Sequence'
  • server_id Many2one → fetchmail.server
    args: 'fetchmail.server', 'Server'
Public methods (2)
  • button_attach_mail_manually(self)
    @api.multi
  • get_algorithm(self)
    @api.multi
REPOSITORY
REPOSITORYOCA/server-tools
GIT
GIThttps://github.com/OCA/server-tools.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-tools/tree/8.0/fetchmail_attach_from_folder
VERSION
VERSION 1.0.1
CATEGORY
CATEGORYTools
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Therp BV
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Therp BV
COMMITTERS
COMMITTERSStéphane Bidoul, Yannick Vaucher, Guewen Baconnier, Alexandre Fayolle, Stefan Rijnhart, Holger Brunn, Pedro M. Baeza, Stéphane Bidoul (ACSONE), OCA Transbot, oca-travis, Weblate
WEBSITE
WEBSITEhttp://www.therp.nl
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:11:25
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - fetchmail
    - mail
    - base
    - base_setup
    - web_kanban
    - web
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (2)
XML IDNameModelTypeStatus
view_attach_mail_manually fetchmail.attach.mail.manually fetchmail.attach.mail.manually form New
view_email_server_form fetchmail.server.form fetchmail.server data Inherits fetchmail.view_email_server_form
Models touched (3)

New fields (2)
  • folder_id Many2one → fetchmail.server.folder
    readonly=True args: 'fetchmail.server.folder', 'Folder'
  • mail_ids One2many → fetchmail.attach.mail.manually.mail
    args: 'fetchmail.attach.mail.manually.mail', 'wizard_id', 'Emails'
Public methods (3)
  • attach_mails(self, cr, uid, ids, context=None)
  • default_get(self, cr, uid, fields_list, context=None)
  • fields_view_get(self, cr, user, view_id=None, view_type='form', context=None, toolbar=False, submenu=False)

New fields (5)
  • date Datetime
    readonly=True args: 'Date'
  • msgid Char
    readonly=True args: 'Message id'
  • object_id Reference
    string='Object' args: <expr>
  • subject Char
    readonly=True args: 'Subject'
  • wizard_id Many2one → fetchmail.attach.mail.manually
    readonly=True args: 'fetchmail.attach.mail.manually'
Public methods (0)

No public methods.

New fields (15)
  • active Boolean
    args: 'Active'
  • context Char
    help='Context that is passed during mail processing. Can be used to set default values.' args: 'Context'
  • delete_matching Boolean
    help='Delete matched emails from server' args: 'Delete matches'
  • domain Char
    help='Fill in a search filter to narrow down objects to match' args: 'Domain'
  • flag_nonmatching Boolean
    help="Flag emails in the server that don't match any object in Odoo" args: 'Flag nonmatching'
  • mail_field Char
    help="The field in the email used for matching. Typically this is 'to' or 'from'" args: 'Field (email)'
  • match_algorithm Selection
    help='The algorithm used to determine which object an email matches.' required=True args: _get_match_algorithms_sel, 'Match algorithm'
  • match_first Boolean
    help='If there are multiple matches, use the first one. If not checked, multiple matches count as no match at all' args: 'Use 1st match'
  • model_field Char
    help="The field in your model that contains the field to match against.\nExamples:\n'email' if your model is res.partner, or 'partner_id.email' if you're matching sale orders" args: 'Field (model)'
  • model_id Many2one → ir.model
    help='The model to attach emails to' required=True args: 'ir.model', 'Model'
  • model_order Char
    help="Field(s) to order by, this mostly useful in conjunction with 'Use 1st match'" args: 'Order (model)'
  • msg_state Selection
    help='The state messages fetched from this folder should be assigned in Odoo' args: [('sent', 'Sent'), ('received', 'Received')], 'Message state'
  • path Char
    help="The path to your mail folder. Typically would be something like 'INBOX.myfolder'" required=True args: 'Path'
  • sequence Integer
    args: 'Sequence'
  • server_id Many2one → fetchmail.server
    args: 'fetchmail.server', 'Server'
Public methods (2)
  • button_attach_mail_manually(self)
    @api.multi
  • get_algorithm(self)
    @api.multi
REPOSITORY
REPOSITORYOCA/server-tools
GIT
GIThttps://github.com/OCA/server-tools.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-tools/tree/7.0/fetchmail_attach_from_folder
VERSION
VERSION 1.0.1
CATEGORY
CATEGORYTools
LICENSE
LICENSELGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Therp BV
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Therp BV
COMMITTERS
COMMITTERSAlexandre Fayolle, Sandy Carter, Holger Brunn, Nicolas Bessi, Sylvain LE GAL
WEBSITE
WEBSITEhttp://www.therp.nl
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:07:15
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - fetchmail
    - mail
    - base
    - base_setup
    - web_kanban
    - web
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION
Adds the possibility to attach emails from a certain IMAP folder to objects,
ie partners. Matching is done via several algorithms, ie email address.

This gives a simple possibility to archive emails in OpenERP without a mail
client integration.
    

Code Analysis

Views touched (2)
XML IDNameModelTypeStatus
view_attach_mail_manually fetchmail.attach.mail.manually fetchmail.attach.mail.manually form New
view_email_server_form fetchmail.server.form fetchmail.server data Inherits fetchmail.view_email_server_form
Models touched (4)

New fields (0)

No new fields.

Public methods (2)
  • attach_mails(self, cr, uid, ids, context=None)
  • default_get(self, cr, uid, fields_list, context=None)

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (8)
  • apply_matching(self, cr, uid, ids, connection, folder, msgid, match_algorithm, context=None)
    Return ids of objects matched
  • attach_mail(self, cr, uid, ids, connection, object_id, folder, mail_message, msgid, context=None)
    Return ids of messages created
  • button_confirm_login(self, cr, uid, ids, context=None)
  • fetch_mail(self, cr, uid, ids, context=None)
  • fields_view_get(self, cr, user, view_id=None, view_type='form', context=None, toolbar=False, submenu=False)
  • get_msgids(self, cr, uid, ids, connection, context=None)
    Return imap ids of messages to process
  • handle_folder(self, cr, uid, ids, connection, folder, context=None)
    Return ids of objects matched
  • onchange_server_type(self, cr, uid, ids, server_type=False, ssl=False, object_id=False)

New fields (0)

No new fields.

Public methods (2)
  • button_attach_mail_manually(self, cr, uid, ids, context=None)
  • get_algorithm(self, cr, uid, ids, context=None)
REPOSITORY
REPOSITORYOCA/server-tools
GIT
GIThttps://github.com/OCA/server-tools.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-tools/tree/6.1/fetchmail_attach_from_folder
VERSION
VERSION 1.0.1
CATEGORY
CATEGORYTools
LICENSE
LICENSELGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Therp BV
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Therp BV
COMMITTERS
COMMITTERSYannick Vaucher, Alexandre Fayolle, Ronald Portier, Holger Brunn
WEBSITE
WEBSITEhttp://www.therp.nl
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:04:06
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - fetchmail
    - base
    - mail
    - base_tools
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION
    Adds the possibility to attach emails from a certain IMAP folder to
    objects, ie partners. Matching is done via several algorithms, ie email
    address.

    This gives a simple possibility to archive emails in OpenERP without a mail
    client integration.
    

Code Analysis

Views touched (2)
XML IDNameModelTypeStatus
view_attach_mail_manually fetchmail.attach.mail.manually fetchmail.attach.mail.manually form New
view_email_server_form fetchmail.server.form fetchmail.server data Inherits fetchmail.view_email_server_form
Models touched (4)

New fields (0)

No new fields.

Public methods (2)
  • attach_mails(self, cr, uid, ids, context=None)
  • default_get(self, cr, uid, fields_list, context=None)

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (8)
  • apply_matching(self, cr, uid, ids, connection, folder, msgid, match_algorithm, context=None)
    Return ids of objects matched
  • attach_mail(self, cr, uid, ids, connection, object_id, folder, mail_message, msgid, context=None)
    Return ids of messages created
  • button_confirm_login(self, cr, uid, ids, context=None)
  • fetch_mail(self, cr, uid, ids, context=None)
  • fields_view_get(self, cr, user, view_id=None, view_type='form', context=None, toolbar=False, submenu=False)
  • get_msgids(self, cr, uid, ids, connection, context=None)
    Return imap ids of messages to process
  • handle_folder(self, cr, uid, ids, connection, folder, context=None)
    Return ids of objects matched
  • onchange_server_type(self, cr, uid, ids, server_type=False, ssl=False, object_id=False)

New fields (0)

No new fields.

Public methods (2)
  • button_attach_mail_manually(self, cr, uid, ids, context=None)
  • get_algorithm(self, cr, uid, ids, context=None)
STATUS
STATUSOpen migration PR - not merged yet for this version
REPOSITORY
REPOSITORYOCA/server-tools
PULL REQUEST
PULL REQUEST[19.0][MIG] fetchmail_attach_from_folder (#3567)