Ticket #9488: plain_auth.diff
File plain_auth.diff, 2.2 KB (added by , 16 years ago) |
---|
-
../django/core/mail.py
134 134 self.connection.starttls() 135 135 self.connection.ehlo() 136 136 if self.username and self.password: 137 self.connection.login(self.username, self.password) 137 if settings.EMAIL_FORCE_PLAIN_AUTH: 138 # Force plain auth: call ehlo() or helo() first to get the 139 # server's supported methods; then overwrite the results 140 if not (200 <= self.connection.ehlo()[0] <= 299): 141 (code, resp) = self.connection.helo() 142 if not (200 <= code <= 299): 143 raise SMTPHeloError(code, resp) 144 self.connection.esmtp_features["auth"] = "LOGIN PLAIN" 145 self.connection.login(self.username, self.password) 146 else: 147 self.connection.login(self.username, self.password) 138 148 return True 139 149 except: 140 150 if not self.fail_silently: -
django/conf/global_settings.py
139 139 EMAIL_HOST_USER = '' 140 140 EMAIL_HOST_PASSWORD = '' 141 141 EMAIL_USE_TLS = False 142 EMAIL_FORCE_PLAIN_AUTH = False 142 143 143 144 # List of strings representing installed apps. 144 145 INSTALLED_APPS = () -
docs/ref/settings.txt
373 373 This is only used if ``CommonMiddleware`` is installed (see 374 374 :ref:`topics-http-middleware`). 375 375 376 .. setting:: EMAIL_FORCE_PLAIN_AUTH 377 378 EMAIL_FORCE_PLAIN_AUTH 379 ---------------------- 380 381 Default: ``False`` 382 383 Force the transmission of the SMTP password (if any) in plain text. This can be 384 useful with certain SMTP servers which falsely claim to support CRAM-MD5. 385 386 See also ``EMAIL_HOST_USER`` and ``EMAIL_HOST_PASSWORD``. 387 376 388 .. setting:: EMAIL_HOST 377 389 378 390 EMAIL_HOST