From 4010d960e8710639deea7e9720bc54ca2590da4e Mon Sep 17 00:00:00 2001 From: eLBati Date: Tue, 30 Jun 2015 19:35:54 +0200 Subject: [PATCH] [ADD] module fetchmail_notify_error_to_sender --- fetchmail_notify_error_to_sender/README.rst | 50 ++++++++++ fetchmail_notify_error_to_sender/__init__.py | 22 +++++ .../__openerp__.py | 40 ++++++++ .../email_template_data.xml | 27 ++++++ fetchmail_notify_error_to_sender/fetchmail.py | 30 ++++++ .../fetchmail_view.xml | 16 +++ fetchmail_notify_error_to_sender/i18n/de.po | 61 ++++++++++++ fetchmail_notify_error_to_sender/i18n/es.po | 90 +++++++++++++++++ fetchmail_notify_error_to_sender/i18n/fr.po | 91 ++++++++++++++++++ fetchmail_notify_error_to_sender/i18n/it.po | 69 +++++++++++++ .../i18n/pt_BR.po | 61 ++++++++++++ .../i18n/pt_PT.po | 60 ++++++++++++ fetchmail_notify_error_to_sender/i18n/sl.po | 61 ++++++++++++ fetchmail_notify_error_to_sender/i18n/tr.po | 61 ++++++++++++ .../mail_thread.py | 75 +++++++++++++++ .../static/description/icon.png | Bin 0 -> 3274 bytes 16 files changed, 814 insertions(+) create mode 100644 fetchmail_notify_error_to_sender/README.rst create mode 100644 fetchmail_notify_error_to_sender/__init__.py create mode 100644 fetchmail_notify_error_to_sender/__openerp__.py create mode 100644 fetchmail_notify_error_to_sender/email_template_data.xml create mode 100644 fetchmail_notify_error_to_sender/fetchmail.py create mode 100644 fetchmail_notify_error_to_sender/fetchmail_view.xml create mode 100644 fetchmail_notify_error_to_sender/i18n/de.po create mode 100644 fetchmail_notify_error_to_sender/i18n/es.po create mode 100644 fetchmail_notify_error_to_sender/i18n/fr.po create mode 100644 fetchmail_notify_error_to_sender/i18n/it.po create mode 100644 fetchmail_notify_error_to_sender/i18n/pt_BR.po create mode 100644 fetchmail_notify_error_to_sender/i18n/pt_PT.po create mode 100644 fetchmail_notify_error_to_sender/i18n/sl.po create mode 100644 fetchmail_notify_error_to_sender/i18n/tr.po create mode 100644 fetchmail_notify_error_to_sender/mail_thread.py create mode 100644 fetchmail_notify_error_to_sender/static/description/icon.png diff --git a/fetchmail_notify_error_to_sender/README.rst b/fetchmail_notify_error_to_sender/README.rst new file mode 100644 index 000000000..b8dbd0ad1 --- /dev/null +++ b/fetchmail_notify_error_to_sender/README.rst @@ -0,0 +1,50 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :alt: License: AGPL-3 + +Send notice on fetchmail errors +=============================== + +If fetchmail is not able to correctly route an email, the email is "silently" lost (you get an error message in server log). +For example, if you configure odoo mail system to route received emails according to recipient address, it may happen users send emails to wrong email address. + +This module allows to automatically send a notification email to sender, when odoo can't correctly process the received email. + + +Configuration +============= + +Configure your fetchmail server setting 'Error notice template' = 'Fetchmail - error notice'. +You can edit the 'Fetchmail - error notice' email template according to your needs. + + +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 +`here `_. + + +Credits +======= + +Contributors +------------ + +* Lorenzo Battistini + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +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. + +To contribute to this module, please visit http://odoo-community.org. diff --git a/fetchmail_notify_error_to_sender/__init__.py b/fetchmail_notify_error_to_sender/__init__.py new file mode 100644 index 000000000..6caf7ed3b --- /dev/null +++ b/fetchmail_notify_error_to_sender/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (C) 2015 Lorenzo Battistini +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from . import mail_thread +from . import fetchmail diff --git a/fetchmail_notify_error_to_sender/__openerp__.py b/fetchmail_notify_error_to_sender/__openerp__.py new file mode 100644 index 000000000..3dc0ee4ba --- /dev/null +++ b/fetchmail_notify_error_to_sender/__openerp__.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (C) 2015 Lorenzo Battistini +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +{ + 'name': 'Send notice on fetchmail errors', + 'summary': 'If fetching mails gives error, send an email to sender', + 'version': '8.0.1.0.0', + 'category': 'Tools', + 'author': "Agile Business Group,Odoo Community Association (OCA)", + 'website': 'http://www.agilebg.com', + 'license': 'AGPL-3', + 'depends': [ + 'fetchmail', + ], + 'data': [ + 'fetchmail_view.xml', + 'email_template_data.xml', + ], + 'qweb': [ + ], + 'installable': True, + 'auto_install': False, +} diff --git a/fetchmail_notify_error_to_sender/email_template_data.xml b/fetchmail_notify_error_to_sender/email_template_data.xml new file mode 100644 index 000000000..6d98a9725 --- /dev/null +++ b/fetchmail_notify_error_to_sender/email_template_data.xml @@ -0,0 +1,27 @@ + + + + + + + Fetchmail - error notice + ${ctx.get('sender_message').get('to')|safe} + ${ctx.get('sender_message').get('from')|safe} + Receiving error with: ${ctx.get('sender_message').get('subject')|safe} + + + + ${ctx.get('lang')} + +

