diff --git a/fetchmail_incoming_log/README.rst b/fetchmail_incoming_log/README.rst new file mode 100644 index 000000000..640d300af --- /dev/null +++ b/fetchmail_incoming_log/README.rst @@ -0,0 +1,81 @@ +====================== +Fetchmail Incoming Log +====================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/14.0/fetchmail_incoming_log + :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-14-0/server-tools-14-0-fetchmail_incoming_log + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/149/14.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows to log into the server the basic information of emails +that have been fetched from the mail server, before they start to be processed. + +This allows for a better analysis of situations where emails are found to be +missing in Odoo. Can help to better resolve questions of the type 'Was it that +the email was never fetched, or a problem found when it was processed by +Odoo?'. + +**Table of contents** + +.. contents:: + :local: + +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 smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* ForgeFlow + +Contributors +~~~~~~~~~~~~ + +* Jordi Ballester +* Héctor Villarreal +* Helly kapatel + +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. + +This module is part of the `OCA/server-tools `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/fetchmail_incoming_log/__init__.py b/fetchmail_incoming_log/__init__.py new file mode 100644 index 000000000..0650744f6 --- /dev/null +++ b/fetchmail_incoming_log/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/fetchmail_incoming_log/__manifest__.py b/fetchmail_incoming_log/__manifest__.py new file mode 100644 index 000000000..431870b1d --- /dev/null +++ b/fetchmail_incoming_log/__manifest__.py @@ -0,0 +1,14 @@ +# Copyright 2017-20 ForgeFlow S.L. (www.forgeflow.com) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +{ + "name": "Fetchmail Incoming Log", + "version": "15.0.1.0.0", + "category": "Tools", + "summary": "Log all messages received, before they start to be processed.", + "author": "ForgeFlow, Odoo Community Association (OCA)", + "license": "AGPL-3", + "website": "https://github.com/OCA/server-tools", + "depends": ["mail", "test_mail"], + "installable": True, +} diff --git a/fetchmail_incoming_log/i18n/ca.po b/fetchmail_incoming_log/i18n/ca.po new file mode 100644 index 000000000..e66889471 --- /dev/null +++ b/fetchmail_incoming_log/i18n/ca.po @@ -0,0 +1,39 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_log_messages_to_process +# +# Translators: +# Marc Tormo i Bochaca , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-10-21 22:54+0000\n" +"PO-Revision-Date: 2017-10-21 22:54+0000\n" +"Last-Translator: Marc Tormo i Bochaca , 2017\n" +"Language-Team: Catalan (https://www.transifex.com/oca/teams/23907/ca/)\n" +"Language: ca\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: fetchmail_incoming_log +#: model:ir.model.fields,field_description:fetchmail_incoming_log.field_mail_thread__display_name +msgid "Display Name" +msgstr "" + +#. module: fetchmail_incoming_log +#: model:ir.model,name:fetchmail_incoming_log.model_mail_thread +msgid "Email Thread" +msgstr "Tema del Correu electrònic" + +#. module: fetchmail_incoming_log +#: model:ir.model.fields,field_description:fetchmail_incoming_log.field_mail_thread__id +msgid "ID" +msgstr "" + +#. module: fetchmail_incoming_log +#: model:ir.model.fields,field_description:fetchmail_incoming_log.field_mail_thread____last_update +msgid "Last Modified on" +msgstr "" diff --git a/fetchmail_incoming_log/i18n/de.po b/fetchmail_incoming_log/i18n/de.po new file mode 100644 index 000000000..0bc72bd15 --- /dev/null +++ b/fetchmail_incoming_log/i18n/de.po @@ -0,0 +1,39 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_log_messages_to_process +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-10-21 22:54+0000\n" +"PO-Revision-Date: 2017-10-21 22:54+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: fetchmail_incoming_log +#: model:ir.model.fields,field_description:fetchmail_incoming_log.field_mail_thread__display_name +msgid "Display Name" +msgstr "" + +#. module: fetchmail_incoming_log +#: model:ir.model,name:fetchmail_incoming_log.model_mail_thread +msgid "Email Thread" +msgstr "Email-Thread" + +#. module: fetchmail_incoming_log +#: model:ir.model.fields,field_description:fetchmail_incoming_log.field_mail_thread__id +msgid "ID" +msgstr "" + +#. module: fetchmail_incoming_log +#: model:ir.model.fields,field_description:fetchmail_incoming_log.field_mail_thread____last_update +msgid "Last Modified on" +msgstr "" diff --git a/fetchmail_incoming_log/i18n/es.po b/fetchmail_incoming_log/i18n/es.po new file mode 100644 index 000000000..78def771f --- /dev/null +++ b/fetchmail_incoming_log/i18n/es.po @@ -0,0 +1,39 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_log_messages_to_process +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-10-21 22:54+0000\n" +"PO-Revision-Date: 2017-10-21 22:54+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: fetchmail_incoming_log +#: model:ir.model.fields,field_description:fetchmail_incoming_log.field_mail_thread__display_name +msgid "Display Name" +msgstr "" + +#. module: fetchmail_incoming_log +#: model:ir.model,name:fetchmail_incoming_log.model_mail_thread +msgid "Email Thread" +msgstr "Hilo correo electrónico" + +#. module: fetchmail_incoming_log +#: model:ir.model.fields,field_description:fetchmail_incoming_log.field_mail_thread__id +msgid "ID" +msgstr "" + +#. module: fetchmail_incoming_log +#: model:ir.model.fields,field_description:fetchmail_incoming_log.field_mail_thread____last_update +msgid "Last Modified on" +msgstr "" diff --git a/fetchmail_incoming_log/i18n/fetchmail_incoming_log.pot b/fetchmail_incoming_log/i18n/fetchmail_incoming_log.pot new file mode 100644 index 000000000..ac761fe4c --- /dev/null +++ b/fetchmail_incoming_log/i18n/fetchmail_incoming_log.pot @@ -0,0 +1,34 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fetchmail_incoming_log +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: fetchmail_incoming_log +#: model:ir.model.fields,field_description:fetchmail_incoming_log.field_mail_thread__display_name +msgid "Display Name" +msgstr "" + +#. module: fetchmail_incoming_log +#: model:ir.model,name:fetchmail_incoming_log.model_mail_thread +msgid "Email Thread" +msgstr "" + +#. module: fetchmail_incoming_log +#: model:ir.model.fields,field_description:fetchmail_incoming_log.field_mail_thread__id +msgid "ID" +msgstr "" + +#. module: fetchmail_incoming_log +#: model:ir.model.fields,field_description:fetchmail_incoming_log.field_mail_thread____last_update +msgid "Last Modified on" +msgstr "" diff --git a/fetchmail_incoming_log/i18n/fr.po b/fetchmail_incoming_log/i18n/fr.po new file mode 100644 index 000000000..68b9cc6ce --- /dev/null +++ b/fetchmail_incoming_log/i18n/fr.po @@ -0,0 +1,39 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_log_messages_to_process +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-10-21 22:54+0000\n" +"PO-Revision-Date: 2017-10-21 22:54+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: fetchmail_incoming_log +#: model:ir.model.fields,field_description:fetchmail_incoming_log.field_mail_thread__display_name +msgid "Display Name" +msgstr "" + +#. module: fetchmail_incoming_log +#: model:ir.model,name:fetchmail_incoming_log.model_mail_thread +msgid "Email Thread" +msgstr "Discussion de courriel" + +#. module: fetchmail_incoming_log +#: model:ir.model.fields,field_description:fetchmail_incoming_log.field_mail_thread__id +msgid "ID" +msgstr "" + +#. module: fetchmail_incoming_log +#: model:ir.model.fields,field_description:fetchmail_incoming_log.field_mail_thread____last_update +msgid "Last Modified on" +msgstr "" diff --git a/fetchmail_incoming_log/i18n/it.po b/fetchmail_incoming_log/i18n/it.po new file mode 100644 index 000000000..3ecc8583c --- /dev/null +++ b/fetchmail_incoming_log/i18n/it.po @@ -0,0 +1,39 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_log_messages_to_process +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-10-21 22:54+0000\n" +"PO-Revision-Date: 2017-10-21 22:54+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: fetchmail_incoming_log +#: model:ir.model.fields,field_description:fetchmail_incoming_log.field_mail_thread__display_name +msgid "Display Name" +msgstr "" + +#. module: fetchmail_incoming_log +#: model:ir.model,name:fetchmail_incoming_log.model_mail_thread +msgid "Email Thread" +msgstr "Discussione Email" + +#. module: fetchmail_incoming_log +#: model:ir.model.fields,field_description:fetchmail_incoming_log.field_mail_thread__id +msgid "ID" +msgstr "" + +#. module: fetchmail_incoming_log +#: model:ir.model.fields,field_description:fetchmail_incoming_log.field_mail_thread____last_update +msgid "Last Modified on" +msgstr "" diff --git a/fetchmail_incoming_log/i18n/pt_BR.po b/fetchmail_incoming_log/i18n/pt_BR.po new file mode 100644 index 000000000..1bf257c28 --- /dev/null +++ b/fetchmail_incoming_log/i18n/pt_BR.po @@ -0,0 +1,40 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_log_messages_to_process +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-10-21 22:54+0000\n" +"PO-Revision-Date: 2017-10-21 22:54+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/" +"teams/23907/pt_BR/)\n" +"Language: pt_BR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: fetchmail_incoming_log +#: model:ir.model.fields,field_description:fetchmail_incoming_log.field_mail_thread__display_name +msgid "Display Name" +msgstr "" + +#. module: fetchmail_incoming_log +#: model:ir.model,name:fetchmail_incoming_log.model_mail_thread +msgid "Email Thread" +msgstr "Processo Email" + +#. module: fetchmail_incoming_log +#: model:ir.model.fields,field_description:fetchmail_incoming_log.field_mail_thread__id +msgid "ID" +msgstr "" + +#. module: fetchmail_incoming_log +#: model:ir.model.fields,field_description:fetchmail_incoming_log.field_mail_thread____last_update +msgid "Last Modified on" +msgstr "" diff --git a/fetchmail_incoming_log/i18n/pt_PT.po b/fetchmail_incoming_log/i18n/pt_PT.po new file mode 100644 index 000000000..06a8b94e4 --- /dev/null +++ b/fetchmail_incoming_log/i18n/pt_PT.po @@ -0,0 +1,40 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_log_messages_to_process +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-10-21 22:54+0000\n" +"PO-Revision-Date: 2017-10-21 22:54+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Portuguese (Portugal) (https://www.transifex.com/oca/" +"teams/23907/pt_PT/)\n" +"Language: pt_PT\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: fetchmail_incoming_log +#: model:ir.model.fields,field_description:fetchmail_incoming_log.field_mail_thread__display_name +msgid "Display Name" +msgstr "" + +#. module: fetchmail_incoming_log +#: model:ir.model,name:fetchmail_incoming_log.model_mail_thread +msgid "Email Thread" +msgstr "Tópico de Email" + +#. module: fetchmail_incoming_log +#: model:ir.model.fields,field_description:fetchmail_incoming_log.field_mail_thread__id +msgid "ID" +msgstr "" + +#. module: fetchmail_incoming_log +#: model:ir.model.fields,field_description:fetchmail_incoming_log.field_mail_thread____last_update +msgid "Last Modified on" +msgstr "" diff --git a/fetchmail_incoming_log/i18n/sl.po b/fetchmail_incoming_log/i18n/sl.po new file mode 100644 index 000000000..54fb73f7d --- /dev/null +++ b/fetchmail_incoming_log/i18n/sl.po @@ -0,0 +1,40 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_log_messages_to_process +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-10-21 22:54+0000\n" +"PO-Revision-Date: 2017-10-21 22:54+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n" +"Language: sl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n" +"%100==4 ? 2 : 3);\n" + +#. module: fetchmail_incoming_log +#: model:ir.model.fields,field_description:fetchmail_incoming_log.field_mail_thread__display_name +msgid "Display Name" +msgstr "" + +#. module: fetchmail_incoming_log +#: model:ir.model,name:fetchmail_incoming_log.model_mail_thread +msgid "Email Thread" +msgstr "E-poštna nit" + +#. module: fetchmail_incoming_log +#: model:ir.model.fields,field_description:fetchmail_incoming_log.field_mail_thread__id +msgid "ID" +msgstr "" + +#. module: fetchmail_incoming_log +#: model:ir.model.fields,field_description:fetchmail_incoming_log.field_mail_thread____last_update +msgid "Last Modified on" +msgstr "" diff --git a/fetchmail_incoming_log/i18n/tr.po b/fetchmail_incoming_log/i18n/tr.po new file mode 100644 index 000000000..1b83d6e8f --- /dev/null +++ b/fetchmail_incoming_log/i18n/tr.po @@ -0,0 +1,39 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_log_messages_to_process +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-10-21 22:54+0000\n" +"PO-Revision-Date: 2017-10-21 22:54+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Turkish (https://www.transifex.com/oca/teams/23907/tr/)\n" +"Language: tr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: fetchmail_incoming_log +#: model:ir.model.fields,field_description:fetchmail_incoming_log.field_mail_thread__display_name +msgid "Display Name" +msgstr "" + +#. module: fetchmail_incoming_log +#: model:ir.model,name:fetchmail_incoming_log.model_mail_thread +msgid "Email Thread" +msgstr "Eposta konuşması" + +#. module: fetchmail_incoming_log +#: model:ir.model.fields,field_description:fetchmail_incoming_log.field_mail_thread__id +msgid "ID" +msgstr "" + +#. module: fetchmail_incoming_log +#: model:ir.model.fields,field_description:fetchmail_incoming_log.field_mail_thread____last_update +msgid "Last Modified on" +msgstr "" diff --git a/fetchmail_incoming_log/models/__init__.py b/fetchmail_incoming_log/models/__init__.py new file mode 100644 index 000000000..b70a9f2d0 --- /dev/null +++ b/fetchmail_incoming_log/models/__init__.py @@ -0,0 +1 @@ +from . import mail_thread diff --git a/fetchmail_incoming_log/models/mail_thread.py b/fetchmail_incoming_log/models/mail_thread.py new file mode 100644 index 000000000..5b4c3d85e --- /dev/null +++ b/fetchmail_incoming_log/models/mail_thread.py @@ -0,0 +1,49 @@ +# Copyright 2017-20 ForgeFlow S.L. (www.forgeflow.com) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +import email +import email.policy +import logging +import xmlrpc.client as xmlrpclib + +from odoo import api, models + +_logger = logging.getLogger(__name__) + + +class MailThread(models.AbstractModel): + _inherit = "mail.thread" + + @api.model + def message_process( + self, + model, + message, + custom_values=None, + save_original=False, + strip_attachments=False, + thread_id=None, + ): + message_copy = message + if isinstance(message, xmlrpclib.Binary): + message = bytes(message.data) + + if isinstance(message, str): + message = message.encode("utf-8") + message = email.message_from_bytes(message, policy=email.policy.SMTP) + msg_dict = self.message_parse(message, save_original=save_original) + _logger.info( + "Fetched mail from %s to %s with Message-Id %s", + msg_dict.get("from"), + msg_dict.get("to"), + msg_dict.get("message_id"), + ) + + return super().message_process( + model, + message_copy, + custom_values=custom_values, + save_original=save_original, + strip_attachments=strip_attachments, + thread_id=thread_id, + ) diff --git a/fetchmail_incoming_log/readme/CONTRIBUTORS.rst b/fetchmail_incoming_log/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..1ec5d4760 --- /dev/null +++ b/fetchmail_incoming_log/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* Jordi Ballester +* Héctor Villarreal +* Helly kapatel diff --git a/fetchmail_incoming_log/readme/DESCRIPTION.rst b/fetchmail_incoming_log/readme/DESCRIPTION.rst new file mode 100644 index 000000000..53be783f1 --- /dev/null +++ b/fetchmail_incoming_log/readme/DESCRIPTION.rst @@ -0,0 +1,7 @@ +This module allows to log into the server the basic information of emails +that have been fetched from the mail server, before they start to be processed. + +This allows for a better analysis of situations where emails are found to be +missing in Odoo. Can help to better resolve questions of the type 'Was it that +the email was never fetched, or a problem found when it was processed by +Odoo?'. diff --git a/fetchmail_incoming_log/static/description/icon.png b/fetchmail_incoming_log/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/fetchmail_incoming_log/static/description/icon.png differ diff --git a/fetchmail_incoming_log/static/description/index.html b/fetchmail_incoming_log/static/description/index.html new file mode 100644 index 000000000..b29579b22 --- /dev/null +++ b/fetchmail_incoming_log/static/description/index.html @@ -0,0 +1,426 @@ + + + + + + +Fetchmail Incoming Log + + + +
+

