Possible web2py bug sending emails

40 views
Skip to first unread message

Leonel Câmara

unread,
Apr 23, 2013, 11:15:11 PM4/23/13
to web...@googlegroups.com
Hey,

I have recently battled with not being able to send emails using the smtp server provided by the client.


I narrowed down the problem to emails being sent using TLS doing this

                if self.settings.tls and not self.settings.ssl:
                    server.ehlo()
                    server.starttls()
                    server.ehlo()

Turns out smtplib.ehlo() doesn't always give an acceptable hostname for what ESMTP servers want, like the domain you're actually using and the server will deny you if it's not accepting relays.


Can we change this to something like this:

                if self.settings.tls and not self.settings.ssl:
                    server.ehlo(self.settings.hostname)
                    server.starttls()
                    server.ehlo(self.settings.hostname)

Putting the hostname there, finally solved my problem but it wasn't a fun night.

Massimo Di Pierro

unread,
Apr 24, 2013, 12:20:34 AM4/24/13
to web...@googlegroups.com
aha! Thanks This solves my problem too. It is in trunk.

Leonel Câmara

unread,
Apr 24, 2013, 12:49:36 AM4/24/13
to web...@googlegroups.com
Awesome! I was afraid I would have to maintain a different web2py codebase for this client.


--
 
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/eY82X5I9XG8/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages