[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>
This commit is contained in:
Martin Trigaux
2020-04-23 14:54:24 +00:00
parent 70d1f90314
commit 1f410436d6
-15
View File
@@ -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")