#9575: email configuration using starttls
---------------------------------------+------------------------------------
Reporter: paigeadele | Owner: nobody
Status: closed | Milestone: post-1.0
Component: django.core.mail | Version: 1.0
Resolution: invalid | Keywords: starttls gmail
Stage: Unreviewed | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
---------------------------------------+------------------------------------
Comment (by kmtracey):
GMail's doc is surely lacking here. They throw out these ports and say
'use one' without giving any guidance on when each is appropriate,
probably because they figure the technical mumbo-jumbo required to explain
that would be over the heads of 99.9999% of their users. Which is true,
but still they could do a better job of indicating that probably one or
the other is going to work with any particular mail client, so try one and
if it doesn't work try the other.
587 is the one to use for any Python smtplib.SMTP() connection. 465 works
for others, I forget which, but I know I have seen reports of changing the
port to 465 being a solution. From the behavior of GMail's servers in
response to telneting to these ports, 465 apparently works for clients
that use a protocol where the client speaks first on the connection.
Python's smtplib does not speak first.
The problem with GMail's port 465 when using Python's smtplib.SMTP to send
mail is that GMail's servers accept a connection to port 465 but don't
send anything in response. Port 587, on the other hand, accepts the
connection and immediately sends something like "220 mx.google.com ESMTP
12sm15403552qbw.2". Python's routine that is establishing the mail
connection first creates a socket connection (which does have a timeout),
and then waits for the server to send a message on the connection (with no
timeout on the socket read). So, if the server never sends anything,
smtplib.SMTP() hangs. Presumably eventually the server on port 465 will
close this connection on which the client has sent no data, and that will
wake up the blocking read(), but I don't know how long that will take.
--
Ticket URL: <http://code.djangoproject.com/ticket/9575#comment:2>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---