diff --git a/mailgun/README.rst b/mailgun/README.rst deleted file mode 100644 index 44353b2..0000000 --- a/mailgun/README.rst +++ /dev/null @@ -1,39 +0,0 @@ -.. image:: https://itpp.dev/images/infinity-readme.png - :alt: Tested and maintained by IT Projects Labs - :target: https://itpp.dev - -.. image:: https://img.shields.io/badge/license-MIT-blue.svg - :target: https://opensource.org/licenses/MIT - :alt: License: MIT - -========= - Mailgun -========= - -The module allows to receive incoming messages or send them to clients who uses external mail services (e.g. gmail.com) by using 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. - -Questions? -========== - -To get an assistance on this module contact us by email :arrow_right: help@itpp.dev - -Contributors -============ -* Ildar Nasyrov -* Ivan Yelizariev - -=================== - -Odoo Apps Store: https://apps.odoo.com/apps/modules/11.0/mailgun/ - - -Notifications on updates: `via Atom `_, `by Email `_ - -Tested on `Odoo 11.0 `_ diff --git a/mailgun/__init__.py b/mailgun/__init__.py deleted file mode 100644 index 91c5580..0000000 --- a/mailgun/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from . import controllers -from . import models diff --git a/mailgun/__manifest__.py b/mailgun/__manifest__.py deleted file mode 100644 index 5be0ac2..0000000 --- a/mailgun/__manifest__.py +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright 2018 Ildar Nasyrov -# License MIT (https://opensource.org/licenses/MIT). -{ - "name": """Mailgun""", - "summary": """Setup the outgoing and incoming mail flow easily by using Mailgun""", - "category": "Discuss", - # "live_test_url": "http://apps.it-projects.info/shop/product/mailgun?version=11.0", - "images": ["images/mailgun_main.png"], - "version": "11.0.1.1.0", - "application": False, - "author": "IT-Projects LLC, Ildar Nasyrov", - "support": "apps@itpp.dev", - "website": "https://itpp.dev", - "license": "Other OSI approved licence", # MIT - "price": 389.00, - "currency": "EUR", - "depends": ["mail"], - "external_dependencies": {"python": [], "bin": []}, - "data": ["data/ir_cron_data.xml"], - "demo": [], - "qweb": [], - "post_load": None, - "pre_init_hook": None, - "post_init_hook": None, - "uninstall_hook": None, - "auto_install": False, - "installable": True, - "demo_title": "Mailgun", - "demo_addons": [], - "demo_addons_hidden": [], - "demo_url": "mailgun", - "demo_summary": "Easy to send outgoing and fetch incoming messages by using Mailgun", - "demo_images": ["images/mailgun_main.png"], -} diff --git a/mailgun/controllers/__init__.py b/mailgun/controllers/__init__.py deleted file mode 100644 index 12a7e52..0000000 --- a/mailgun/controllers/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from . import main diff --git a/mailgun/controllers/main.py b/mailgun/controllers/main.py deleted file mode 100644 index 41ee802..0000000 --- a/mailgun/controllers/main.py +++ /dev/null @@ -1,16 +0,0 @@ -import re - -from odoo import http -from odoo.http import request - - -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 re.match("^https://[^/]*api.mailgun.net/", message_url): - # 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/data/ir_cron_data.xml b/mailgun/data/ir_cron_data.xml deleted file mode 100644 index 559fc96..0000000 --- a/mailgun/data/ir_cron_data.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - Mailgun - domain verification request - - 10 - minutes - 10 - code - model.mailgun_verify() - - - - diff --git a/mailgun/doc/changelog.rst b/mailgun/doc/changelog.rst deleted file mode 100644 index 8f24aaa..0000000 --- a/mailgun/doc/changelog.rst +++ /dev/null @@ -1,10 +0,0 @@ -`1.1.0` -------- - -- ADD: automatic domain verification - -------- -`1.0.0` -------- - -- Init version diff --git a/mailgun/doc/index.rst b/mailgun/doc/index.rst deleted file mode 100644 index f235356..0000000 --- a/mailgun/doc/index.rst +++ /dev/null @@ -1,93 +0,0 @@ -========= - Mailgun -========= - -Installation -============ - -* `Install `__ this module in a usual way - -Configuration -============= - -Mailgun-side ------------- - -* register or log in http://mailgun.com -* Open menu ``[[ Domains ]]`` and click on your domain, e.g. ``sandbox123*****.mailgun.org`` domain. Here you can see all the information needed to configure odoo outgoing mail feature -* Please note that state of your domain should be ``Active`` before you can use it. If it is ``Unverified``, verify it first using Mailgun FAQ - `How do I verify my domain `__ -* if you are using your sandbox domain, add Authorized Recipient first (Sandbox domains are restricted to `authorized recipients `__ only) -* create new Route - - * Open menu ``[[ Routes ]]`` - * Click ``[Create Route]`` button - - * **Expression Type** - ``Custom`` - * **Raw Expression** - ``match_recipient('.*@')`` - * **Actions** - ``Store and notify``, ``http:///mailgun/notify`` - -Odoo-side ---------- - -* `Activate Developer Mode `__ -* Configure **Outgoung mail server** - - * Open menu ``[[ Settings ]] >> Technical >> Email >> Outgoing Mail Servers`` - * Edit ``localhost`` record or create new one with the following: - - * **Description** - ``Mailgun`` - * **SMTP Server** - take from Mailgun **SMTP Hostname** (usually, it is ``smtp.mailgun.org``) - * **Connection Security** - ``SSL/TLS`` - * **Username** - take from Mailgun **Default SMTP Login** - * **Password** - take from Mailgun **Default Password** - * Click ``[Test Connection]`` button to check the connection and then ``[Save]`` - -* Configure **Incoming mail feature** - - * Configure catchall domain - - * Open menu ``Settings / General Settings``, check **External Email Servers** and edit **Alias Domain** - set it from Mailgun **Domain Name** - * Click ``[Save]`` button - - * Set Mailgun API credentials - - * Open menu ``[[ Settings ]] >> Parameters >> System Parameters`` - * Create new parameter - - * key: ``mailgun.apikey`` - * Value: API Key from mailgun (``key-...``) - * Click ``[Save]`` button - - * Configure mail aliases and emails for users - - * Open menu ``[[ Settings ]] >> Users >> Users`` - * Select the ``Administrator`` user (for example, you should configure all your users the same way but using different aliases) and click ``[Edit]`` - * On Preference tab edit **Alias** field - create new mail alias, e.g. ``admin@`` with the following settings - - * **Alias Name** - ``admin`` - * **Aliased Model** - ``Users`` - * **Record Thread ID** - ``1`` - * **Default Values** - ``{}`` - * **Alias Contact** - ``Everyone`` - * **Security Owner** - ``Administrator`` - * **Parent Model** - Not set - * **Parent Record Thread ID** - ``0`` - - * Open user's **Related Partner** and edit **Email** field - usually it should be the same as mail alias name (``admin@> Email >> Emails`` to create a message -* Click ``[Send Now]`` button -* RESULT: receive the message in your mail client (e.g. on gmail.com) - -Incoming --------- - -* Create new message from your mail client to e.g. ``admin@`` -* Open menu ``[[ Discuss ]]`` in Odoo -* RESULT: See your message there diff --git a/mailgun/i18n/es.po b/mailgun/i18n/es.po deleted file mode 100644 index 3a8cb96..0000000 --- a/mailgun/i18n/es.po +++ /dev/null @@ -1,37 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * mailgun -# -# Translators: -# Randall Castro , 2018 -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 10.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-12-19 16:49+0000\n" -"PO-Revision-Date: 2017-12-19 16:49+0000\n" -"Last-Translator: Randall Castro , 2018\n" -"Language-Team: Spanish (https://www.transifex.com/it-projects-llc/" -"teams/76080/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: mailgun -#: model:ir.model,name:mailgun.model_mail_thread -msgid "Email Thread" -msgstr "Hilo de correo electrónico" - -#. module: mailgun -#: model:ir.actions.server,name:mailgun.mailgun_domain_verification_ir_actions_server -#: model:ir.cron,cron_name:mailgun.mailgun_domain_verification -#: model:ir.cron,name:mailgun.mailgun_domain_verification -msgid "Mailgun - domain verification request" -msgstr "" - -#. module: mailgun -#: model:ir.model,name:mailgun.model_ir_config_parameter -msgid "ir.config_parameter" -msgstr "ir.config_parameter" diff --git a/mailgun/i18n/mailgun.pot b/mailgun/i18n/mailgun.pot deleted file mode 100644 index 253ffe9..0000000 --- a/mailgun/i18n/mailgun.pot +++ /dev/null @@ -1,32 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * mailgun -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 11.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: mailgun -#: model:ir.model,name:mailgun.model_mail_thread -msgid "Email Thread" -msgstr "" - -#. module: mailgun -#: model:ir.actions.server,name:mailgun.mailgun_domain_verification_ir_actions_server -#: model:ir.cron,cron_name:mailgun.mailgun_domain_verification -#: model:ir.cron,name:mailgun.mailgun_domain_verification -msgid "Mailgun - domain verification request" -msgstr "" - -#. module: mailgun -#: model:ir.model,name:mailgun.model_ir_config_parameter -msgid "ir.config_parameter" -msgstr "" - diff --git a/mailgun/images/mailgun_main.png b/mailgun/images/mailgun_main.png deleted file mode 100644 index 5916699..0000000 Binary files a/mailgun/images/mailgun_main.png and /dev/null differ diff --git a/mailgun/models/__init__.py b/mailgun/models/__init__.py deleted file mode 100644 index 4964261..0000000 --- a/mailgun/models/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from . import mail_thread -from . import ir_config_parameter diff --git a/mailgun/models/ir_config_parameter.py b/mailgun/models/ir_config_parameter.py deleted file mode 100644 index e318dd8..0000000 --- a/mailgun/models/ir_config_parameter.py +++ /dev/null @@ -1,33 +0,0 @@ -import logging - -import requests - -from odoo import api, models - -try: - import simplejson as json -except ImportError: - import json - - -_logger = logging.getLogger(__name__) - - -class IrConfigParameter(models.Model): - _inherit = ["ir.config_parameter"] - - @api.model - def mailgun_verify(self): - verified = self.sudo().get_param("mailgun.verified") - if verified: - return - api_key = self.sudo().get_param("mailgun.apikey") - mail_domain = self.sudo().get_param("mail.catchall.domain") - if api_key and mail_domain: - url = "https://api.mailgun.net/v3/domains/%s/verify" % mail_domain - res = requests.put(url, auth=("api", api_key)) - if ( - res.status_code == 200 - and json.loads(res.text)["domain"]["state"] == "active" - ): - self.sudo().set_param("mailgun.verified", "1") diff --git a/mailgun/models/mail_thread.py b/mailgun/models/mail_thread.py deleted file mode 100644 index 9e5644f..0000000 --- a/mailgun/models/mail_thread.py +++ /dev/null @@ -1,22 +0,0 @@ -import logging - -import requests - -from odoo import api, models - -_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), - verify=False, - ) - self.message_process(False, res.json().get("body-mime")) diff --git a/mailgun/static/description/icon.png b/mailgun/static/description/icon.png deleted file mode 100644 index 79f7d8f..0000000 Binary files a/mailgun/static/description/icon.png and /dev/null differ diff --git a/mailgun/static/description/index.html b/mailgun/static/description/index.html deleted file mode 100644 index a5438f3..0000000 --- a/mailgun/static/description/index.html +++ /dev/null @@ -1,334 +0,0 @@ -
-
-
-

