GetAccountRequest (Admin SOAP) returns NO_SUCH_ACCOUNT even though account exists

Have a great idea for extending Zimbra? Share ideas, ask questions, contribute, and get feedback.
Post Reply
haimeo1201
Posts: 17
Joined: Mon Jan 13, 2025 4:39 pm

GetAccountRequest (Admin SOAP) returns NO_SUCH_ACCOUNT even though account exists

Post by haimeo1201 »

I want to call Admin SOAP GetAccountRequest to read the user’s Sieve filter script:

<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:zimbraAdmin="urn:zimbraAdmin">

<soapenv:Header>
<context xmlns="urn:zimbra">
<authToken>ADMIN_AUTH_TOKEN</authToken>
</context>
</soapenv:Header>

<soapenv:Body>
<zimbraAdmin:GetAccountRequest attrs="zimbraMailSieveScript">
<zimbraAdmin:account by="name">
user@domain.com
</zimbraAdmin:account>
</zimbraAdmin:GetAccountRequest>
</soapenv:Body>

</soapenv:Envelope>

The request consistently returns:
<soap:Fault>
<faultcode>soap:Client</faultcode>
<faultstring>no such account: user@domain.com</faultstring>
<detail>
<Error xmlns="urn:zimbra">
<Code>account.NO_SUCH_ACCOUNT</Code>
</Error>
</detail>
</soap:Fault>

Has anyone successfully use this api? Really need your help :(
I can provide logs if needed
ghen
Outstanding Member
Outstanding Member
Posts: 413
Joined: Thu May 12, 2016 1:56 pm
Location: Belgium

Re: GetAccountRequest (Admin SOAP) returns NO_SUCH_ACCOUNT even though account exists

Post by ghen »

That should work if the account actually exists.

It's equivalent to "zmprov getAccount user@domain.com zimbraMailSieveScript" on the command line.
Post Reply