Fetchmail Incoming Log

+ + +

Beta License: AGPL-3 OCA/server-tools Translate me on Weblate Try me on Runbot

+

This module allows to log into the server the basic information of emails +that have been fetched from the mail server, before they start to be processed.

+

This allows for a better analysis of situations where emails are found to be +missing in Odoo. Can help to better resolve questions of the type ‘Was it that +the email was never fetched, or a problem found when it was processed by +Odoo?’.

+

Table of contents

+ +
+

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 smashing it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • ForgeFlow
  • +
+
+
+

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.

+

This module is part of the OCA/server-tools project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/fetchmail_incoming_log/tests/__init__.py b/fetchmail_incoming_log/tests/__init__.py new file mode 100644 index 000000000..85aed3ed2 --- /dev/null +++ b/fetchmail_incoming_log/tests/__init__.py @@ -0,0 +1 @@ +from . import test_fetchmail_incoming_log diff --git a/fetchmail_incoming_log/tests/test_fetchmail_incoming_log.py b/fetchmail_incoming_log/tests/test_fetchmail_incoming_log.py new file mode 100644 index 000000000..a2aba1917 --- /dev/null +++ b/fetchmail_incoming_log/tests/test_fetchmail_incoming_log.py @@ -0,0 +1,35 @@ +# Copyright 2017-20 ForgeFlow S.L. (www.forgeflow.com) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo.tests.common import tagged + +from odoo.addons.test_mail.data.test_mail_data import MAIL_TEMPLATE +from odoo.addons.test_mail.tests.test_mail_gateway import TestMailgateway + + +@tagged("mail_gateway") +class TestFetchmailIncomingLog(TestMailgateway): + @classmethod + def setUpClass(cls): + super(TestFetchmailIncomingLog, cls).setUpClass() + + cls.fetchmail_server = cls.env["fetchmail.server"].create( + {"name": "Test Fetchmail Server", "server_type": "imap"} + ) + + def test_message_process(self): + email_from = "test1@example.com" + to_email = "test2@example.com" + msg_id = "Test log message to process" + with self.assertRaises(ValueError): + mail = MAIL_TEMPLATE.format( + to=to_email, + email_from=email_from, + cc="", + subject="testing", + extra="", + msg_id=msg_id, + ) + self.env["mail.thread"].with_context( + fetchmail_server_id=self.fetchmail_server.id + ).message_process(None, mail) diff --git a/setup/fetchmail_incoming_log/odoo/addons/fetchmail_incoming_log b/setup/fetchmail_incoming_log/odoo/addons/fetchmail_incoming_log new file mode 120000 index 000000000..17e55352e --- /dev/null +++ b/setup/fetchmail_incoming_log/odoo/addons/fetchmail_incoming_log @@ -0,0 +1 @@ +../../../../fetchmail_incoming_log \ No newline at end of file diff --git a/setup/fetchmail_incoming_log/setup.py b/setup/fetchmail_incoming_log/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/fetchmail_incoming_log/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)