• Plesk Uservoice will be deprecated by October. Moving forward, all product feature requests and improvement suggestions will be managed through our new platform Plesk Productboard.
    To continue sharing your ideas and feedback, please visit features.plesk.com

Issue Mail Account XML API: mailbox - This element is not expected

pmg

Basic Pleskian
Server operating system version
Linux
Plesk version and microupdate number
Plesk Obsidian 18.0.71 Update #2
Having issue creating email accounts with mailbox enabled.
Request:
XML:
<?xml version="1.0" encoding="UTF-8"?>
<packet>
    <mail>
        <create>
            <filter>
                <site-id>248</site-id>
                <mailname>
                    <name>info1</name>
                    <password>
                        <value>redacted</value>
                        <type>plain</type>
                    </password>
                    <mailbox>
                        <enabled>true</enabled>
                        <quota>1024000</quota>
                    </mailbox>
                </mailname>
            </filter>
        </create>
    </mail>
</packet>

Response:
XML:
<?xml version="1.0"?>
<packet version="1.6.9.1">
    <system>
        <status>error</status>
        <errcode>1014</errcode>
        <errtext>Parser error: Request is invalid. Error in line 14: Element &#039;mailbox&#039;:
            This element is not expected. Expected is one of ( antivir,
            outgoing-messages-mbox-limit, description ).</errtext>
    </system>
</packet>

Using docs/examples from Creating Mail Accounts
 
Try switching the order of the <mailbox> element with the <password> element (i.e having the <password> element last within the <mailname> element). The order should not matter, but it seems it does :(
 
Hey @Kaspar , thanks for the quick response!
This might explain some other hickups I've faced with XML API. Will keep in mind that order sometimes matter.
Right now I've worked around this using <update> packet to enable mailbox post email creation.
 
Back
Top