STARTTLS extension not supported by server

  • Follow


I have a CentOS machine with Python 2.4 and I wanted to install Python
2.7 on it. The installation went fine but now I have a problem with
a script sending email via TLS authentication. If I do something like

import smtplib
smtpO = smtplib.SMTP(<server>)
smtpO.ehlo()
smtpO.starttls()

I get the following error:

Traceback (most recent call last):
  File "y.py", line 5, in <module>
    smtpO.starttls()
  File "/home/rcare/lib/python2.7/smtplib.py", line 614, in starttls
    raise SMTPException("STARTTLS extension not supported by server.")
smtplib.SMTPException: STARTTLS extension not supported by server.

Notice that this not a problem of the SMTP server, since with Python
2.4 the script is connecting to the SMTP server
just fine. At first I thought the problem was with the ssl support, I
recompiled the module, but I still get
the same error. Do you have any suggestion to be debug the issue and
to figure out where the problem is?
TIA,

     Michele Simionato
0
Reply Michele 11/15/2010 2:36:12 PM

Michele Simionato <michele.simionato@gmail.com> writes:
> Notice that this not a problem of the SMTP server, since with Python
> 2.4 the script is connecting to the SMTP server

Um, my guess is that 2.4 didn't attempt to use TLS at all, and your 2.7
installation doesn't have the TLS libraries installed or they're not
configured where Python can find them.
0
Reply Paul 11/15/2010 7:25:12 PM


For future googlers: it turns out in my case the call to .starttls()
was not needed: I removed it and everything worked. Dunno why I was
there in the first place, the original code was written by somebody
else.
0
Reply Michele 11/29/2010 8:45:01 AM

2 Replies
787 Views

(page loaded in 0.097 seconds)

Similiar Articles:













7/22/2012 1:23:22 PM


Reply: