Bug 77354 - Mail Merge E-mail test: "No SSL support included in this Python"
Summary: Mail Merge E-mail test: "No SSL support included in this Python"
Status: RESOLVED NOTOURBUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
4.3.5.2 release
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on: 45364
Blocks:
  Show dependency treegraph
 
Reported: 2014-04-12 01:24 UTC by ronn
Modified: 2017-08-08 11:06 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ronn 2014-04-12 01:24:40 UTC
E-mail merges don't work with SSL/TLS.

My outgoing server (SMTP) Settings:

Server name: smtp.gmail.com
Port: 587
Use secure connection (SSL): Checked

Server authentication:

The outgoing mail server (SMTP) requires authentication: Checked
The outgoing mail server (SMTP) requires separate authentication: Selected

Outgoing mail server:
User name: <Google user name>
Password: <Google password>

Clicking the Test Settings button results in:

LibreOffice could not connect to the outgoing mail server. Check your system's settings and the settings in LibreOffice. Check the server name, the port and the secure connections settings
--
<class 'RuntimeError'>: No SSL support included in this Python, traceback follows
  C:\Program Files (x86)\LibreOffice 4\program\python-core-3.3.3\lib\smtplib.py:660 in function starttls() [raise RuntimeError("No SSL support included in this Python")]
  C:\Program Files (x86)\LibreOffice 4\program\mailmerge.py:114 in function connect() [self.server.starttls()]

---------------------------------------

Test e-mail merges fail with:

<class 'smtplib.SMTPServerDisconnected'>: Connection unexpectedly closed, traceback follows
  C:\Program Files (x86)\LibreOffice 4\program\python-core-3.3.3\lib\smtplib.py:374 in function getreply() [raise SMTPServerDisconnected("Connection unexpectedly closed")]
  C:\Program Files (x86)\LibreOffice 4\program\python-core-3.3.3\lib\smtplib.py:487 in function mail() [return self.getreply()]
  C:\Program Files (x86)\LibreOffice 4\program\python-core-3.3.3\lib\smtplib.py:754 in function sendmail() [(code, resp) = self.mail(from_addr, esmtp_opts)]
  C:\Program Files (x86)\LibreOffice 4\program\mailmerge.py:278 in function sendMailMessage() [self.server.sendmail(sendermail, truerecipients, msg.as_string())]

---------------------------------------

LibreOffice 4.1.5.3 had the same problem. Upgrading to 4.2.3.3 made no difference. Using port 465 instead of 587 makes LibreOffice unresponsive for the Settings Test which eventually times out with:

LibreOffice could not connect to the outgoing mail server. Check your system's settings and the settings in LibreOffice. Check the server name, the port and the secure connections settings
--
<class 'smtplib.SMTPServerDisconnected'>: Connection unexpectedly closed, traceback follows
  C:\Program Files (x86)\LibreOffice 4\program\python-core-3.3.3\lib\smtplib.py:374 in function getreply() [raise SMTPServerDisconnected("Connection unexpectedly closed")]
  C:\Program Files (x86)\LibreOffice 4\program\python-core-3.3.3\lib\smtplib.py:321 in function connect() [(code, msg) = self.getreply()]
  C:\Program Files (x86)\LibreOffice 4\program\python-core-3.3.3\lib\smtplib.py:240 in function __init__() [(code, msg) = self.connect(host, port)]
  C:\Program Files (x86)\LibreOffice 4\program\mailmerge.py:100 in function connect() [self.server = smtplib.SMTP(server, port,timeout=tout)]

---------------------------------------

Google says to use port 587 if clients begin with plain text before issuing the STARTTLS command. See https://developers.google.com/gmail/oauth_overview.

---------------------------------------

Once, when setting the configuration back to port 587 (my remaining settings as posted earlier), several Test Settings were successful. So far, I haven't been able to reproduce the success or determine why it temporarily succeeded.

---------------------------------------

E-mail merge works consistently in LibreOffice 4.2.3.3 on OS X Lion.

---------------------------------------

Tested on several Windows 7 workstations with the same results.

---------------------------------------

This bug was also reported on the LibreOffice development and discussions mailing list: http://lists.freedesktop.org/archives/libreoffice/2014-March/060136.html
Comment 1 ronn 2014-04-12 05:46:47 UTC
Note what happens when attempting to import the ssl module for the included Python:

C:\Users\Test>"\Program Files (x86)\LibreOffice 4\program\python.exe"
Python 3.3.3 (default, Apr  8 2014, 14:59:24) [MSC v.1600 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
Traceback (most recent call last):
     
   File "<stdin>", line 1, in <module>
    
   File "C:\Program Files (x86)\LibreOffice 4\program\python-core-3.3.3\lib\ssl.py", line 6
0, in <module>
    
     import _ssl             # if we can't import it, let the error propagate
ImportError: DLL load failed: The operating system cannot run %1.
>>>

---------------------------------------

For testing, I renamed the included _ssl.pyd (dll) and copied _ssl.pyd from a standalone Python 3.3.3 for Windows (x86):

C:\Users\Test>ren "\Program Files (x86)\LibreOffice 4\program\python-core-3.3.3\lib\_ssl.p
yd" _ssl.pyd.original

C:\Users\Test>copy \\host\c$\Python33\DLLs\_ssl.pyd "\Program Files (x86)\LibreOf
fice 4\program\python-core-3.3.3\lib"
        
            1 file(s) copied.

---------------------------------------

Note the difference in file size between the original _ssl.pyd and the replacement:

C:\Users\Test>dir "\Program Files (x86)\LibreOffice 4\program\python-core-3.3.3\lib\_ssl.p
yd*"

Directory of C:\Program Files (x86)\LibreOffice 4\program\python-core-3.3.3\lib

11/18/2013  09:19 PM         1,190,400 _ssl.pyd
04/08/2014  09:21 PM            49,152 _ssl.pyd.original

---------------------------------------

After replacing _ssl.pyd, importing the ssl module succeeds with no errors and Merge E-mails work as expected.

C:\Users\Test>"\Program Files (x86)\LibreOffice 4\program\python.exe"
Python 3.3.3 (default, Apr  8 2014, 14:59:24) [MSC v.1600 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
>>>
Comment 2 Laurent Godard 2014-06-16 12:49:58 UTC
same problem on _ssl.pyd

     import _ssl             # if we can't import it, let the error propagate
ImportError: DLL load failed: The operating system cannot run %1.


==> found obsolet DLL files in windows/system32 (dated 2004)
ssleay32.dll
libeay32.dll

==> deleting these files in windows/system32 solved the problem (they remain in libro directory)
Comment 3 ronn 2014-10-28 16:56:33 UTC
OK, so this apparently isn't exactly a bug in LibreOffice.

After Laurent's comment, I discovered the following file on my system:

C:\Windows\SysWOW64\libeay32.dll

I removed _ssl.pyd previously copied from standalone Python and upgraded to LibreOffice 4.3.2.2.

If I rename libeay32.dll (in C:\Windows\SysWOW64) to something like libeay32.dll.bak and then launch Writer, email merge works fine over SSL. If I rename the file back to libeay32.dll, the problem returns.

I found neither libeay32.dll nor ssleay32.dll in any other system directories. I think an older OpenVPN client install (provided by Untangle) was responsible for the libeay32.dll in C:\Windows\SysWOW64. Newer OpenVPN client installs keeps its own libeay32.dll/ssleay32.dll in C:\Program Files\OpenVPN\bin.
Comment 4 Laurent Godard 2014-10-29 07:59:56 UTC
the problem is that these DLL are loaded previously by a third party software and then libreoffice do not use the DLL provided in /program directory (not served by the OS)

one temporary solution is also to copy these 2 DLLs provided by Libreoffice from /program to program\python-core-3.3.3\lib (same directory than _ssl.pyd)

not suitable for globally solving the problem to libreoffice (need to tweak .local files or any other mean to force using the dll provided by libreoffice)

these seems rather critical as LibreOffice could use obsolote ssl dlls
Comment 5 engelbertsansvernet 2014-12-20 19:20:10 UTC
I don't know if it is exactly your trouble... but I'll tell you my experience and how was it solved...

I noticed that in computer with windows 8 it worked finne, but not in 8.1

I tried to execute the software in "compatibility mode", as windows 8 and it worked... but only in the OO suite... not in the LO suite.

Bye.

============================
No se si sera tu problema... te cuento cual era el mio y como lo he solucionado.

Observe que en windows 8 funcionava bien (todas las versiones tanto de O.O. como L.O.) pero que en windows 8.1 salia error...

Bien, pues en el equipo con "windows 8.1", ejecutando (OpenOffice) con compatibilidad para "windows 8", si permite el envio de correos.

Como curiosidad... tambien me fije en que en la primera prueba de funcionamiento (en opciones del Writter) me salia correcto, luego en las siguientes ya fallava el "contacto con el servidor de correo".

Saludos, y a ver si era esto.
Comment 6 engelbertsansvernet 2014-12-21 11:24:33 UTC
edited post
=======================
I noticed that the solucion was not in "compatibility mode"... see what I've discovered now...

If I follow exactly this steeps... it worked (in openoffice, not i libreoffice)
1) open openoffice, make new writter document (or open swriter directly)
2) got to configuration options and do the mail test... (it work fine)
3) now, without close openoffice, open yout document, and it it's all right

Note that if I didn't do the steeps 1) + 2), it doesn't work... I known it's very funny...

Bye...


edito respuesta
======================
Hola de nuevo... terminando de hacer pruebas he visto que la solucion anterior tiene otra explicacion... y parece que no tiene que ver con "ejecutar con modo compatibilidad -windows 8-"...

Como solucion provisonal (de momento definitiva)... lo que he visto es que unicamente funciona si siguo exactamente y en este orden los passos:
1) abro oppenoffice y creo un documento nuevo de writter (o bien directamente abro swritter y ya se crea automaticamente un documento en blanco) 
2) realizo la prueba de correo (configuracion, opciones de swritter, probar configuracion...) y sale todo correcto
3) entonces es cuando, sin cerrar el oppenoffice, abro el documento en question que ha tengo creado (des de "abrir" o con doble click) y ahora funciona...

Si no realizo previamente 1) + 2), siempre sale error.... cosa realmente rara rara rara.... y mas teniendo en cuenta que desde otro ordenador que tengo funciona SIEMPRE...

Saludos...
Comment 7 cborn 2015-01-12 07:38:02 UTC
My first build attempt has been blocked for a week by this problem.
Turned out to be 2008 versions of
ssleay32.dll
libeay32.dll

both in C:\Windows

Deleted them and my build is proceeding, I don't know what if anything was using them (yet).

Running Python or Python3 from the Cygwin command line,
import _ssl
worked fine, I didn't have a clue what the problem was, but luckily Google found this thread. It is a pretty major problem perhaps at the minimum a comment could be added to the failed test pointing to the possibility of bad DLL versions earlier in the PATH used by the test code?