Bug 103363 - MAILMERGE: Outgoing mailserver (set in Tools > Options > Writer > Mail merge Email) not found
Summary: MAILMERGE: Outgoing mailserver (set in Tools > Options > Writer > Mail merge ...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.3.0.0.alpha0+
Hardware: All All
: highest major
Assignee: Julien Nabet
URL:
Whiteboard: target:5.4.0 target:5.3.0.1
Keywords: bibisectRequest, regression
Depends on:
Blocks: Mail-Merge
  Show dependency treegraph
 
Reported: 2016-10-20 19:43 UTC by Cor Nouws
Modified: 2016-12-20 08:45 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Cor Nouws 2016-10-20 19:43:06 UTC
Hi,

trying to send a mail merge via mail. Settings that work in 5.1.5.2 do not work in a recent daily.

Report:
"LibreOffice daily20161018 could not connect to the outgoing mail server. Check your system's settings and the settings in LibreOffice daily20161018. Check the server name, the port and the secure connections settings
--
<class 'LookupError'>: unknown encoding: idna, traceback follows
  File "<install>/libreofficedev5.3/program/mailmerge.py", line 106, in connect
    self.server = smtplib.SMTP(server, port,timeout=tout)
  File "<install>/libreofficedev5.3/program/python-core-3.5.0/lib/smtplib.py", line 251, in __init__
    (code, msg) = self.connect(host, port)
  File "<install>/libreofficedev5.3/program/python-core-3.5.0/lib/smtplib.py", line 335, in connect
    self.sock = self._get_socket(host, port, self.timeout)
  File "<install>/libreofficedev5.3/program/python-core-3.5.0/lib/smtplib.py", line 306, in _get_socket
    self.source_address)
  File "<install>/libreofficedev5.3/program/python-core-3.5.0/lib/socket.py", line 689, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
  File "<install>/libreofficedev5.3/program/python-core-3.5.0/lib/socket.py", line 728, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
Comment 1 Cor Nouws 2016-10-20 19:50:38 UTC
works ok in Version: 5.3.0.0.alpha0+
Build ID: 4475c191de479e7a5ddb20d14bc3aa32b0ab84d3
CPU Threads: 4; OS Version: Linux 4.8; UI Render: default; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2016-08-01_06:05:39
Locale: nl-NL (nl_NL.UTF-8); Calc: group  > regression
Comment 2 Cor Nouws 2016-10-20 19:52:52 UTC
also OK in Version: 5.3.0.0.alpha0+
Build ID: 91cc48f3d4b8e11f44a366e395b010203ff9c5bc
CPU Threads: 4; OS Version: Linux 4.8; UI Render: default; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2016-09-14_23:42:03
Locale: nl-NL (nl_NL.UTF-8); Calc: group
Comment 3 Julien Nabet 2016-10-21 09:15:45 UTC
What's the name of the server, is it plain ascii?

