[ckan-dev] ckan mailer problem

Hildegard Gerlach hildegard.gerlach at jrc.ec.europa.eu
Fri Nov 25 11:04:18 UTC 2016


Hi,

I have a problem with the ckan mailer
https://github.com/ckan/ckan/blob/master/ckan/lib/mailer.py

Actually we are using Ckan version 2.5.1 but my problem should remain 
the same.
https://github.com/ckan/ckan/blob/release-v2.5.1/ckan/lib/mailer.py

I am sending an email from the ckan application using 
_mail_recipient()   without using smtp_user and smtp_password.
The problem is that our mailserver does not understand the command "ehlo"

     send: 'ehlo h06-tst-bisorepo.jrc.it\r\n'
     reply: '500 5.5.1 Command unrecognized: "XXXX 
h06-tst-bisorepo.jrc.it"\r\n'
     reply: retcode (500); Msg: 5.5.1 Command unrecognized: "XXXX 
h06-tst-bisorepo.jrc.it"

but it understands "helo"
The ckan mailer sends the method
     smtp_connection.ehlo()
line  69 (master) which causes the problem.
Also in line 77 if smtp_user is set.

If I comment this line or call the method
     smtp_connection.ehlo_or_helo_if_needed()
instead, the message is sent. In theory it should not even be necessary 
to call smtp_connection.ehlo(), as inside the method
smtp_connection.sendmail()
there is again   self.ehlo_or_helo_if_needed()

In fact, the message is sent if I just comment smtp_connection.ehlo()


Could this not be changed in a future Ckan release ?
substitute  smtp_connection.ehlo()   with 
smtp_connection.ehlo_or_helo_if_needed()

Another small suggestion:
In version 2.5.1 there is a commented line
#smtp_connection.set_debuglevel(True)     in 
https://github.com/ckan/ckan/blob/release-v2.5.1/ckan/lib/mailer.py line 61

It has disappeared in the master. I propose to put it back again as it 
was quite useful in my case.

Thanks

Hilde



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20161125/babd49d1/attachment-0002.html>


More information about the ckan-dev mailing list