Hello ${ctx.get('sender_message').get('from')},

+

we got a problem with your email: ${ctx.get('sender_message').get('subject')}

+

Maybe you used a wrong recipient address?

+


+

Technical details:

+

${ctx.get('route_exception').message}

+ + ]]>
+
+
+
diff --git a/fetchmail_notify_error_to_sender/fetchmail.py b/fetchmail_notify_error_to_sender/fetchmail.py new file mode 100644 index 000000000..97233d486 --- /dev/null +++ b/fetchmail_notify_error_to_sender/fetchmail.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (C) 2015 Lorenzo Battistini +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from openerp import models, fields + + +class fetchmail_server(models.Model): + + _inherit = 'fetchmail.server' + error_notice_template_id = fields.Many2one( + 'email.template', string="Error notice template", + help="Set here the template to use to send notice to sender when " + "errors occur while fetching email") diff --git a/fetchmail_notify_error_to_sender/fetchmail_view.xml b/fetchmail_notify_error_to_sender/fetchmail_view.xml new file mode 100644 index 000000000..2364f95ad --- /dev/null +++ b/fetchmail_notify_error_to_sender/fetchmail_view.xml @@ -0,0 +1,16 @@ + + + + + + fetchmail.server.form + fetchmail.server + + + + + + + + + diff --git a/fetchmail_notify_error_to_sender/i18n/de.po b/fetchmail_notify_error_to_sender/i18n/de.po new file mode 100644 index 000000000..6fac306b4 --- /dev/null +++ b/fetchmail_notify_error_to_sender/i18n/de.po @@ -0,0 +1,61 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fetchmail_notify_error_to_sender +# +# Translators: +# Rudolf Schnapka , 2016 +msgid "" +msgstr "" +"Project-Id-Version: server-tools (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-01-19 14:44+0000\n" +"PO-Revision-Date: 2016-01-18 14:02+0000\n" +"Last-Translator: Rudolf Schnapka \n" +"Language-Team: German (http://www.transifex.com/oca/OCA-server-tools-8-0/language/de/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: de\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: fetchmail_notify_error_to_sender +#: model:email.template,body_html:fetchmail_notify_error_to_sender.email_template_error_notice +msgid "" +"\n" +"
\n" +"

Hello ${ctx.get('sender_message').get('from')},

\n" +"

we got a problem with your email: ${ctx.get('sender_message').get('subject')}

\n" +"

Maybe you used a wrong recipient address?

\n" +"


\n" +"

Technical details:

\n" +"

${ctx.get('route_exception').message}

\n" +"
\n" +" " +msgstr "\n
\n

Hallo ${ctx.get('sender_message').get('from')},

\n

