Because the password is stored in registrymodifications.xcu in clear text. See Bug 96672 - Outgoing mail server password in clear text inside the registrymodifications.xcu file I elected to supply the Outgoing mail server password using a text box and supplying the password to MailMerge using this property OutServerPassword within a macro as in the following code snippet. oMailMerge = CreateUnoService("com.sun.star.text.MailMerge") oMailMerge.DocumentURL = ConvertToUrl(strSelectedTemplate) oMailMerge.DataSourceName = "MySQLDataBase" oMailMerge.CommandType = 0 'Command oMailMerge.Command = "MySQLDataBase.tbl_temporary" oMailMerge.OutputType = com.sun.star.text.MailMergeType.MAIL oMailMerge.Subject = strTitle oMailMerge.AddressFromColumn = "Email_Address" oMailMerge.OutServerPassword="XXXXXXX YYYYYYY" oMailMerge.SendAsHTML = True oMailMerge.execute(Array()) It didn't work! Returned this information in an Error Message Box - BASIC runtime error. An exception occurred Type: com.sun.star.uno.Exception Message: Mail merge failed. Sorry, no further information available..
I believe the problem is in sw/source/uibase/uno/unomailmerge.cxx arounf about line 1009 Code snippet below. The last line is wrong. else if (pData == &m_aBlindCopiesTo) bOK = rValue >>= m_aBlindCopiesTo; else if(pData == &m_sInServerPassword) bOK = rValue >>= m_sInServerPassword; else if(pData == &m_sOutServerPassword) bOK = rValue >>= m_sInServerPassword; Changed it as below and my macro now works. diff --git a/sw/source/uibase/uno/unomailmerge.cxx b/sw/source/uibase/uno/unomailmerge.cxx index b5b477f56587..2816b6a0aa70 100644 --- a/sw/source/uibase/uno/unomailmerge.cxx +++ b/sw/source/uibase/uno/unomailmerge.cxx @@ -1006,7 +1006,7 @@ void SAL_CALL SwXMailMerge::setPropertyValue( else if(pData == &m_sInServerPassword) bOK = rValue >>= m_sInServerPassword; else if(pData == &m_sOutServerPassword) - bOK = rValue >>= m_sInServerPassword; + bOK = rValue >>= m_sOutServerPassword; else { OSL_FAIL("invalid pointer" ); }
Submitted via logerrit a change to master
Thanks for the patch. Moving to Assing... Gerrit patch: https://gerrit.libreoffice.org/#/c/53438/ Indeed, it looks like a typo in the code...
It seems it has been like this since the code was introduced -> https://cgit.freedesktop.org/libreoffice/core/commit/?id=1cc217311e945868269ad7a193fa83b6b79fbc1e
Alex McMurchy1917 committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=b114d094b6163ade1fe213653bf12412daf6c9c1 tdf#117221 - MailMerge: Not recognising outgoing SMTP Server password It will be available in 6.1.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.
A polite ping to Alex McMurchy1917: Is this bug fixed? if so, could you please close it as RESOLVED FIXED ? Otherwise, Could you please explain what's missing? Thanks
Tested successfully on 06Jun2018 with Version: 6.1.0.0.beta1+ Built from libreoffice-6-1~2018-06-06_00.30.37_LibreOfficeDev_6.1.0.0.beta1_Linux_x86-64_rpm.tar.gz