TIP: You can type at any time to perform a new search.
Email gateway - folders
fetchmail_attach_from_folder · OCA/server-tools
- Repository
- OCA/server-tools · module folder · Try on Runboat
- Module version
- 2.0.0
- Category
- Tools
- Folder size
- 0.3 MB
- License
- AGPL-3
- Application
- No
- Auto-installable
- No
- Website
- https://github.com/OCA/server-tools
- Last tracking update
- 2026-08-07 08:42:57
- Authors
- Odoo Community Association (OCA), Therp BV
- Maintainers
- Odoo Community Association (OCA), Therp BV
- Committers
- Ronald Portier, Weblate, OCA-git-bot, Tom, oca-ci, adrip-s73, AlexGarS73
- Odoo dependencies
- Python dependencies
- None
- System dependencies
- None
- Required by
- None
- 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 ID | Name | Model | Type | Status |
|---|---|---|---|---|
view_attach_mail_manually |
fetchmail.attach.mail.manually | fetchmail.attach.mail.manually | form | New |
view_email_server_form |
fetchmail.server.form | fetchmail.server | form | Inherits mail.view_email_server_form |
HTTP endpoints (0)
No HTTP endpoints found for this module.
Models touched (4)
New fields (3)
-
folder_idMany2one → fetchmail.server.foldercomodel_name='fetchmail.server.folder' -
mail_idsOne2many → fetchmail.attach.mail.manually.mailargs: 'fetchmail.attach.mail.manually.mail', 'wizard_id', 'Emails' -
nameChar
-
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)
-
bodyHtmlreadonly=True -
dateDatetimereadonly=True -
email_fromCharreadonly=True args: 'From' -
message_uidCharreadonly=True args: 'Message id' -
object_idReferenceargs: <expr> -
subjectCharreadonly=True -
wizard_idMany2one → fetchmail.attach.mail.manuallyreadonly=True args: 'fetchmail.attach.mail.manually'
No public methods.
New fields (5)
-
folder_idsOne2many → fetchmail.server.foldercomodel_name='fetchmail.server.folder'context={'active_test': False}inverse_name='server_id'string='Folders' -
folders_availableTextcompute='_compute_folders_available'string='Available folders' -
folders_onlyBooleanhelp='Enable this option to ignore the default IMAP inbox processing and retrieve emails only from the specified folders.'string='Process Only Specified Folders' -
object_idMany2onerequired=False -
server_typeSelectiondefault='imap'
-
fetch_mail(self, **kwargs) -
onchange_server_type(self)@api.onchange('server_type', 'is_ssl', 'object_id')
New fields (20)
-
action_idMany2one → ir.actions.servercomodel_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' -
activeBooleandefault=True -
archive_pathCharhelp='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_matchingBooleanhelp='Enable this option to delete emails after they are successfully processed and matched.'string='Delete Matched Emails' -
domainCharhelp='Define a search filter to narrow down objects for email matching.'string='Matching Domain' -
fetch_last_day_onlyBooleanhelp='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_onlyBooleanhelp='By default, all undeleted emails are retrieved. Enable this option to fetch only unread emails.' -
flag_nonmatchingBooleandefault=Truehelp='Enable this option to mark emails as important if they do not match any object in Odoo.'string='Flag Non-Matching Emails' -
mail_fieldCharhelp="Specify the field in the email used for matching. Typically, this is 'to', 'from' or 'reply_to'."string='Email Field' -
match_algorithmSelectionhelp='Select the algorithm used to determine which object an email matches.'required=Trueselection=[('odoo_standard', 'Odoo Standard'), ('email_domain', 'Domain of Email Address'), ('email_exact', 'Exact Email Address')]string='Matching Algorithm' -
match_firstBooleanhelp='If there are multiple matches, use the first one. If disabled, multiple matches will be considered as no match.'string='Use First Match' -
model_fieldCharhelp="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_idMany2one → ir.modelcomodel_name='ir.model'help='The model to attach emails to'ondelete='cascade'required=Truestring='Target Model' -
model_orderCharhelp="Specify the field(s) to order by when matching emails. This is mostly useful in conjunction with 'Use 1st Match'." -
msg_stateSelectiondefault='received'help='The state messages fetched from this folder should be assigned in Odoo'selection=[('sent', 'Sent'), ('received', 'Received')]string='Message state' -
pathCharhelp="Specify the IMAP folder path to retrieve emails from. Typically, this would be something like 'INBOX.myfolder'."required=Truestring='Fetch from Folder' -
seenSelectiondefault='on_fetch'required=Trueselection=[('on_fetch', 'Immediately on Fetch'), ('all', 'After Processing'), ('matching', 'When matching'), ('none', 'Never')]string='Mark email as seen' -
sequenceInteger -
server_idMany2one → fetchmail.serverargs: 'fetchmail.server' -
stateSelectioncopy=Falsedefault='draft'readonly=Truerequired=Truestring='Status' args: [('draft', 'Not Confirmed'), ('done', 'Confirmed')]
-
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.
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…