<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1256">
<style type="text/css" id="owaParaStyle"></style>
</head>
<body fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">
<div><span style="font-size: 10pt;">Dear all,</span></div>
<div><br>
</div>
<div>I'm using GeoNode 2.10.x and want to send mails by using an Exchange 2013 server which only supports NTLM for SMTP authentification. I realized that the default email backend in GeoNode `django.core.mail.backends.smtp.EmailBackend` only supports LOGIN,
PLAIN or CRAM-MD5 for authentication. Luckily, I found another backend (https://github.com/shadiakiki1986/django-smtp-ntlm-backend) for NTLM authentication. But it does not work. </div>
<div><br>
</div>
<div>I did the following in the Python shell:</div>
<div><br>
</div>
<div><font face="Consolas">>>> from django.core.mail import send_mail</font></div>
<div><font face="Consolas">>>> send_mail('test subject', 'message', 'email@address.com', ['recipient@gmail.com'], fail_silently=False,)</font></div>
<div><font face="Consolas">Traceback (most recent call last):</font></div>
<div><font face="Consolas"> File "<stdin>", line 1, in <module></font></div>
<div><font face="Consolas"> File "/usr/local/lib/python2.7/site-packages/django/core/mail/__init__.py", line 62, in send_mail</font></div>
<div><font face="Consolas"> return mail.send()</font></div>
<div><font face="Consolas"> File "/usr/local/lib/python2.7/site-packages/django/core/mail/message.py", line 348, in send</font></div>
<div><font face="Consolas"> return self.get_connection(fail_silently).send_messages([self])</font></div>
<div><font face="Consolas"> File "/usr/local/lib/python2.7/site-packages/django/core/mail/backends/smtp.py", line 111, in send_messages</font></div>
<div><font face="Consolas"> sent = self._send(message)</font></div>
<div><font face="Consolas"> File "/usr/local/lib/python2.7/site-packages/django/core/mail/backends/smtp.py", line 127, in _send</font></div>
<div><font face="Consolas"> self.connection.sendmail(from_email, recipients, message.as_bytes(linesep='\r\n'))</font></div>
<div><font face="Consolas"> File "smtplib.py", line 736, in sendmail</font></div>
<div><font face="Consolas"> self.rset()</font></div>
<div><font face="Consolas"> File "smtplib.py", line 470, in rset</font></div>
<div><font face="Consolas"> return self.docmd("rset")</font></div>
<div><font face="Consolas"> File "smtplib.py", line 395, in docmd</font></div>
<div><font face="Consolas"> return self.getreply()</font></div>
<div><font face="Consolas"> File "smtplib.py", line 369, in getreply</font></div>
<div><font face="Consolas"> raise SMTPServerDisconnected("Connection unexpectedly closed")</font></div>
<div><font face="Consolas">smtplib.SMTPServerDisconnected: Connection unexpectedly closed</font></div>
<div><br>
</div>
<div><br>
</div>
<div>Relevant settings in settings.py:</div>
<div><br>
</div>
<div><font face="Consolas">EMAIL_ENABLE=True</font></div>
<div><font face="Consolas">EMAIL_BACKEND=django_smtp_ntlm_backendNTLMEmail </font></div>
<div><font face="Consolas">EMAIL_HOST=<mailserver></font></div>
<div><font face="Consolas">EMAIL_PORT=25</font></div>
<div><font face="Consolas">EMAIL_HOST_USER=<domain>\<user></font></div>
<div><font face="Consolas">EMAIL_HOST_PASSWORD=<password></font></div>
<div><font face="Consolas">DEFAULT_FROM_EMAIL=<from-email></font></div>
<div><font face="Consolas">EMAIL_USE_SSL=False </font></div>
<div><font face="Consolas">EMAIL_USE_TLS=False</font></div>
<div><br>
</div>
<div><br>
</div>
<div>The settings for the mail server are correct and the mail server is working fine. I am able to send mails with a SMTP testing tool called Swaks with the same settings using the same mail server. Does anybody has experience with using Exchange and NTLM
authentication for sending emails with GeoNode? Or is there any other email backend I can use? I'm grateful for any hints.</div>
<div><br>
</div>
<div>Best regards</div>
<div>Fabian</div>
</div>
</body>
</html>