For the test, could you add in <install>/libreofficedev5.3/program/mailmerge.py, after line 19 (import os) this line:
import encodings.idna
?
Comment 4 Cor Nouws 2016-10-21 10:01:20 UTC
(In reply to Julien Nabet from comment #3)
> What's the name of the server, is it plain ascii?

yep. smtp.xs4all.nl

> For the test, could you add in
> <install>/libreofficedev5.3/program/mailmerge.py, after line 19 (import os)
> this line:
> import encodings.idna
> ?

result is that also connecting network fails..
Comment 5 Julien Nabet 2016-10-21 11:54:52 UTC
Thank you for your feedback.
Sorry for the wrong hint :-( I had searched the idna error message and found this soluce/workaroun on stackoverflow
Comment 6 Cor Nouws 2016-10-21 12:10:17 UTC
(In reply to Julien Nabet from comment #5)
> Thank you for your feedback.
> Sorry for the wrong hint :-( I had searched the idna error message and found
> this soluce/workaroun on stackoverflow

Julien: Thanks for the hint! A test that fails does learn us something too :)
Comment 7 Thomas Hackert 2016-10-24 11:04:13 UTC
Hello Cor, *,
I can confirm your bug with

OS: Debian Testing AMD64
LO: Version: 5.3.0.0.alpha1
Build-ID: f4ca1573fcf445164c068c1046ab5d084e1b005f
CPU-Threads: 4; BS-Version: Linux 4.5; UI-Render: Standard; VCL: gtk2; 
Gebietsschema: de-DE (de_DE.UTF-8); Calc: group

and

LO: Version: 5.3.0.0.alpha0+
Build-ID: e7324c5705eaa38a2c9aa0636f01a73f033ba4d6
CPU-Threads: 4; BS-Version: Linux 4.5; UI-Render: Standard; VCL: gtk2; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2016-10-20_06:12:58
Gebietsschema: de-DE (de_DE.UTF-8); Calc: group

but not with

LO: Version: 5.1.6.1
Build-ID: f3e25ec0581f5012f54d8810dcddd5824f4ee374
CPU-Threads: 4; BS-Version: Linux 4.5; UI-Render: Standard; 
Gebietsschema: de-DE (de_DE.UTF-8); Calc: group

nor

LO: Version: 5.2.3.1
Build-ID: 01ec8f357e651ca9656837b783cf7e6a32ee4d92
CPU-Threads: 4; BS-Version: Linux 4.5; UI-Render: Standard; 
Gebietsschema: de-DE (de_DE.UTF-8); Calc: group

(all four installed in parallel, following the instructions from https://wiki.documentfoundation.org/Installing_in_parallel/Linux)

so setting the status to new.
HTH
Thomas.
Comment 8 Cor Nouws 2016-11-08 16:23:06 UTC
still broken in Version: 5.3.0.0.alpha1+
Build ID: a6ce5d391476e4b6a2cb2d92ff45548c1d75684b
CPU Threads: 4; OS Version: Linux 4.8; UI Render: default; VCL: gtk2; Layout Engine: new; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2016-11-03_23:34:51
Locale: nl-NL (nl_NL.UTF-8); Calc: group
Comment 9 Julien Nabet 2016-11-08 22:00:18 UTC
I tried this:
from encodings.idna import idna in mailmerge.py

but then LO complains with:
Python exception: <class 'ImportError'>: No module named 'unicodedata' (or 'unicodedata.ucd_3_2_0' is unknown)
Comment 10 Julien Nabet 2016-11-08 22:06:02 UTC
Xisco: searching about "unicodedata", I found this old commit https://cgit.freedesktop.org/libreoffice/core/commit/?id=c279c575950b08e45f5f1d9c7935716a76d67139
In this bugtracker using "import unicodedata" may help, but we can't use it, there's an error (see my previous comments)
Any thoughts?
Comment 11 Cor Nouws 2016-12-05 21:16:59 UTC
still a problem in Version: 5.4.0.0.alpha0+
Build ID: 33f5bc54aaa7fe7aa9335726e30f9c349155e04d
CPU Threads: 4; OS Version: Linux 4.8; UI Render: default; VCL: gtk2; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2016-12-01_23:51:31
Locale: nl-NL (nl_NL.UTF-8); Calc: group
Comment 12 Cor Nouws 2016-12-15 10:56:39 UTC
still a problem in Version: 5.4.0.0.alpha0+
Build ID: b7c55b662810ee3bf82d134ff1ff9a96bfee4046
CPU Threads: 4; OS Version: Linux 4.8; UI Render: default; VCL: gtk2; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2016-12-15_01:12:52
Locale: nl-NL (nl_NL.UTF-8); Calc: group
Comment 13 Björn Michaelsen 2016-12-15 18:18:16 UTC
(In reply to thackert from comment #7)
> I can confirm your bug with
> LO: Version: 5.3.0.0.alpha1
> but not with
> LO: Version: 5.2.3.1

Looking at the file in question: git log libreoffice-5-2-branch-point..remotes/fdo/master scripting/source/pyprov/mailmerge.py

There seem to be no changes on our code. Possibly this regression is caused by an update of bundled Python?
Comment 14 Cor Nouws 2016-12-16 21:21:35 UTC
(In reply to Björn Michaelsen from comment #13)

> There seem to be no changes on our code. Possibly this regression is caused
> by an update of bundled Python?

So then the version <install path>/program/python-core-3.5.0/lib should be different, I guess.
How to check? 
Both in daily from 2016-12-12 and in 5.1.6.2 the folder has the name python-core-5.3.0
Comment 15 Julien Nabet 2016-12-17 12:14:20 UTC
I wonder if it could be due to mix between Python 3 and Python 2.

I can see this on my config.log:
3240:ac_cv_env_PYTHON_set=
3241:ac_cv_env_PYTHON_value=
3360:ac_cv_path_PYTHON=/usr/bin/python
3395:am_cv_pathless_PYTHON=python
3396:am_cv_python_platform=linux2
3397:am_cv_python_pyexecdir='${exec_prefix}/lib/python2.7/dist-packages'
3398:am_cv_python_pythondir='${prefix}/lib/python2.7/dist-packages'
3399:am_cv_python_version=2.7
3935:PYTHON_EXEC_PREFIX='${exec_prefix}'
3936:PYTHON_FOR_BUILD='/usr/bin/python'
3937:PYTHON_LIBS=''
3938:PYTHON_PLATFORM='linux2'
3939:PYTHON_PREFIX='${prefix}'
3940:PYTHON_VERSION='3.5.0'
3941:PYTHON_VERSION_MAJOR='3'
3942:PYTHON_VERSION_MINOR='5'
4049:SYSTEM_PYTHON=''
4176:pkgpythondir='${pythondir}/'
4180:pyexecdir='${exec_prefix}/lib/python2.7/dist-packages'
4181:pythondir='${prefix}/lib/python2.7/dist-packages'
4305:#define PYTHON_VERSION_STRING L"3.5.0"

I got Python 2.7 and 3.5 installed on Debian testing.
Also, I got this on autogen.conf:
--enable-python=internal

Perhaps should I remove it and so it would be "auto?
Comment 16 Julien Nabet 2016-12-18 19:03:43 UTC
I submitted a patch to review on gerrit here:
https://gerrit.libreoffice.org/#/c/32140/

"import encodings.idna" was ok but there was unicodedata declaration missing too.
Comment 17 Commit Notification 2016-12-18 21:59:41 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=486efbfc74890582b16f858b8e937d4ae9b66f64

tdf#103363: add unicodedata and import idna encoding for mailmerge

It will be available in 5.4.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 18 Commit Notification 2016-12-18 22:02:17 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-5-3":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=adff04ce5149f5b4e9de235c19f5cc0d30a7d4e8&h=libreoffice-5-3

tdf#103363: add unicodedata and import idna encoding for mailmerge

It will be available in 5.3.0.1.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 19 Julien Nabet 2016-12-18 22:31:46 UTC
Cor/thackert: I don't reproduce with the commit pushed but perhaps I'm over confident and there are still some cases where it doesn't work. So
don't hesitate to reopen this tracker if you still reproduce this.
Comment 20 Cor Nouws 2016-12-20 08:45:29 UTC
works fine indeed in Version: 5.4.0.0.alpha0+
Build ID: e83aed9a64bf5fe0ae6ac6086c7a40d8c189f034
CPU Threads: 4; OS Version: Linux 4.8; UI Render: default; VCL: gtk3; 
Locale: nl-NL (nl_NL.UTF-8); Calc: group

thanks!