Issue 114497

Summary: Mail Merge E-Mail: "Find outgoing mail server Fail" with particular mail servers
Product: Writer Reporter: socrates0 <sandeepm815>
Component: configurationAssignee: AOO issues mailing list <issues>
Status: CONFIRMED --- QA Contact:
Severity: Major    
Priority: P3 CC: elish, hanya.runo, issues, itguy, liushenf, oooforum, petko, rainerbielefeld_ooo_qa
Version: OOo 1.0.0   
Target Milestone: ---   
Hardware: All   
OS: Windows, all   
See Also: https://issues.apache.org/ooo/show_bug.cgi?id=91875
Issue Type: PATCH Latest Confirmation in: 4.1.0-dev
Developer Difficulty: ---
Attachments:
Description Flags
Mail Merge E-mail
none
Server Authentication
none
Test Account Settings
none
debugging output
none
Patch to enable SSL connection
none
mailmerge.py patch applied none

Description socrates0 2010-09-14 15:40:10 UTC
I wanted to use the email merge in OpenOffice Writer so I used the wizard which
worked well but the mails were not going thru. In fact Writer seemed to hang
with nothing happening. (The database containing the name & email addresses is
stored in a .xls file.) So I went to Tools->Options->OpenOffice.org Writer->Mail
Merge E-mail where I had entered the relevant settings & tried the 'Test
Settings' option & found it was hanging. I have checked to see if I had made any
error but can see non is there some problem with sending emails thru Writer?

The version is 3.2.1
00032m.18(Build 9502)

I am using win XP SP3 with all the latest updates installed.
Comment 1 h.ilter 2010-09-15 14:05:54 UTC
I assume the problem comes through the connection failure with your e-mail provider.
Which e-mail provider you're using?
Comment 2 socrates0 2010-09-15 15:15:49 UTC
My ISP in Mumbai India is MTNL (Mahanagar Telephone NIgam Ltd) but that was not
the problem. My net connection works fine & was working fine when I faced this
issue. Today I tried it on a laptop running Win 7 Home Premium & faced the same
issue so its not a problem with my machine or ISP
Comment 3 h.ilter 2010-09-15 16:40:25 UTC
No, what I meant was the smtp authentication
Please see issue 106568 for example.
Comment 4 socrates0 2010-09-15 18:34:54 UTC
I saw issue 106568, when that person clicks on the 'Test Settings' button he
seems to get some results. In my case nothing happens & after some time the
title bar that same window which has the 'Test Settings' button shows 'Not
Responding'. Then the only option is to kill the application.
Comment 5 Rob Weir 2013-02-02 02:57:07 UTC
This Issue requires more information ('needmoreinfo'), but has not been updated
within the last year. Please provide feedback as requested and re-test with the the latest version of OpenOffice - the problem(s) may already be addressed. 

You can download Apache OpenOffice 3.4.1 from http://www.openoffice.org/download

Please report back the outcome of your testing, so this Issue may be closed or
progressed as necessary - otherwise the issue may be Resolved as Invalid in the
future.
Comment 6 Edwin Sharp 2013-07-22 07:29:50 UTC
Tools - Options... - OpenOffice Writer - Mail Merge E-mail - Test Settings... -> Test Account Settings dialog window not responding at beginning and then fails.

