Download it now!
Bug 117221 - MailMerge: Not recognising outgoing SMTP Server password when supplied by macro
Summary: MailMerge: Not recognising outgoing SMTP Server password when supplied by macro
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Alex Kempshall
Whiteboard: target:6.1.0
Depends on:
Reported: 2018-04-25 07:57 UTC by Alex Kempshall
Modified: 2018-06-06 16:30 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Note You need to log in before you can comment on or make changes to this bug.
Description Alex Kempshall 2018-04-25 07:57:02 UTC
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("")
    oMailMerge.DocumentURL =  ConvertToUrl(strSelectedTemplate)
    oMailMerge.DataSourceName =  "MySQLDataBase"
    oMailMerge.CommandType = 0        'Command

    oMailMerge.Command = "MySQLDataBase.tbl_temporary"
    oMailMerge.OutputType =
    oMailMerge.Subject = strTitle
    oMailMerge.AddressFromColumn = "Email_Address"
    oMailMerge.OutServerPassword="XXXXXXX YYYYYYY"

    oMailMerge.SendAsHTML = True


It didn't work! Returned this information in an Error Message Box -

    BASIC runtime error.
    An exception occurred
    Message: Mail merge failed. Sorry, no further information available..
Comment 1 Alex Kempshall 2018-04-25 08:07:39 UTC
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" );
Comment 2 Alex Kempshall 2018-04-25 08:37:20 UTC
Submitted via logerrit a change to master
Comment 3 Xisco Faulí 2018-04-25 09:47:08 UTC
Thanks for the patch. Moving to Assing...

Gerrit patch:
Indeed, it looks like a typo in the code...
Comment 4 Xisco Faulí 2018-04-25 10:04:01 UTC
It seems it has been like this since the code was introduced ->
Comment 5 Commit Notification 2018-04-26 09:33:13 UTC
Alex McMurchy1917 committed a patch related to this issue.
It has been pushed to "master":

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 in the next 24-48 hours. More
information about daily builds can be found at:

Affected users are encouraged to test the fix and report feedback.
Comment 6 Xisco Faulí 2018-05-29 09:34:00 UTC
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?
Comment 7 Alex Kempshall 2018-06-06 16:30:22 UTC
Tested successfully on 06Jun2018 with


Built from