Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Developers

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-05-2011, 06:58 AM
New Member
 
Posts: 3
Default Set zimbraPrefFromAddress via SOAP

Hi,


I'm trying to set the attribute zimbraPrefFromAddress via SOAP with a ModifyAccountRequest:

Code:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
   <soap:Header>
      <context xmlns="urn:zimbra">
         <authToken>0_bc7...</authToken>
         <nosession/>
      </context>
   </soap:Header>
   <soap:Body>
<ModifyAccountRequest xmlns="urn:zimbraAdmin">
 <id>bb4250d5-f214-45f3-b274-49561b90549c</id>
  <a n="zimbraPrefFromAddress">f.l@domain.com</a>
</ModifyAccountRequest>
   </soap:Body>

</soap:Envelope>
The response:

Code:
   <soap:Body>
      <soap:Fault>
         <soap:Code>
            <soap:Value>soap:Sender</soap:Value>
         </soap:Code>
         <soap:Reason>
            <soap:Text>permission denied: cannot access attribute zimbraPrefFromAddress on account target test@domain.com</soap:Text>
         </soap:Reason>
         <soap:Detail>
            <Error xmlns="urn:zimbra">
               <Code>service.PERM_DENIED</Code>

Why am I not allowed to do this? The auth code is generated using a domain account.

Any ideas?

Regards
Tobo
Reply With Quote
  #2 (permalink)  
Old 11-03-2011, 12:43 AM
PhD PhD is offline
Senior Member
 
Posts: 62
Default

i do it very similarly... using the authtoken of a global admin....
and $ID is the user's zimbraID
and $FIRSTLOWER and $LASTLOWER are their first and last names in lowercase

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header>
<context xmlns="urn:zimbra">
<authToken>$AUTHTOKEN</authToken>
<nosession/>
</context>
</soap:Header>
<soap:Body>
<ModifyAccountRequest xmlns="urn:zimbraAdmin">
<id>$ID</id>
<a n="zimbraPrefFromAddress">$FIRSTLOWER.$LASTLOWER@d omain.com</a>
</ModifyAccountRequest>
</soap:Body>
</soap:Envelope>
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.