Add setting to force plain SMTP authentication
|Reported by:||jdemoor||Owned by:||nobody|
|Severity:||Keywords:||authentication email smtp|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
A wrongly configured SMTP server that requires authentication can advertise CRAM-MD5 as an accepted authentication method but fail when the client tries to use it. Most email clients would try other methods after the failure, but Python's smtplib just raises SMTPAuthException. This makes sending emails from Django with such servers impossible.
The attached patch adds the EMAIL_FORCE_PLAIN_AUTH setting which, if True, forces the use of the PLAIN method in django.core.mail.SMTPConnection.open().