• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Resolved Creating mailbox (with forwarding / alias option) gives error through XML API

Dieter Blancke

New Pleskian
I'm trying to create a mailbox by using the XML api with the following code:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<packet>
   <mail>
      <create>
         <filter>
            <site-id>12</site-id>
            <mailname>
               <name>testing</name>
               <mailbox>
                  <enabled>true</enabled>
               </mailbox>
               <password>
                  <value>testing123</value>
               </password>
               <forwarding>
                  <enabled>true</enabled>
                  <address>[email protected]</address>
               </forwarding>
               <alias>test123</alias>
            </mailname>
         </filter>
      </create>
   </mail>
</packet>

But when I do this, I get the following error (1014):
Parser error: Request is invalid. Error in line 2: Element 'forwarding': This element is not expected. Expected is one of ( antivir, outgoing-messages-mbox-limit, description ).

I tried removing the "forwarding" element afterwards, but then I get the same error for the "alias" element.
The XML Api version isn't filled in, but I noticed it ended up using 1.6.9.1

Removing both the forwarding & alias elements, the mailbox did get created, but I want to be able to update the forwarding & alias settings aswel.

Note: I also tried to use the mail update packets, these gave the same error.
 
This request will work:

Code:
<packet>
   <mail>
      <create>
         <filter>
            <site-id>12</site-id>
            <mailname>
               <name>testing</name>
               <mailbox>
                  <enabled>true</enabled>
               </mailbox>
               <forwarding>
                  <enabled>true</enabled>
                  <address>[email protected]</address>
               </forwarding>
               <alias>test123</alias>
            </mailname>
         </filter>
      </create>
   </mail>
</packet>
 
This request will work:

Code:
<packet>
   <mail>
      <create>
         <filter>
            <site-id>12</site-id>
            <mailname>
               <name>testing</name>
               <mailbox>
                  <enabled>true</enabled>
               </mailbox>
               <forwarding>
                  <enabled>true</enabled>
                  <address>[email protected]</address>
               </forwarding>
               <alias>test123</alias>
            </mailname>
         </filter>
      </create>
   </mail>
</packet>
Hello there!

Thank you for the help, after removing the password field, it did work ...

To set a password, should it then be done afterwards in another API call or?
 
Back
Top