[imp] Calling IMP thru XML-RPC
MIlos Prudek
prudek at bvx.cz
Thu Jun 15 02:14:47 PDT 2006
> No, the credential parameter takes an associative array or struct,
> with the password in the named element "password". And you probably
> need to pass the third parameter, even if you leave it empty.
Thank you Jan. xmlrpc extension is now installed. Authentication still fails.
I tried the following two Python lines with the same result:
server.imp.authenticate({'userID':'webmaster','credentials':'SECRET','params':
{'server':'imap1'} })
and
server.imp.authenticate({'userID':'webmaster','credentials':'SECRET')
and I also tried to intentionally call a non-existent xmlrpc method:
server.imp.neo()
and the result was always the same:
HTTP/1.1 401 Unauthorized
Date: Thu, 15 Jun 2006 09:01:40 GMT
Server: Apache/2.0.48 (Linux/SuSE)
X-Powered-By: PHP/4.3.3
Set-Cookie: Horde=5b4765e5925a6609ba487354a99c03a7; path=/horde;
domain=www.orl.cz
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
WWW-Authenticate: Basic realm="Horde RPC"
Vary: Accept-Encoding,User-Agent
Connection: close
Content-Type: text/html; charset=ISO-8859-1
401 Unauthorized
Here is the captured XML request generated by this line:
server.imp.authenticate({'userID':'webmaster','credentials':'SECRET','params':
{'server':'imap1'} })
POST /horde/rpc.php HTTP/1.0
Host: www.orl.cz
User-Agent: xmlrpclib.py/1.0.1 (by www.pythonware.com)
Content-Type: text/xml
Content-Length: 476
<?xml version='1.0'?>
<methodCall>
<methodName>imp.authenticate</methodName>
<params>
<param>
<value><struct>
<member>
<name>credentials</name>
<value><string>SECRET</string></value>
</member>
<member>
<name>userID</name>
<value><string>webmaster</string></value>
</member>
<member>
<name>params</name>
<value><struct>
<member>
<name>server</name>
<value><string>imap1</string></value>
</member>
</struct></value>
</member>
</struct></value>
</param>
</params>
</methodCall>
Are the parameters structured correctly in the xmlrpc request?
--
Milos Prudek
More information about the imp
mailing list