API XML MD AutoResponder Python
-
Hi!
Please help me write a request to change the AutoResponder via the XML API in Python.
Thank you very much!<MDaemon>
<API productversion="22.5.0" serviceversion="22.5.0.1">
<Request version="22.5" echo="1" verbose="0">
<Operation>UpdateUser</Operation>
<Parameters>
<Domain>example.com</Domain>
<Mailbox>John</Mailbox>
<AutoResponder>
<Enabled>Yes</Enabled>
<Start>2024-12-01T00:00:00.000Z</Start>
<End>2024-12-15T00:00:00.000Z</End>
<Response>
<![CDATA[
Hello, I will be out of the office.
Best regards,
John Doe
This email is automatic, you do not need to reply.
%SetSubject%=RE: $SUBJECT$
]]>
</Response>
<DaysActive mask="0x7F"></DaysActive>
</AutoResponder>
</Parameters>
</Request>
</API>
</MDaemon>
-
Arron StaffI have not tested with 22.5.0, but I did test with 24.5.2 and found that a user was not able to update their own auto response using the XML API. This means that in order to update the autoresponder for an account you need to authenticate as an administrator. We have changed this for MDaemon 25.0.0, which is currently in beta, so that you can authenticate as the user and update their autoresponder via the XML API.Below is a sample request that works in my testing.
<MDaemon> <API> <Request version="24.5.2" echo="1" verbose="0"> <Operation>UpdateUser</Operation> <Parameters> <Domain>domain.com</Domain> <Mailbox>User</Mailbox> <AutoResponder> <Enabled>Yes</Enabled> <Start>2024-12-15T17:00:00.000Z</Start> <End>2024-12-25T17:42:00.000Z</End> <Response>This is my test response.</Response> </AutoResponder> </Parameters> </Request> </API> </MDaemon>
-
Hello!I would like to renew the subscription right to the expired MDaemon Server license, but I need to find out beforehand whether the current version of the API-XML supports the formation of the AutoResponse text in Cyrillic characters (through API-XML request in red colour example)?(for information: in version 19.0.3 - not supported, 400 - Bad request, 200 - OK only latin characters)Example XML taken from the forum :<MDaemon><Request encoding="utf-8" version="19.0.0" echo="0" verbose="0"><Operation>UpdateUser</
Operation> <Parameters><Domain></Domain><Mailbox></Mailbox><AutoResponder><Enabled>Yes</Enabled><Start>2023-08-18T13:00:00.000Z</Start> <End>2023-08-27T21:00:00.000Z</End> <Response><![CDATA[текст на кириллице]]></Response><DaysActive mask="0x7F"></DaysActive></AutoResponder></Parameters></Request></API></MDaemon>I am grateful for the answer.Vitaly.
-
Arron Staff
This is working for me in the MDaemon 25.0.0a, which is currently in beta. I would reccomend downloading and installing a trial of 24.5.2 on a test machine and trying it before you purchase the new license so that you can ensure its working as expected before purchasing.
Also, be sure to update the MDaemon version in the XML request you are sending.
-
Arron Staff
In case its helpful, below is the request sent to the XML API and the response received from it:
<?xml version="1.0" encoding="utf-8"?> <MDaemon> <API productversion="25.0.0" serviceversion="25.0.0.1"> <Request version="24.5.0" echo="1" verbose="0"> <Operation>UpdateUser</Operation> <Parameters> <Domain>domain.com</Domain> <Mailbox>user</Mailbox> <AutoResponder> <Enabled>Yes</Enabled> <Start>2024-12-15T17:00:00.000Z</Start> <End>2024-12-25T17:42:00.000Z</End> <Response> <![CDATA[текст на кириллице]]> </Response> </AutoResponder> </Parameters> </Request> <Response version="25.0" et="0.049343" session="063FD3E1"> <Status id="0" value="0x00000000" message="The operation completed successfully."/> </Response> </API> </MDaemon>
-
Arron, please tell me, are Cyrillic characters correctly saved in the *.rsp text file in the request above?
Please show a screenshot of the *.rsp file.
Thank you for your answers!
-
Arron Staff
Autoresponders are no longer saved in RSP files, they are now saved in OOF.mrk files that are stored in the user's mailbox. These files are UTF-8-BOM encoded. Here is a screen shot of the OOF.MRK file that was created when by posting the XML above to the API.
As I said before, it is working for me. Here is a screen shot of the autoresponse message I received that was generated by MDaemon.
I highly reccomend you install a trial of MDaemon 24.5.2 and make sure its behaving as you expect.
-
Closing the topic, I'm posting the working code for connecting to the API-XML with Python authorization.
Thanks for the help!
-
Arron Staff
Thank you for sharing.