From 0f98d9548cdba0506084b9a40d3e8fb1a26f3c80 Mon Sep 17 00:00:00 2001 From: Antoine Nguyen Date: Tue, 10 Jul 2018 11:18:22 +0200 Subject: [PATCH] Fix attempt for #1510. --- modoboa/lib/authbackends.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/modoboa/lib/authbackends.py b/modoboa/lib/authbackends.py index adf41feb7..9f8644726 100644 --- a/modoboa/lib/authbackends.py +++ b/modoboa/lib/authbackends.py @@ -16,7 +16,7 @@ from modoboa.parameters import tools as param_tools class SMTPBackend(object): """A backend to authenticate against an SMTP server.""" - def authenticate(self, username=None, password=None): + def authenticate(self, request, username=None, password=None): """Check the username/password and return a User.""" host = getattr(settings, "AUTH_SMTP_SERVER_ADDRESS", "localhost") port = getattr(settings, "AUTH_SMTP_SERVER_PORT", 25) @@ -113,10 +113,9 @@ try: pass return user - def authenticate(self, username, password): + def authenticate(self, *args, **kwargs): if self.global_params["authentication_type"] == "ldap": - return super(LDAPBackend, self).authenticate( - username=username, password=password) + return super(LDAPBackend, self).authenticate(*args, **kwargs) return None except ImportError: