Skip to content

Commit

Permalink
Merge PR #2800 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by gurneyalex
  • Loading branch information
OCA-git-bot committed May 15, 2024
2 parents c6de13f + 80418dc commit e838e4f
Show file tree
Hide file tree
Showing 33 changed files with 5,677 additions and 0 deletions.
146 changes: 146 additions & 0 deletions fetchmail_attach_from_folder/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
=======================
Email gateway - folders
=======================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:c6afe0f3176202f575e0bfd827acadf557acced4a2dccdb2a55dafc0337abc87
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github
:target: https://github.com/OCA/server-tools/tree/16.0/fetchmail_attach_from_folder
:alt: OCA/server-tools
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/server-tools-16-0/server-tools-16-0-fetchmail_attach_from_folder
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/server-tools&target_branch=16.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

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.

**Table of contents**

.. contents::
:local:

Configuration
=============

In your fetchmail configuration, you'll find a new list field
``Folders to monitor``. Add your folders here in IMAP notation (usually
something like ``INBOX.your_folder_name.your_subfolder_name``), choose a
model to attach mails to and a matching algorithm to use.

Exact mailaddress
-----------------

Fill in a field to search for the email address in ``Field (model)``.
For partners, this would be ``email``. Also fill in the header field
from the email to look at in ``Field (email)``. If you want to match
incoming mails from your customers, this would be ``from``. You can also
list header fields, so to match partners receiving this email, you might
fill in ``to,cc,bcc``.

Domain of email addresses
-------------------------

Match the domain of the email address(es) found in ``Field (email)``.
This would attach a mail to ``test1@example.com`` to a record with
``Field (model)`` set to ``test2@example.com``. Given that this is a
fuzzy match, you probably want to check ``Use 1st match``, because
otherwise nothing happens if multiple possible matches are found.

Odoo standard
-------------

This is stricly speaking no matching algorithm, but calls the model's
standard action on new incoming mail, which is usually creating a new
record.

Usage
=====

A widespread configuration is to have a shared mailbox with several
folders, i.e. one where users drop mails they want to attach to
partners. Let this folder be called ``From partners``. Then create a
folder configuration for your server with path ``"INBOX.From partners"``
(note the quotes because of the space, this is server dependent). Choose
model ``Partners``, set ``Field (model)`` to ``email`` and
``Field (email)`` to ``from``. In ``Domain``, you could fill in
``[('customer', '=', True)]`` to be sure to only match customer records.

Now when your users drop mails into this folder, they will be fetched by
Odoo and attached to the partner in question. After some testing, you
might want to check ``Delete matches`` in your folder configuration so
that this folder doesn't grow indefinitely.

Another way to prevent having to process ever more messages from the
folder to read is to automatically move all processed messages to an
archive folder that can be specified.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-tools/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 <https://github.com/OCA/server-tools/issues/new?body=module:%20fetchmail_attach_from_folder%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Therp BV

Contributors
------------

- Holger Brunn hbrunn@therp.nl
- Ronald Portier ronald@therp.nl
- Alexandre Fayolle alexandre.fayolle@camptocamp.com

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

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.

.. |maintainer-NL66278| image:: https://github.com/NL66278.png?size=40px
:target: https://github.com/NL66278
:alt: NL66278

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-NL66278|

This module is part of the `OCA/server-tools <https://github.com/OCA/server-tools/tree/16.0/fetchmail_attach_from_folder>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
5 changes: 5 additions & 0 deletions fetchmail_attach_from_folder/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright - 2013-2018 Therp BV <https://therp.nl>.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import match_algorithm
from . import models
from . import wizard
20 changes: 20 additions & 0 deletions fetchmail_attach_from_folder/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright - 2013-2024 Therp BV <https://therp.nl>.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Email gateway - folders",
"summary": "Attach mails in an IMAP folder to existing objects",
"version": "16.0.1.1.0",
"author": "Therp BV,Odoo Community Association (OCA)",
"maintainers": ["NL66278"],
"website": "https://github.com/OCA/server-tools",
"license": "AGPL-3",
"category": "Tools",
"depends": ["mail"],
"data": [
"views/fetchmail_server.xml",
"wizard/attach_mail_manually.xml",
"security/ir.model.access.csv",
],
"installable": True,
"auto_install": False,
}

0 comments on commit e838e4f

Please sign in to comment.