Mailgun

-

Easy to setup the outgoing and incoming mail flow

-
-
-
- -
-
-
-

-

- The module provides Odoo and Mailgun integration to be able to easily configure Outgoing and Incoming mail flow. -
- From Mailgun side you get: -
    -
  • - Powerful Sending Infrastructure -
  • -
  • - Intelligent Inbound Routing & Storage -
  • -
  • - Tracking and Analytics -
  • -
  • - Email Validation -
  • -
-
-
-

-
-
-
- -
-
-

Mailgun Configuration

-

Manage Domains

-
-

- -

    -
  • - Create account on Mailgun service -
  • -
  • - Add domain in Domains menu -
  • -
- Note that the state of your domain should be Active to be able to use it from Odoo side. To verify it follow the instruction How do I verify my domain - -

-
-
- -
-
-
- -
-
-
-

- - Click on added domain name and see all the information needed to configure your Incoming and Outgoing mail feature. - -

-
-
- -
-
-
- -
-
-
-

- - If you use sandbox domain, add Authorized Recipient first (sandbox domains are restricted to authorized recipients) - -

-
-
- -
-
-
- -
-
-
- -
-
-

Routes

-
-

- - Navigate to Routes menu and create a new route - -

-
-
- -
-
-
- -
-
-
-

- - Set the following fields and values: -

    -
  • - Expression Type: Custom -
  • -
  • - Raw Expression: match_recipient('.*@your_mail_domain') -
  • -
  • - Actions: -
      -
    • - Check the box Store and notify -
    • -
    • - Put there http://your_odoo_domain/mailgun/notify -
    • - -
    -
    -

    -
