summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Trigaux <mat@odoo.com>2020-04-23 09:29:30 +0000
committerMartin Trigaux <mat@odoo.com>2020-04-23 14:54:24 +0000
commit1f410436d68dc3234502a39041feef64ac6d4e5e (patch)
tree6e6a2c8eb1e351cf1a737d165002143daa9c83bb
parent70d1f903140d0ba5d902a1b2f7d2fe35791dd4e1 (diff)
[FIX] mail: remove unused route
The route is no longer used but was still present in the code. Processing email should be the job of the fetchmail server and they should not be injected directly from outside (even if emails are unauthenticated by design, mail servers may still have some say in the process). Courtesy of Alexandre Díaz closes odoo/odoo#50084 X-original-commit: ab70afb3963b0952e938ab39ef3dcb47ecc01f61 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
-rw-r--r--addons/mail/controllers/main.py15
1 files changed, 0 insertions, 15 deletions
diff --git a/addons/mail/controllers/main.py b/addons/mail/controllers/main.py
index 4f99295b937..7b03dcfd204 100644
--- a/addons/mail/controllers/main.py
+++ b/addons/mail/controllers/main.py
@@ -126,21 +126,6 @@ class MailController(http.Controller):
url = '/web?#%s' % url_encode(url_params)
return werkzeug.utils.redirect(url)
- @http.route('/mail/receive', type='json', auth='none')
- def receive(self, req):
- """ End-point to receive mail from an external SMTP server. """
- dbs = req.jsonrequest.get('databases')
- for db in dbs:
- message = base64.b64decode(dbs[db])
- try:
- db_registry = registry(db)
- with db_registry.cursor() as cr:
- env = api.Environment(cr, SUPERUSER_ID, {})
- env['mail.thread'].message_process(None, message)
- except psycopg2.Error:
- pass
- return True
-
@http.route('/mail/read_followers', type='json', auth='user')
def read_followers(self, follower_ids):
request.env['mail.followers'].check_access_rights("read")