View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
17354Bug reportsRemoteControlpublic2023-07-28 11:33
Reporterorsayman Assigned Toollehar  
PrioritynoneSeveritypartial_block 
Status assignedResolutionopen 
Product Version3.25.20 
Summary17354: Invalid XML document in XML-RPC API
Description

Our (python) script used to automate invitations and reminders based on the XML-RPC API no longer works. The problem comes from the fact the send_invitation function returns an invalid XML document. Below is an example of the response (the name and email is anonymized):

<methodResponse><params><param><value><struct><member><name><![CDATA[6]]></name>\n<value><struct><member><name><![CDATA[name]]></name>\n<value><string><![CDATA[XXXX XXXX]]>/string>\n</value></member><member><name><![CDATA[email]]></name>\n<value><string><![CDATA[xxxx@example.org]]</string>\n</value></member><member><name><![CDATA[status]]></name>\n<value><string><![CDATA[OK]]></string>\n</value></member></struct></value></member><member><name><![CDATA[status]]></name>\n<value><string><![CDATA[0 left to send]]></string>\n</value></member></struct></value></param></params></methodResponse>2021-06-04 16:10:39 CLIENT -> SERVER: QUIT

The string "2021-06-04 16:10:39 CLIENT -> SERVER: QUIT" is not valid causing python XML parser to stop.

This happens when "SMTP debug mode" is set to "on errors".

I don't know if it affects the web interface (since I guess this is based on the API).

Steps To Reproduce

Use the send_invitation XML-RPC method with "SMTP debug mode" set to "on errors" (this probably happen when setting to "always" too) and try too parse the XML reponse.

TagsNo tags attached.
Bug heat6
Complete LimeSurvey version number (& build)3.27.1 build 210531
I will donate to the project if issue is resolvedNo
BrowserThis is independant of the browser
Database type & versionMySQL 5.7
Server OS (if known)
Webserver software & version (if known)
PHP Version7.4.19

Users monitoring this issue

There are no users monitoring this issue.

Activities

ollehar

ollehar

2021-06-07 12:41

administrator   ~64765

Is this a regression? Does it work if you disable SMTP debugging?

orsayman

orsayman

2021-06-07 13:53

reporter   ~64766

Sorry, I forgot to mention that it works when SMTP debugging is turned off (see https://forums.limesurvey.org/forum/development/124674-bug-in-the-xml-rpc-api).

I am not 100% sure if it's a regression: I know that the script worked when we tested it a few weeks ago (before upgrade to 3.27.1) but I can't remember if SMTP debugging was on or off at the time. If I'm correct, the problem comes from PHPmailer (see file SMTP.php, line 924). Still hypothetizing that I'm correct, PHPmailer hasn't been updated for 2 years so the problem was probably there before.

ollehar

ollehar

2021-06-07 14:33

administrator   ~64767

Seems like logging can be configured inside phpmailer to different types of output: error_log, echo. Not sure how to do that, tho, or if we support it.

orsayman

orsayman

2021-06-07 23:51

reporter   ~64776

I don't think it would be very hard to do (just a call to setDebugoutput https://phpmailer.github.io/PHPMailer/classes/PHPMailer.PHPMailer.SMTP.html#method_setDebugOutput). Using error_log should be just fine. Am I wrong ?

ollehar

ollehar

2021-06-08 15:01

administrator   ~64782

Using error_log instead of echo would fix it, I think.

orsayman

orsayman

2021-06-08 15:13

reporter   ~64784

Great. Maybe you could also add a note somewhere to indicate that SMTP debug log is in PHP error_log file.

DenisChenu

DenisChenu

2021-06-09 14:00

developer   ~64800

Last edited: 2021-06-09 14:00

@ollehar : maybe we can auto set maildebug to 0 in 3.X (and unsure we need it)

In 5 : https://github.com/LimeSurvey/LimeSurvey/blob/8a695c6a2f18a9e03c8dcd77ad10fd8800b32ba9/application/core/LimeMailer.php#L433

orsayman

orsayman

2021-06-09 16:16

reporter   ~64805

We had some SMTP issues when we installed our limesurvey instance that's why we used the debug option (although I can't remember if it helped). I think it can be useful.

orsayman

orsayman

2021-06-15 19:40

reporter   ~64921

Any news ?

Issue History

Date Modified Username Field Change
2021-06-07 11:02 orsayman New Issue
2021-06-07 12:38 ollehar Product Version => 3.25.20
2021-06-07 12:38 ollehar Description Updated
2021-06-07 12:41 ollehar Note Added: 64765
2021-06-07 12:41 ollehar Assigned To => ollehar
2021-06-07 12:41 ollehar Status new => feedback
2021-06-07 13:53 orsayman Note Added: 64766
2021-06-07 13:53 orsayman Status feedback => assigned
2021-06-07 14:33 ollehar Note Added: 64767
2021-06-07 23:51 orsayman Note Added: 64776
2021-06-08 15:01 ollehar Note Added: 64782
2021-06-08 15:13 orsayman Note Added: 64784
2021-06-09 14:00 DenisChenu Note Added: 64800
2021-06-09 14:00 DenisChenu Note Edited: 64800
2021-06-09 16:16 orsayman Note Added: 64805
2021-06-15 19:40 orsayman Note Added: 64921
2023-07-28 11:33 aleksandrsharsh Bug heat 6 => 8
2023-07-28 15:00 c_schmitz Bug heat 8 => 6