-
- -
-
-

- - Now everything is ready to move to Odoo configuration. - -

-
-
-
- -
-
-

Odoo Configuration

-

Outgoing Mail Feature

-
-

- - At first, activate the developer mode. Then go to Settings → Technical → Email → Outgoing Mail Servers menu and populate the following fields: -

    -
  • - Description - e.g. Mailgun -
  • -
  • - SMTP Server - smtp.mailgun.org -
  • -
  • - Connection Security - SSL/TLS -
  • -
  • - Username - use Default SMTP Login from mailgun -
  • -
  • - Password - use Default Password from mailgun -
  • -
- Once the fields are populated, click Test Connection button to check the connection to smtp server. If everything is ok, you can see popup message Connection Test Succeeded! Everything seems properly set up! and you are able to send messages now. - -

-
-
- -
-
-
- -
-
-

Incoming Mail Feature

-
-

- - Note that to setup incoming mailing, it is not required to setup Incoming Mail Server. -
- Open Settings → General Settings menu: -

    -
  • - Check the box External Email Servers -
  • -
  • - Set as Alias Domain the domain name from Mailgun -
  • -
- Save the changes. - -

-
-
- -
-
-
- -
-
-
-

- - Setup mailgun API credentials in Settings → Parameters → System Parameters menu. Create new parameter: -

    -
  • - Key - mailgun.apikey -
  • -
  • - Value - key-12345... -
  • -
