diff --git a/mail_all/__openerp__.py b/mail_all/__openerp__.py index 6737443..e15786b 100644 --- a/mail_all/__openerp__.py +++ b/mail_all/__openerp__.py @@ -3,7 +3,7 @@ "name": "Show all messages", "summary": """Checkout all messages where you have access""", "category": "Discuss", - "images": [], + "images": ['images/1.png'], "version": "1.0.0", "author": "IT-Projects LLC, Pavel Romanchenko", diff --git a/mail_all/images/1.png b/mail_all/images/1.png new file mode 100644 index 0000000..c5f0307 Binary files /dev/null and b/mail_all/images/1.png differ diff --git a/mail_archives/__openerp__.py b/mail_archives/__openerp__.py index 761bb6b..5416189 100644 --- a/mail_archives/__openerp__.py +++ b/mail_archives/__openerp__.py @@ -3,7 +3,7 @@ "name": "Mail archives", "summary": """Adds menu to find old messages""", "category": "Discuss", - "images": [], + "images": ['images/1.jpg'], "version": "1.0.0", "author": "IT-Projects LLC, Pavel Romanchenko", diff --git a/mail_base/static/description/icon.png b/mail_base/static/description/icon.png new file mode 100644 index 0000000..79f7d8f Binary files /dev/null and b/mail_base/static/description/icon.png differ diff --git a/mail_fix_553/README.rst b/mail_fix_553/README.rst index a1cc034..e259bd6 100644 --- a/mail_fix_553/README.rst +++ b/mail_fix_553/README.rst @@ -18,6 +18,7 @@ Configuration ============= You can configure default alias at Settings -> System Parameters -> mail.catchall.alias_from +You can configure name for default alias at Settings -> System Parameters -> mail.catchall.name_alias_from You can configure name for default alias at Settings -> System Parameters -> mail.catchall.name_alias_from diff --git a/mail_sent/__openerp__.py b/mail_sent/__openerp__.py index 7e3895b..a4c5609 100644 --- a/mail_sent/__openerp__.py +++ b/mail_sent/__openerp__.py @@ -3,7 +3,7 @@ "name": "Sentbox", "summary": """Quick way to find sent messages""", "category": "Discuss", - "images": [], + "images": ['images/menu.png'], "version": "1.0.3", "author": "IT-Projects LLC, Ivan Yelizariev, Pavel Romanchenko", diff --git a/mail_sent/images/menu.png b/mail_sent/images/menu.png new file mode 100644 index 0000000..926661c Binary files /dev/null and b/mail_sent/images/menu.png differ diff --git a/mail_to/__openerp__.py b/mail_to/__openerp__.py index 37f15d0..40b1ccd 100644 --- a/mail_to/__openerp__.py +++ b/mail_to/__openerp__.py @@ -3,7 +3,7 @@ "name": """Show message recipients""", "summary": """Allows you be sure, that all discussion participants were notified""", "category": "Discuss", - "images": [], + "images": ['images/1.png'], "version": "1.0.0", "author": "IT-Projects LLC, Pavel Romanchenko", diff --git a/mail_to/images/1.png b/mail_to/images/1.png new file mode 100644 index 0000000..6950f93 Binary files /dev/null and b/mail_to/images/1.png differ diff --git a/mail_to/static/description/icon.png b/mail_to/static/description/icon.png new file mode 100644 index 0000000..79f7d8f Binary files /dev/null and b/mail_to/static/description/icon.png differ diff --git a/mailgun/README.rst b/mailgun/README.rst new file mode 100644 index 0000000..4d45817 --- /dev/null +++ b/mailgun/README.rst @@ -0,0 +1,36 @@ +========= + Mailgun +========= + +With this module you can receive incoming messages from mailgun. +There is no IMAP or POP3 servers on mailgun that is to be used with odoo. +That is why we need this module. It fetches messages from mailgun using their API +and stores them in odoo. + +TODO +==== + +* If emails are sent when odoo is stopped then Mailgun will retry (other than for delivery notification) during 8 hours at the following intervals before stop trying: 10 minutes, 10 minutes, 15 minutes, 30 minutes, 1 hour, 2 hour and 4 hours. This could be fixed by fetching undelivered messages after odoo starts. + +Credits +======= + +Contributors +------------ +* Ildar Nasyrov +* Ivan Yelizariev + +Sponsors +-------- +* `IT-Projects LLC `_ + +Further information +=================== + +HTML Description: https://apps.odoo.com/apps/modules/9.0/mailgun/ + +Usage instructions: ``_ + +Changelog: ``_ + +Tested on Odoo 9.0 c8cd67c5d98b410cabe0a6efb3347a8a4de731d8 diff --git a/mailgun/__init__.py b/mailgun/__init__.py new file mode 100644 index 0000000..43dbbaa --- /dev/null +++ b/mailgun/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- +import controllers +import models diff --git a/mailgun/__openerp__.py b/mailgun/__openerp__.py new file mode 100644 index 0000000..50f9277 --- /dev/null +++ b/mailgun/__openerp__.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +{ + 'name': "Mailgun", + 'author': "IT-Projects LLC, Ildar Nasyrov", + 'license': 'LGPL-3', + 'website': "https://twitter.com/nasyrov_ildar", + 'category': 'Discuss', + 'version': '1.0.0', + 'depends': ['mail'], + 'data': [ + ], +} diff --git a/mailgun/controllers/__init__.py b/mailgun/controllers/__init__.py new file mode 100644 index 0000000..a84d81a --- /dev/null +++ b/mailgun/controllers/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +import main diff --git a/mailgun/controllers/main.py b/mailgun/controllers/main.py new file mode 100644 index 0000000..a8a7d9a --- /dev/null +++ b/mailgun/controllers/main.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +from openerp.addons.web import http +from openerp.addons.web.http import request +import werkzeug +import email +import requests +import simplejson + +class MailMailgun(http.Controller): + + @http.route('/mailgun/notify', auth='public', type='http', csrf=False) + def mailgun_notify(self, **kw): + # mailgun notification in json format + message_url = kw.get('message-url') + if not message_url.startswith('https://api.mailgun.net/'): + # simple security check failed + raise Exception('wrong message-url') + request.env['mail.thread'].sudo().mailgun_fetch_message(message_url) + return 'ok' diff --git a/mailgun/doc/index.rst b/mailgun/doc/index.rst new file mode 100644 index 0000000..a632863 --- /dev/null +++ b/mailgun/doc/index.rst @@ -0,0 +1,55 @@ +========= + Mailgun +========= + +Usage +===== + +* register or log in http://mailgun.com +* On https://mailgun.com/app/domains click on you domain, e.g. sandbox123...mailgun.org domain. Here you can see all information needed to configure odoo outgoing mail feature + * if you in sandbox domain, add Authorized Recepient + * Copy API Key value into odoo + + * Open menu ``Settings / Parameters / System Parameters`` + * Create new parameter + + * key: ``mailgun.apikey`` + * Value: API Key from mailgun (``key-...``) + * click Save + + * Copy smtp credentials into odoo + + * open ``Settings / Technical / Email / Outgoing Mail Servers`` + + * delete localhost + * create new server + + * Description: ``mailgun`` + * SMTP Server: ``smtp.mailgun.org`` + * Connection Security: ``SSL/TLS`` + * Username: e.g. ``postmaster@sandbox123....mailgun.org`` + * Password: ``...`` (copy ``Default Password`` from mailgun) + + * From odoo menu ``Settings / General Settings`` edit Alias Domain + + * Put your mailgun domain here. E.g. sandbox123...mailgun.org + * Click 'Apply' button + +* From https://mailgun.com/cp/routes create new route + + * Priority: ``0`` + * Filter expression: ``catch_all()`` + * Actions: ``store(notify="http:///mailgun/notify")`` + +* Set admin's email alias. Open menu ``Settings / Users / Users`` + + * choose your user and click ``[Edit]`` + * On Preference tab put alias into Messaging Alias field and click ``[Save]``. E.g. ``admin@sandbox...mailgun.org`` + +* Via your favorite mail client (e.g. gmail.com) send email to ``admin@sandox...mailgun.org`` +* Open ``Discuss`` in odoo +* See your message there +* Reply to the message and check it in your mail client (e.g. gmail.com) + + + diff --git a/mailgun/models.py b/mailgun/models.py new file mode 100644 index 0000000..5a246b4 --- /dev/null +++ b/mailgun/models.py @@ -0,0 +1,21 @@ +import requests +import time +import dateutil +import pytz + +from openerp import models, api + +from openerp.addons.mail.models.mail_message import decode +from openerp.addons.mail.models.mail_thread import mail_header_msgid_re + +import logging +_logger = logging.getLogger(__name__) + +class MailThread(models.AbstractModel): + _inherit = 'mail.thread' + + @api.model + def mailgun_fetch_message(self, message_url): + api_key = self.env['ir.config_parameter'].sudo().get_param('mailgun.apikey') + res = requests.get(message_url, headers={'Accept': 'message/rfc2822'}, auth=('api', api_key)) + self.message_process(False, res.json().get('body-mime')) diff --git a/res_partner_mails_count/__openerp__.py b/res_partner_mails_count/__openerp__.py index e2ca849..ed59ee1 100644 --- a/res_partner_mails_count/__openerp__.py +++ b/res_partner_mails_count/__openerp__.py @@ -2,7 +2,7 @@ { "name": """Partner mails count""", "summary": """Displays amount of incoming and outgoing partner mails.""", - "category": "Sales Management", + "category": "Discuss", "images": ['images/1.png'], "version": "1.0.0",