Rev. 1503704 Win 7
Comment 7 Ariel Constenla-Haile 2013-07-22 11:28:16 UTC
(In reply to Edwin Sharp from comment #6)
> Tools - Options... - OpenOffice Writer - Mail Merge E-mail - Test
> Settings... -> Test Account Settings dialog window not responding at
> beginning and then fails.
> 
> Rev. 1503704 Win 7

what settings did you use to test? If a single setting is wrong, it will fail.
See bug 119481 comment 1 for Gmail settings, for example.

The same applies for the original reporter, s/he didn't provide the settings, so this is a NEEDMOREINFO.
Comment 8 Edwin Sharp 2013-07-22 11:59:07 UTC
Created attachment 81112 [details]
Mail Merge E-mail
Comment 9 Edwin Sharp 2013-07-22 12:00:02 UTC
Created attachment 81113 [details]
Server Authentication
Comment 10 Edwin Sharp 2013-07-22 12:00:59 UTC
Created attachment 81114 [details]
Test Account Settings
Comment 12 Ariel Constenla-Haile 2013-07-22 12:17:22 UTC
(In reply to Edwin Sharp from comment #9)
> Created attachment 81113 [details]
> Server Authentication

In this dialog, choose the first radio button: "The outgoing mail server (SMTP) requires separate authentication" and enter your E-mail in "user name" and your password.
Comment 13 Edwin Sharp 2013-07-22 12:26:26 UTC
Establish network connection - Successful
Find outgoing mail server - Failed
Comment 14 Ariel Constenla-Haile 2013-07-22 12:51:44 UTC
(In reply to Edwin Sharp from comment #13)
> Establish network connection - Successful

This is a progress ;)

> Find outgoing mail server - Failed

This needs more info. The component in <program folder>/mailmerge.py has an option to turn on debugging, it prints information in the standard error, but I guess you cannot access this in Windows.

If you have access to a Linux system, please try your settings there first.
If the still fail, then edit /opt/openoffice4/program/mailmerge.py, in line 68 change "dbg = False" to

dbg = True

and start OpenOffice from the terminal, to get the debugging output.
Comment 15 Edwin Sharp 2013-07-22 17:42:46 UTC
Same result as comment 13 on Debian.
Can not modify file:
su root
emacs mailmerge.py
goto line 68 and delete False -> Buffer is read-only.
Comment 16 Ariel Constenla-Haile 2013-07-22 18:04:25 UTC
(In reply to Edwin Sharp from comment #15)
> Same result as comment 13 on Debian.
> Can not modify file:
> su root
> emacs mailmerge.py
> goto line 68 and delete False -> Buffer is read-only.

change the permissions (+w), or with vim save forcing using w!
Comment 17 Edwin Sharp 2013-07-22 19:54:46 UTC
chmod 666 mailmerge.py
dbg = True
xhost +
su
./swriter

->

javaldx: Could not find a Java Runtime Environment!
PyMailServiceProvider init
PyMailServiceProvider create with <uno.Enum com.sun.star.mail.MailServiceType ('SMTP')>
PyMailSMPTService init
PyMailSMPTService addConnectionListener
PyMailSMPTService getSupportedConnectionTypes
PyMailSMPTService connect
ServerName: mail.messagingengine.com
Port: 465
Timeout is instance of int? False
Timeout: <object object at 0x9d9090>

Hope this is correct, I'm not an expert in Linux
Comment 18 Ariel Constenla-Haile 2013-07-23 08:54:20 UTC
Please try with port 587

https://www.fastmail.fm/help/remote_email_access_server_names_and_ports.html
Alternatively, if you're client supports STARTTLS only, you can use port 587 with STARTTLS enabled.
Comment 19 Edwin Sharp 2013-07-23 10:13:15 UTC
587 gives same result as comment 13 but much quicker without the not responding phase.

Rev. 1503704 Win 7
Comment 20 Ariel Constenla-Haile 2013-07-23 15:58:14 UTC
(In reply to Edwin Sharp from comment #19)
> 587 gives same result as comment 13 but much quicker without the not
> responding phase.
> 
> Rev. 1503704 Win 7

First try to make it work on Linux, where the output to stderr might give a clue of what is wrong in the settings.

sudo vim /opt/openoffice4/program/python-core-2.7.5/lib/smtplib.py
circa line 226, set

debuglevel = 1

to get even more debugging information, then run AOO from the terminal.
Comment 21 Edwin Sharp 2013-07-23 18:40:35 UTC
Created attachment 81124 [details]
debugging output

It works now! with 587 and debugging=1 on Rev. 1502185 Debian
Comment 22 Edwin Sharp 2014-02-13 16:31:59 UTC
*** Issue 124228 has been marked as a duplicate of this issue. ***
Comment 23 Rainer Bielefeld 2014-02-13 17:00:38 UTC
I have been using OOo / LibO / AOO Mail merge for more than 10 years, so this can not be a general problem as Summary suggests.

Reproducible for smtp.gmail.com, details see here:
<https://issues.apache.org/ooo/show_bug.cgi?id=124228#c12>

We will have to check Relation / DUPs:
"Bug 91875 - Mail Merge Email won't authenticate to server"
"Bug 98153 - email merge problem single letter domain name" 
"Bug 120705 - Mail Merge Options Error on test Account Settings"

Already DUPed:
"Bug 104037 - Find outgoing mail server - Failed"

@Edwin:
Comment 21 means Debugging works or Mail Connection works?
Comment 24 Rainer Bielefeld 2014-02-13 17:06:57 UTC
I did a test with LibO 4.1.3: Same problem!
I can confirm Edwin's result Comment 19 (LibO 4.1.3, OOo 3.3.0): With Port 587 Writer will not become unresponsive, but Also outgoing server failure.
Comment 25 Rainer Bielefeld 2014-02-13 17:22:15 UTC
Bug 91875 might be concerning the same problem, all other ones from Comment 23 look different to me
Comment 26 Rainer Bielefeld 2014-02-13 17:56:56 UTC
(In reply to Ariel Constenla-Haile from comment #14)
Hints how to debug Python on WIN you can find here:
 <https://bugs.freedesktop.org/show_bug.cgi?id=34187#c5>
But I doubt that that can bring more information than the Linux debugging.

If Python debugging does not help I can do some Wireshark logs comparing auth. with Seamonkey and auth. with AOO
Comment 27 Edwin Sharp 2014-02-13 18:08:52 UTC
(In reply to Rainer Bielefeld from comment #23)
> Comment 21 means Debugging works or Mail Connection works?

It means:
Establish network connection - Successful
Find outgoing mail server - Successful
I did not proceed further.
Comment 28 Rainer Bielefeld 2014-02-13 18:36:47 UTC
(In reply to Edwin Sharp from comment #27)

Strange - what magic did you do? 

For my Gmail Account I still get "Find outgoing mail server Failed" With settings as following:
My Name:         Rainer Bielefeld
Email-Address:   rainerbielefeld@gmail.com
Outgoing Server: smtp.gmail.com
Port:            587
Use SSL:         checked
Authentication
Outgoing Server needs separate authentication checked
User Name:       rainerbielefeld@gmail.com
Password:        (I use my password that works with seamonkey)

Can you also try a Gmail account? Gmail currently is in focus of interest.
Comment 29 Rainer Bielefeld 2014-02-14 12:01:48 UTC
May be it's simply a "SSL does not work at all" Problem?

I tested with a SMTP server I frequently use for mail merge and also for mails from Seamonkey Mail Client:
11. Changed Encryption to "SSL/TLS". Did even not work with Seamonkey, so I
    dismissed that solution
12. Changed Encryption to "STARTTLS", test worked fine after some certificate
    messages I had to confirm.

But unfortunately that "STARTTLS" setting seems not available for AOO? It sould be interesting to know what encryption exactly that checkmark does enable.

So we need information:
(a) What encryption method is used (exact description)
(b) Someone should do a test parallel with E-Mail-Client and AOO
(b1) Without encryption: Both should be able to send
(b2) SSL/TLS or what ever: If Client works also AOO should pass test 
     with success
Comment 30 hanya 2015-10-22 07:33:32 UTC
Created attachment 85063 [details]
Patch to enable SSL connection

connect method always use smtplib.SMTP which does not open SSL connection. 
The patch changes to use smtplib.SMTP_SSL when the SSL connection is chosen.
starttls method should not called when SSL type is chosen.
Comment 31 hanya 2015-10-22 07:49:55 UTC
Created attachment 85064 [details]
mailmerge.py patch applied

This file contains the patch in Comment 30.
If someone want to verify the patch, replace program/mailmerge.py file with this.

Here are example settings for some mail services for Writer - Tools - Options - OpenOffice Writer - Mail Merge E-mail.

For gmail, 
- Your name: your name
- E-Mail address: user_name@gmail.com
- Server name: smtp.gmal.com
- Port: 465
- Use secure connection (SSL): check on
Push Server Authentication button
- The outgoing mail server (SMTP) requires authentication: check on
- Choose above radio button (The outgoing mail server (SMTP) requires separate authetication)
- User name: user_name@gmail.com
- Password: your password
In the case of gmail, you have to allow connection from applications having lower security in your account settings.

With yahoo mail (yahoo.co.jp in my case): 
- the same with gmail settings except for User name
- User name: user_name
In the case of yahoo mail, I have to use user_name without domain part, no @ part.
Comment 32 Bill Power 2016-03-11 08:43:15 UTC
I have this problem too in OpenOffice 4.1.2 running on Windows 10.

Comments and observations:
I have duplicated as best I can the settings for a Thunderbird account that works fine. It is NOT a Gmail account.

The settings can't be duplicated exactly as T/bird has SSL/TLS as connection security and "Normal Password" as the authentication method. There is no provision for nominating these settings when configuring the email merge in OO Writer.

My port setting for both is 995.

If the SMTP Server-name is not preceded by an email address (even a bogus one) followed by a hyphen or the string "smtp://", Test settings... simply hangs and the status display is empty.

The check-box "Use secure connection (SSL)" seems to make no difference to the task status I get which is:
Establish network connection - Successful (even if my Wifi hardware and software is turned off).
Find outgoing mail server - Failed.

I have had success with another non-Gmail address using a different ISP and protocol on port 25 - but this is not a practical work-around for me.
Comment 33 Marcus 2017-05-20 11:01:02 UTC
Reset assigne to the default "issues@openoffice.apache.org".
Comment 34 itguy 2018-06-03 18:49:09 UTC
Are there any updates on this? I have been searching for hours for a fix to the Writer Mail Merge email authentication issue not allowing connection to the SMTP server on port 465 using SSL. 

I am using InMotionHosting as my IMAP email services but based on the number of forum hits I've seen on this issue, I don't believe this is related to any specific service providers.

Also, the only way I can connect to my SMTP server is to configure Writer is to force it to use my specific credentials to connect to my outgoing server by checking "The outgoing mail server (SMTP) requires separate authentication".

If I select "The Outgoing mail server uses the same authentication as the incoming mail server". I can't even connect to the server. 

I cannot find a fix or patch for the Writer client SMTP anywhere. Can someone direct me to a solution for this?

Running OpenOffice Version 4.1.5 with Windows 10 Pro.
Comment 35 Peter 2018-06-03 22:33:35 UTC
The patches are not uploaded in the repository. Thus are not part of 4.1.5.

I think it should work if you download "mailmerge.py patch applied" and replace mailmerge within your installation. ( I recommend to backup the original file in case of issues so you can roll back. (Better carefull, then sorry)

Would you test the patch? ( see if this fixes your issue and report back?)
If so we could add it to the next release.
Comment 36 itguy 2018-06-04 16:48:50 UTC
I downloaded the file mailmerge.py but I have no clue how to install this patch.
Comment 37 Peter 2018-06-06 05:06:54 UTC
1) search your OpenOffice installation folder for the filemailmerge.py
2) rename the file to mailmerge.bak
3) copy the downloaded file into the same folder
4) start openoffice and try 

hth
Comment 38 oooforum (fr) 2019-04-14 12:23:53 UTC
Set as PATCH

Could we commit it for next 4.2.0?