STARTTLS extension not supported by server

M

Michele Simionato

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
 
P

Paul Rubin

Michele Simionato said:
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.
 
M

Michele Simionato

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top