[ckan-dev] ckan mailer problem

Stefan Oderbolz stefan.oderbolz at liip.ch
Mon Nov 28 11:04:47 UTC 2016


Hi Hildegard,

this sound like a good suggestion, and it seems you already spent quite
some time digging in the code. Maybe you could create a Pull Request on
GitHub, so this could be discussed on a code level?
This would make it a lot easier to follow all the changes and see the
dependencies to other modules/eariler version etc.

What do you think?

Best regards Stefan

On Fri, Nov 25, 2016 at 12:04 PM, Hildegard Gerlach <
hildegard.gerlach at jrc.ec.europa.eu> wrote:

> 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
>
>
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
>
>


-- 
Liip AG  // Limmatstrasse 183 //  CH-8005 Zürich
Tel +41 43 500 39 80 // GnuPG 0x7B588C67 // www.liip.ch
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20161128/692aa164/attachment-0003.html>


More information about the ckan-dev mailing list