- -

-
-
- -
-
-
- -
-
-
-

- - Now you can configure mail aliases for users. Go to Settings → Users menu and open user form (e.g. for Administrator). Then switch to Preferences tab and select an existing alias or create new one in the Alias field. - -

-
-
- -
-
-
- -
-
-
-

- - Open the user's related partner and set Email - the email is used for replying on user messages - -

-
-
- -
-
-
- -
-
-
-

- - - Everything is done! It's time to send/receive email messages now! - - -

-
-
-
- -
-
-
-

Need our service?

-

Contact us by email or fill out request form

- -
-
-
-
- Tested on Odoo
11.0 community -
-
- Tested on Odoo
11.0 enterprise -
-
-
-
-
diff --git a/mailgun/static/description/mailgun_add_domain.png b/mailgun/static/description/mailgun_add_domain.png deleted file mode 100644 index 9482ca5..0000000 Binary files a/mailgun/static/description/mailgun_add_domain.png and /dev/null differ diff --git a/mailgun/static/description/mailgun_auth_recipients.png b/mailgun/static/description/mailgun_auth_recipients.png deleted file mode 100644 index fc6c256..0000000 Binary files a/mailgun/static/description/mailgun_auth_recipients.png and /dev/null differ diff --git a/mailgun/static/description/mailgun_auth_recipients_form.png b/mailgun/static/description/mailgun_auth_recipients_form.png deleted file mode 100644 index 3587c41..0000000 Binary files a/mailgun/static/description/mailgun_auth_recipients_form.png and /dev/null differ diff --git a/mailgun/static/description/mailgun_domain_details.png b/mailgun/static/description/mailgun_domain_details.png deleted file mode 100644 index 9d67644..0000000 Binary files a/mailgun/static/description/mailgun_domain_details.png and /dev/null differ diff --git a/mailgun/static/description/mailgun_odoo_general.png b/mailgun/static/description/mailgun_odoo_general.png deleted file mode 100644 index a9c325b..0000000 Binary files a/mailgun/static/description/mailgun_odoo_general.png and /dev/null differ diff --git a/mailgun/static/description/mailgun_odoo_mail_alias.png b/mailgun/static/description/mailgun_odoo_mail_alias.png deleted file mode 100644 index 39f28d6..0000000 Binary files a/mailgun/static/description/mailgun_odoo_mail_alias.png and /dev/null differ diff --git a/mailgun/static/description/mailgun_odoo_outgoing.png b/mailgun/static/description/mailgun_odoo_outgoing.png deleted file mode 100644 index 5edb0a1..0000000 Binary files a/mailgun/static/description/mailgun_odoo_outgoing.png and /dev/null differ diff --git a/mailgun/static/description/mailgun_odoo_partner_email.png b/mailgun/static/description/mailgun_odoo_partner_email.png deleted file mode 100644 index 9b22e70..0000000 Binary files a/mailgun/static/description/mailgun_odoo_partner_email.png and /dev/null differ diff --git a/mailgun/static/description/mailgun_odoo_sys_param.png b/mailgun/static/description/mailgun_odoo_sys_param.png deleted file mode 100644 index 597574d..0000000 Binary files a/mailgun/static/description/mailgun_odoo_sys_param.png and /dev/null differ diff --git a/mailgun/static/description/mailgun_route.png b/mailgun/static/description/mailgun_route.png deleted file mode 100644 index 028b889..0000000 Binary files a/mailgun/static/description/mailgun_route.png and /dev/null differ diff --git a/mailgun/static/description/mailgun_route_form.png b/mailgun/static/description/mailgun_route_form.png deleted file mode 100644 index 6cdd7b5..0000000 Binary files a/mailgun/static/description/mailgun_route_form.png and /dev/null differ