wir haben ein Problem mit Ihrer Email: ${ctx.get('sender_message').get('subject')}

\n

Vielleicht haben Sie nur die falsche Empfängeradresse angegeben?

\n


\n

Technische Details:

\n

${ctx.get('route_exception').message}

\n
\n " + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model,name:fetchmail_notify_error_to_sender.model_mail_thread +msgid "Email Thread" +msgstr "Email-Thread" + +#. module: fetchmail_notify_error_to_sender +#: field:fetchmail.server,error_notice_template_id:0 +msgid "Error notice template" +msgstr "Fehlerhinweis-Vorlage" + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model,name:fetchmail_notify_error_to_sender.model_fetchmail_server +msgid "POP/IMAP Server" +msgstr "POP/IMAP Server" + +#. module: fetchmail_notify_error_to_sender +#: model:email.template,subject:fetchmail_notify_error_to_sender.email_template_error_notice +msgid "Receiving error with: ${ctx.get('sender_message').get('subject')|safe}" +msgstr "Erhalte Fehler mit: ${ctx.get('sender_message').get('subject')|safe}" + +#. module: fetchmail_notify_error_to_sender +#: help:fetchmail.server,error_notice_template_id:0 +msgid "" +"Set here the template to use to send notice to sender when errors occur " +"while fetching email" +msgstr "Legen Sie hier die Vorlage fest, die verwendet werden soll, um Hinweise an Benutzer zu senden, wenn Fehler beim Nachrichten Abholen auftreten." diff --git a/fetchmail_notify_error_to_sender/i18n/es.po b/fetchmail_notify_error_to_sender/i18n/es.po new file mode 100644 index 000000000..ec8a47779 --- /dev/null +++ b/fetchmail_notify_error_to_sender/i18n/es.po @@ -0,0 +1,90 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fetchmail_notify_error_to_sender +# +# Translators: +# Ahmet Altınışık , 2016 +# Antonio Trueba, 2016 +# Antonio Trueba, 2016 +# bossnm11 , 2014 +# Carles Antoli , 2015 +# Chanseok , 2014 +# Chul Park , 2015 +# David10000 , 2014 +# FIRST AUTHOR , 2012-2013 +# Gil , 2014 +# Hongseob Lee , 2015 +# Hongseob Lee , 2015 +# Hotellook, 2014 +# jeon , 2014 +# JiyeonLee , 2014 +# Jong-Dae Park , 2013 +# Kevin Min , 2015 +# KimKyudong , 2014 +# mariana1201 , 2014 +# Matjaž Mozetič , 2015-2016 +# Nicole , 2014 +# Paolo Valier, 2016 +# Pope, 2014 +# Rudolf Schnapka , 2016 +# Sarina Canelake , 2014 +# Seok Jun Yoon , 2015 +# shin2012 , 2014 +# Sujin Lee , 2014 +# Sunah Lim , 2013 +# Young Kim , 2015 +msgid "" +msgstr "" +"Project-Id-Version: server-tools (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-04-14 07:02+0000\n" +"PO-Revision-Date: 2016-04-07 17:54+0000\n" +"Last-Translator: Antonio Trueba\n" +"Language-Team: Spanish (http://www.transifex.com/oca/OCA-server-tools-8-0/language/es/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: es\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: fetchmail_notify_error_to_sender +#: model:email.template,body_html:fetchmail_notify_error_to_sender.email_template_error_notice +msgid "" +"\n" +"
\n" +"

Hello ${ctx.get('sender_message').get('from')},

\n" +"

we got a problem with your email: ${ctx.get('sender_message').get('subject')}

\n" +"

Maybe you used a wrong recipient address?

\n" +"


\n" +"

Technical details:

\n" +"

${ctx.get('route_exception').message}

\n" +"
\n" +" " +msgstr "\n
\n

Hola ${ctx.get('sender_message').get('from')},

\n

tenemos un problema con su email: ${ctx.get('sender_message').get('subject')}

\n

¿Puede haber usado una dirección de destino incorrecta?

\n


\n

Detalles técnicos:

\n

${ctx.get('route_exception').message}

\n
\n " + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model,name:fetchmail_notify_error_to_sender.model_mail_thread +msgid "Email Thread" +msgstr "Hilo correo electrónico" + +#. module: fetchmail_notify_error_to_sender +#: field:fetchmail.server,error_notice_template_id:0 +msgid "Error notice template" +msgstr "" + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model,name:fetchmail_notify_error_to_sender.model_fetchmail_server +msgid "POP/IMAP Server" +msgstr "Servidor POP/IMAP" + +#. module: fetchmail_notify_error_to_sender +#: model:email.template,subject:fetchmail_notify_error_to_sender.email_template_error_notice +msgid "Receiving error with: ${ctx.get('sender_message').get('subject')|safe}" +msgstr "" + +#. module: fetchmail_notify_error_to_sender +#: help:fetchmail.server,error_notice_template_id:0 +msgid "" +"Set here the template to use to send notice to sender when errors occur " +"while fetching email" +msgstr "" diff --git a/fetchmail_notify_error_to_sender/i18n/fr.po b/fetchmail_notify_error_to_sender/i18n/fr.po new file mode 100644 index 000000000..b77689ef9 --- /dev/null +++ b/fetchmail_notify_error_to_sender/i18n/fr.po @@ -0,0 +1,91 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fetchmail_notify_error_to_sender +# +# Translators: +# Ahmet Altinisik , 2016 +# Antonio Trueba, 2016 +# Armando Vulcano Junior , 2015 +# bossnm11 , 2014 +# Chanseok , 2014 +# Christophe CHAUVET , 2015 +# Chul Park , 2015 +# David10000 , 2014 +# FIRST AUTHOR , 2012-2013 +# Gil , 2014 +# kmooc , 2015 +# Hongseob Lee , 2015 +# Hotellook, 2014 +# jeon , 2014 +# JiyeonLee , 2014 +# Jong-Dae Park , 2013 +# Kevin Min , 2015 +# KimKyudong , 2014 +# mariana1201 , 2014 +# Matjaž Mozetič , 2015 +# Nicole , 2014 +# Pedro M. Baeza , 2015 +# Pope, 2014 +# SaFi J. , 2015 +# Sarina Canelake , 2014 +# Seok Jun Yoon , 2015 +# shin2012 , 2014 +# Sujin Lee , 2014 +# Sunah Lim , 2013 +# Young C. Kim, 2015 +# Zwygart , 2016 +msgid "" +msgstr "" +"Project-Id-Version: server-tools (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-11-28 21:29+0000\n" +"PO-Revision-Date: 2016-10-11 22:10+0000\n" +"Last-Translator: Zwygart \n" +"Language-Team: French (http://www.transifex.com/oca/OCA-server-tools-8-0/language/fr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: fr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: fetchmail_notify_error_to_sender +#: model:email.template,body_html:fetchmail_notify_error_to_sender.email_template_error_notice +msgid "" +"\n" +"
\n" +"

Hello ${ctx.get('sender_message').get('from')},

\n" +"

we got a problem with your email: ${ctx.get('sender_message').get('subject')}

\n" +"

Maybe you used a wrong recipient address?

\n" +"


\n" +"

Technical details:

\n" +"

${ctx.get('route_exception').message}

\n" +"
\n" +" " +msgstr "\n
\n

Bonjour ${ctx.get('sender_message').get('from')},

\n

nous avons de la difficulté avec votre adresse de courriel: ${ctx.get('sender_message').get('subject')}

\n

Peut-être avez-vous utilisé une mauvaise adresse de destinataire?

\n


\n

Détails techniques:

\n

${ctx.get('route_exception').message}

\n
" + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model,name:fetchmail_notify_error_to_sender.model_mail_thread +msgid "Email Thread" +msgstr "Discussion de courriel" + +#. module: fetchmail_notify_error_to_sender +#: field:fetchmail.server,error_notice_template_id:0 +msgid "Error notice template" +msgstr "Erreur dans le modèle de notice" + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model,name:fetchmail_notify_error_to_sender.model_fetchmail_server +msgid "POP/IMAP Server" +msgstr "Serveur POP/IMAP" + +#. module: fetchmail_notify_error_to_sender +#: model:email.template,subject:fetchmail_notify_error_to_sender.email_template_error_notice +msgid "Receiving error with: ${ctx.get('sender_message').get('subject')|safe}" +msgstr "Reçu une erreur avec : ${ctx.get('sender_message').get('subject')|safe}" + +#. module: fetchmail_notify_error_to_sender +#: help:fetchmail.server,error_notice_template_id:0 +msgid "" +"Set here the template to use to send notice to sender when errors occur " +"while fetching email" +msgstr "Choisissez ici le modèle à utiliser pour informer l'expéditeur lorsque des erreurs surviennent lors de la récupération du courriel. " diff --git a/fetchmail_notify_error_to_sender/i18n/it.po b/fetchmail_notify_error_to_sender/i18n/it.po new file mode 100644 index 000000000..ac1646bca --- /dev/null +++ b/fetchmail_notify_error_to_sender/i18n/it.po @@ -0,0 +1,69 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fetchmail_notify_error_to_sender +# +# Translators: +# Armando Vulcano Junior , 2015 +# danimaribeiro , 2016 +# FIRST AUTHOR , 2011-2012 +# Hotellook, 2014 +# Leonardo J. Caballero G. , 2016 +# Matjaž Mozetič , 2015-2016 +# Paolo Valier, 2016 +# Paolo Valier, 2016 +# Rudolf Schnapka , 2016 +msgid "" +msgstr "" +"Project-Id-Version: server-tools (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-07-28 00:59+0000\n" +"PO-Revision-Date: 2016-07-31 08:52+0000\n" +"Last-Translator: Paolo Valier\n" +"Language-Team: Italian (http://www.transifex.com/oca/OCA-server-tools-8-0/language/it/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: it\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: fetchmail_notify_error_to_sender +#: model:email.template,body_html:fetchmail_notify_error_to_sender.email_template_error_notice +msgid "" +"\n" +"
\n" +"

Hello ${ctx.get('sender_message').get('from')},

\n" +"

we got a problem with your email: ${ctx.get('sender_message').get('subject')}

\n" +"

Maybe you used a wrong recipient address?

\n" +"


\n" +"

Technical details:

\n" +"

${ctx.get('route_exception').message}

\n" +"
\n" +" " +msgstr "" + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model,name:fetchmail_notify_error_to_sender.model_mail_thread +msgid "Email Thread" +msgstr "Discussione Email" + +#. module: fetchmail_notify_error_to_sender +#: field:fetchmail.server,error_notice_template_id:0 +msgid "Error notice template" +msgstr "Modello per il messaggio di errore" + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model,name:fetchmail_notify_error_to_sender.model_fetchmail_server +msgid "POP/IMAP Server" +msgstr "Server POP/IMAP" + +#. module: fetchmail_notify_error_to_sender +#: model:email.template,subject:fetchmail_notify_error_to_sender.email_template_error_notice +msgid "Receiving error with: ${ctx.get('sender_message').get('subject')|safe}" +msgstr "" + +#. module: fetchmail_notify_error_to_sender +#: help:fetchmail.server,error_notice_template_id:0 +msgid "" +"Set here the template to use to send notice to sender when errors occur " +"while fetching email" +msgstr "" diff --git a/fetchmail_notify_error_to_sender/i18n/pt_BR.po b/fetchmail_notify_error_to_sender/i18n/pt_BR.po new file mode 100644 index 000000000..9da09368c --- /dev/null +++ b/fetchmail_notify_error_to_sender/i18n/pt_BR.po @@ -0,0 +1,61 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fetchmail_notify_error_to_sender +# +# Translators: +# Armando Vulcano Junior , 2015 +msgid "" +msgstr "" +"Project-Id-Version: server-tools (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-09-29 11:14+0000\n" +"PO-Revision-Date: 2015-09-18 22:16+0000\n" +"Last-Translator: Armando Vulcano Junior \n" +"Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/OCA-server-tools-8-0/language/pt_BR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: pt_BR\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: fetchmail_notify_error_to_sender +#: model:email.template,body_html:fetchmail_notify_error_to_sender.email_template_error_notice +msgid "" +"\n" +"
\n" +"

Hello ${ctx.get('sender_message').get('from')},

\n" +"

we got a problem with your email: ${ctx.get('sender_message').get('subject')}

\n" +"

Maybe you used a wrong recipient address?

\n" +"


\n" +"

Technical details:

\n" +"

${ctx.get('route_exception').message}

\n" +"
\n" +" " +msgstr "" + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model,name:fetchmail_notify_error_to_sender.model_mail_thread +msgid "Email Thread" +msgstr "Processo Email" + +#. module: fetchmail_notify_error_to_sender +#: field:fetchmail.server,error_notice_template_id:0 +msgid "Error notice template" +msgstr "Modelo de aviso de erro" + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model,name:fetchmail_notify_error_to_sender.model_fetchmail_server +msgid "POP/IMAP Server" +msgstr "Servidor POP/IMAP" + +#. module: fetchmail_notify_error_to_sender +#: model:email.template,subject:fetchmail_notify_error_to_sender.email_template_error_notice +msgid "Receiving error with: ${ctx.get('sender_message').get('subject')|safe}" +msgstr "Recebendo erro com: ${ctx.get('sender_message').get('subject')|safe}" + +#. module: fetchmail_notify_error_to_sender +#: help:fetchmail.server,error_notice_template_id:0 +msgid "" +"Set here the template to use to send notice to sender when errors occur " +"while fetching email" +msgstr "Configure aqui o modelo para usar para enviar aviso ao remetente quando ocorrer erro durante a carga de email" diff --git a/fetchmail_notify_error_to_sender/i18n/pt_PT.po b/fetchmail_notify_error_to_sender/i18n/pt_PT.po new file mode 100644 index 000000000..52d4494b3 --- /dev/null +++ b/fetchmail_notify_error_to_sender/i18n/pt_PT.po @@ -0,0 +1,60 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fetchmail_notify_error_to_sender +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: server-tools (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-09-16 09:29+0000\n" +"PO-Revision-Date: 2015-09-18 13:55+0000\n" +"Last-Translator: <>\n" +"Language-Team: Portuguese (Portugal) (http://www.transifex.com/oca/OCA-server-tools-8-0/language/pt_PT/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: pt_PT\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: fetchmail_notify_error_to_sender +#: model:email.template,body_html:fetchmail_notify_error_to_sender.email_template_error_notice +msgid "" +"\n" +"
\n" +"

Hello ${ctx.get('sender_message').get('from')},

\n" +"

we got a problem with your email: ${ctx.get('sender_message').get('subject')}

\n" +"

Maybe you used a wrong recipient address?

\n" +"


\n" +"

Technical details:

\n" +"

${ctx.get('route_exception').message}

\n" +"
\n" +" " +msgstr "" + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model,name:fetchmail_notify_error_to_sender.model_mail_thread +msgid "Email Thread" +msgstr "Tópico de Email" + +#. module: fetchmail_notify_error_to_sender +#: field:fetchmail.server,error_notice_template_id:0 +msgid "Error notice template" +msgstr "" + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model,name:fetchmail_notify_error_to_sender.model_fetchmail_server +msgid "POP/IMAP Server" +msgstr "" + +#. module: fetchmail_notify_error_to_sender +#: model:email.template,subject:fetchmail_notify_error_to_sender.email_template_error_notice +msgid "Receiving error with: ${ctx.get('sender_message').get('subject')|safe}" +msgstr "" + +#. module: fetchmail_notify_error_to_sender +#: help:fetchmail.server,error_notice_template_id:0 +msgid "" +"Set here the template to use to send notice to sender when errors occur " +"while fetching email" +msgstr "" diff --git a/fetchmail_notify_error_to_sender/i18n/sl.po b/fetchmail_notify_error_to_sender/i18n/sl.po new file mode 100644 index 000000000..7f8037100 --- /dev/null +++ b/fetchmail_notify_error_to_sender/i18n/sl.po @@ -0,0 +1,61 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fetchmail_notify_error_to_sender +# +# Translators: +# Matjaž Mozetič , 2015 +msgid "" +msgstr "" +"Project-Id-Version: server-tools (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-09-29 11:14+0000\n" +"PO-Revision-Date: 2015-09-26 07:45+0000\n" +"Last-Translator: Matjaž Mozetič \n" +"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-server-tools-8-0/language/sl/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: sl\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_notify_error_to_sender +#: model:email.template,body_html:fetchmail_notify_error_to_sender.email_template_error_notice +msgid "" +"\n" +"
\n" +"

Hello ${ctx.get('sender_message').get('from')},

\n" +"

we got a problem with your email: ${ctx.get('sender_message').get('subject')}

\n" +"

Maybe you used a wrong recipient address?

\n" +"


\n" +"

Technical details:

\n" +"

${ctx.get('route_exception').message}

\n" +"
\n" +" " +msgstr "\n
\n

Pozdravljeni ${ctx.get('sender_message').get('from')}.

\n

Z vašim e-poštnim sporočilom imamo težave: ${ctx.get('sender_message').get('subject')}

\n

Ste mogoče uporabili napačen e-poštni naslov?

\n


\n

Tehnični podatki:

\n

${ctx.get('route_exception').message}

\n
\n " + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model,name:fetchmail_notify_error_to_sender.model_mail_thread +msgid "Email Thread" +msgstr "E-poštna nit" + +#. module: fetchmail_notify_error_to_sender +#: field:fetchmail.server,error_notice_template_id:0 +msgid "Error notice template" +msgstr "Predloga obvestila o napaki" + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model,name:fetchmail_notify_error_to_sender.model_fetchmail_server +msgid "POP/IMAP Server" +msgstr "POP/IMAP strežnik" + +#. module: fetchmail_notify_error_to_sender +#: model:email.template,subject:fetchmail_notify_error_to_sender.email_template_error_notice +msgid "Receiving error with: ${ctx.get('sender_message').get('subject')|safe}" +msgstr "Napaka pri prejemu: ${ctx.get('sender_message').get('subject')|safe}" + +#. module: fetchmail_notify_error_to_sender +#: help:fetchmail.server,error_notice_template_id:0 +msgid "" +"Set here the template to use to send notice to sender when errors occur " +"while fetching email" +msgstr "Nastavite predlogo, ki bo uporabljena za pošiljanje obvestila pošiljatelju, kadar se bi pojavile napake pri prejemu e-pošte" diff --git a/fetchmail_notify_error_to_sender/i18n/tr.po b/fetchmail_notify_error_to_sender/i18n/tr.po new file mode 100644 index 000000000..09a8e6c41 --- /dev/null +++ b/fetchmail_notify_error_to_sender/i18n/tr.po @@ -0,0 +1,61 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fetchmail_notify_error_to_sender +# +# Translators: +# Ahmet Altınışık , 2016 +msgid "" +msgstr "" +"Project-Id-Version: server-tools (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-01-19 14:44+0000\n" +"PO-Revision-Date: 2016-01-31 13:32+0000\n" +"Last-Translator: Ahmet Altınışık \n" +"Language-Team: Turkish (http://www.transifex.com/oca/OCA-server-tools-8-0/language/tr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: tr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: fetchmail_notify_error_to_sender +#: model:email.template,body_html:fetchmail_notify_error_to_sender.email_template_error_notice +msgid "" +"\n" +"
\n" +"

Hello ${ctx.get('sender_message').get('from')},

\n" +"

we got a problem with your email: ${ctx.get('sender_message').get('subject')}

\n" +"

Maybe you used a wrong recipient address?

\n" +"


\n" +"

Technical details:

\n" +"

${ctx.get('route_exception').message}

\n" +"
\n" +" " +msgstr "\n
\n

Merhaba ${ctx.get('sender_message').get('from')},

\n

E-postanız ile ilgili bir problem var: ${ctx.get('sender_message').get('subject')}

\n

Belki alıcı adresi yanlıştır?

\n


\n

Teknik detaylar:

\n

${ctx.get('route_exception').message}

\n
\n " + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model,name:fetchmail_notify_error_to_sender.model_mail_thread +msgid "Email Thread" +msgstr "Eposta konuşması" + +#. module: fetchmail_notify_error_to_sender +#: field:fetchmail.server,error_notice_template_id:0 +msgid "Error notice template" +msgstr "Hata bildirim şablonu" + +#. module: fetchmail_notify_error_to_sender +#: model:ir.model,name:fetchmail_notify_error_to_sender.model_fetchmail_server +msgid "POP/IMAP Server" +msgstr "POP/IMAP sunucu" + +#. module: fetchmail_notify_error_to_sender +#: model:email.template,subject:fetchmail_notify_error_to_sender.email_template_error_notice +msgid "Receiving error with: ${ctx.get('sender_message').get('subject')|safe}" +msgstr "Alınan hata : ${ctx.get('sender_message').get('subject')|safe}" + +#. module: fetchmail_notify_error_to_sender +#: help:fetchmail.server,error_notice_template_id:0 +msgid "" +"Set here the template to use to send notice to sender when errors occur " +"while fetching email" +msgstr "E-posta alınırken oluşan hatalarda gönderilecek bildirim mesajı için şablonu belirleyin." diff --git a/fetchmail_notify_error_to_sender/mail_thread.py b/fetchmail_notify_error_to_sender/mail_thread.py new file mode 100644 index 000000000..19eddcac4 --- /dev/null +++ b/fetchmail_notify_error_to_sender/mail_thread.py @@ -0,0 +1,75 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (C) 2015 Lorenzo Battistini +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from openerp.osv import osv + + +class mail_thread(osv.AbstractModel): + _inherit = 'mail.thread' + + def message_route_verify( + self, cr, uid, message, message_dict, route, update_author=True, + assert_model=True, create_fallback=True, allow_private=False, + context=None + ): + res = () + if context is None: + context = {} + try: + res = super(mail_thread, self).message_route_verify( + cr, uid, message, message_dict, route, + update_author=update_author, assert_model=assert_model, + create_fallback=create_fallback, allow_private=allow_private, + context=context) + except ValueError as ve: + fetchmail_server_id = context.get('fetchmail_server_id') + if not fetchmail_server_id: + raise ve + fetchmail_server = self.pool['fetchmail.server'].browse( + cr, uid, fetchmail_server_id, context) + if not fetchmail_server.error_notice_template_id: + raise ve + context['sender_message'] = message + context['route_exception'] = ve + self.pool['email.template'].send_mail( + cr, uid, fetchmail_server.error_notice_template_id.id, + fetchmail_server.id, context=context) + context['error_notice_sent'] = True + return res + + def message_route( + self, cr, uid, message, message_dict, model=None, thread_id=None, + custom_values=None, context=None + ): + if context is None: + context = {} + res = [] + try: + res = super(mail_thread, self).message_route( + cr, uid, message, message_dict, model=model, + thread_id=thread_id, custom_values=custom_values, + context=context) + except ValueError as ve: + if context.get('error_notice_sent'): + # avoid raising exception and setting mail message UNSEEN + return [] + else: + raise ve + return res diff --git a/fetchmail_notify_error_to_sender/static/description/icon.png b/fetchmail_notify_error_to_sender/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..955b8138f60c5e0a115b989c2e9569cf53c880af GIT binary patch literal 3274 zcmb7{i8CAQ7RF;~qbNyHw6(=9wvVE=+QkxEYY$Ots^zmU6(zI?MM>38P;2bFqP9}C zwM6X{wQJCnT0h*}d;fqt_nkTCnRnhfGiT;E=b7`yni|8d)8C>8007tZ^|T*Q6!Y(( zyGqF)?>i1rgw{_}-<*zeLg`$vl>0SrJsUp&fPv-TK?TUn<^TW~J@mCT%!9Lca_p1t zSg`e9Zuox{=SxZ_4NLxJGmOG%M)ayzL_X56N!8>vgIcF_V6j(R_BC*XmoCj2Ic%je z0$Co~-7?#+oXnowKMw{C(MnM3LB#a=m~G$k4!|QLdTYkVH;!wRhg|NXL)uVoQ)lQb zwAZ2^YHwz4WBzQ9yX%oO2jkTj-T$X(wP__Flf0uhl71`bc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