Re: [JMAP] Mailbox/queryChanges not yet implemented ?

2018-07-31 Thread Zhivko Vasilev
Hello Robert,

Thank for the insides.  Not blocked at all, I'll focus on
Email/methods for now.
Most JMAP calls work quite well, so I thought that probably call the
method with the wrong json.
Regards,
Zhivko Vasilev

On Mon, Jul 30, 2018, at 9:27 AM, Robert Stepanek wrote:
> Hi Zhivko,
> 
> On Mon, Jul 30, 2018, at 17:08, Zhivko Vasilev wrote:
>> When I try to use Mailbox/queryChanges call  the server always return
>> me an error "cannotCalculateChanges.">> 
>> After a quick look in the code, it turns out this error is hard-
>> coded.>> /* Refuse all attempts to calculcate list updates */
>> jmap_error(req, json_pack("{s:s}", "type",
>> "cannotCalculateChanges"));>> 
>> So my guess is not yet implemented functionality and will be
>> added later?> 
> Yes. We concentrated on getting Email/queryChanges off the ground,
> since that function was more important for us. But now with the JMAP
> stack in Cyrus IMAPd getting stable, there isn't a good reason why we
> should refuse all Mailbox/queryChanges requests.> 
> I have created a Github issue to track this effort:
> https://github.com/cyrusimap/cyrus-imapd/issues/2465> 
> I can't give you a hard deadline when to expect an implementation, but
> I expect to work on it the next few weeks. If your use case depends on
> this method, please let me know details (e.g. what are the typical
> filters you are using in your requests, etc.).> 
> Cheers,
> Robert



[JMAP] Mailbox/queryChanges not yet implemented ?

2018-07-30 Thread Zhivko Vasilev
Hello ,

When I try to use Mailbox/queryChanges call  the server always return me
an error "cannotCalculateChanges."
After a quick look in the code, it turns out this error is hard-coded.
/* Refuse all attempts to calculcate list updates */
jmap_error(req, json_pack("{s:s}", "type",
"cannotCalculateChanges"));
So my guess is not yet implemented functionality and will be
added later?
Regards,
Zhivko Vasilev

P.S. Below are the calls/responses to the server.

{"methodCalls":[["Mailbox/changes",{"filter":{"conditions":[{"inMailbox-
":"e5a1e895-e587-4d6a-a49d-
9cba28d9653c"}],"operator":"AND"},"sinceState":"11808"},"#23"],["Mailbo-
x/queryChanges",{"#ids":{"name":"Mailbox/changes","path":"/updated","re-
sultOf":"#23"},"properties":["id","totalEmails"],"sinceQueryState":"118-
08"},"#24"]],"using":["ietf:jmap","ietf:jmapmail"]}
{"methodResponses":[["Mailbox/changes",{"oldState":"11808","newState":"-
11811","hasMoreChanges":false,"created":[],"updated":["e5a1e895-e587-
4d6a-a49d-
9cba28d9653c"],"destroyed":[],"updatedProperties":["totalEmails","unrea-
dEmails","totalThreads","unreadThreads"],"accountId":"u1"},"#23"],["err-
or",{"type":"cannotCalculateChanges"},"#24"]]}


Re: Cyrus Jmap support question

2018-05-22 Thread Zhivko Vasilev

Thanks a lot, Ken,

Both hints work perfectly :)

Regards,
Zhivko


On Tue, May 22, 2018, at 8:36 AM, Ken Murchison wrote:
> You're getting a 301 because the JMAP endpoint is actually /jmap/ and
> not /jmap (note the trailing '/').  I'm not sure why our
> implementation requires this.  That would be a question for Robert S.> This 
> request works fine on my laptop using the current Cyrus code
> from Git:> curl --verbose --http2 -X POST -H "Content-Type: application/json" 
> -H
> "Accept: application/json" --user ken>  -d 
> '{"using":["ietf:jmap","ietf:jmapmail"],"methodCalls":[["Mailbox/-
>  get",{"accountId":null,"ids":null},"#1"]]}' https://localhost/jmap> 


> 
> On 05/21/2018 01:47 PM, Zhivko Vasilev wrote:
>> curl --verbose --http2 -X POST \
>>  -H "Content-Type: application/json" \
>>  -H "Accept: application/json" \
>>  --user u...@cyrus.mailtemi.com:q \
>>  -d '[["Mailbox/get", {}, "#1"],"using":["jmap-core","jmap-
>>  mail"]]' \>>  http://[1]35.192.121.94:443[2]/jmap[3]";
> 
> -- Ken Murchison Cyrus Development Team FastMail US LLC
> Email had 1 attachment:


>  * murch.vcf
>   1k (text/x-vcard)


Links:

  1. http://35.192.121.94/jmap
  2. https://my.ip.address:443/jmap
  3. http://35.192.121.94/jmap


Re: Cyrus Jmap support question

2018-05-22 Thread Zhivko Vasilev

Hello Bron, Ken,

To clarify, that I do not use official FastMail server.
I've built Cyrus sever from https://github.com/cyrusimap/cyrus-imapd
With JMAP and HTTP/2 support enabled. Assume this is the closest
implementation to the JMAP RFC?
Seem the problem is with HTTP/2 settings frame. Client and server
exchange their settings frame, but on the first data frame, the server
reset the stream with PROTOCOL_ERROR  0x1.From the source, I saw that Cyrus 
uses nghttp2 and they provide sample
http/2 server, so I'll try to use it to see what happens.So most probably it is 
a http/2 compatibility issue.

After dig the Cyrus code seems HTTP/2 callback code is located in
http_h2.c and there are syslog calls , but cannot make it log.
Thanks a lot,
Zhivko Vasilev

On Tue, May 22, 2018, at 7:19 AM, Ken Murchison wrote:
> I am just back home after a holiday.  I will look into this sometime
> today or tomorrow after I catch up on other items.> 


> 
> On 05/21/2018 01:47 PM, Zhivko Vasilev wrote:
>> Hello Everyone,
>> 
>> I hope you can help me.
>> 
>> I'm implementing a JMAP client and try to use Cyrus as reference
>> server.>> Send and Receive via IMAP/SMTP work fine.
>> But when I try to connect via HTTP/2 , connection is reset by HTTP/2
>> reset stream command.>> 
>> imapd.log file show only  "starttls: TLSv1.2 with cipher 
>> ECDHE-RSA-AES256-GCM-
>> SHA384 (256/256 bits new) no authentication">> 
>> My http2 call is POST https://[1]cyrus.mailtemi.com[2]:443/jmap[3]
>> HEADERS:
>> "accept", "application/json"
>> "content-type", "application/json"
>> "Authorization", "base64 encoded user name:pass"
>> BODY:
>> {"methodCalls":[["Mailbox/get",{},"#1"]],"using":["jmap-core","jmap-
>> mail"]}>> 
>> Is there a way to turn on HTTP log to track what I do incorrectly.
>> 
>> I tried to track with curl  the server allways reponded with HTTP
>> error 301.>> The  command I've tried was
>> "curl --verbose --http2 -X POST \
>>  -H "Content-Type: application/json" \
>>  -H "Accept: application/json" \
>>  --user u...@cyrus.mailtemi.com:q \
>>  -d '[["Mailbox/get", {}, "#1"],"using":["jmap-core","jmap-
>>  mail"]]' \>>  http://[4]35.192.121.94:443[5]/jmap[6]";
>> returned
>> * Connected to 35.192.121.94 (35.192.121.94) port 80 (#0)
>> * Server auth using Basic with user 'u...@cyrus.mailtemi.com'
>> > POST /jmap HTTP/1.1
>> > Host: 35.192.121.94
>> > Authorization: Basic dTFAY3lydXMubWFpbHRlbWkuY29tOnE=
>> > User-Agent: curl/7.58.0
>> > Connection: Upgrade, HTTP2-Settings
>> > Upgrade: h2c
>> > HTTP2-Settings: AAMAAABkAARAAAIA
>> > Content-Type: application/json
>> > Accept: application/json
>> > Content-Length: 61
>> >
>> * upload completely sent off: 61 out of 61 bytes
>> < HTTP/1.1 101 Switching Protocols
>> < Connection: Upgrade
>> < Upgrade: h2c
>> * Received 101
>> * Using HTTP2, server supports multi-use
>> * Connection state changed (HTTP/2 confirmed)
>> * Copying HTTP/2 data in stream buffer to connection buffer after
>>   upgrade: len=0>> * Connection state changed (MAX_CONCURRENT_STREAMS 
>> updated)!
>> < HTTP/2 301
>> < date: Mon, 21 May 2018 17:36:58 GMT
>> < location: /jmap/
>> < vary: Accept-Encoding
>> < content-length: 0
>> <
>> * Connection #0 to host 35.192.121.94 left intact
>> 
>> Please give me some advice or clue how to track what is the problem.>> I'm 
>> stuck at this point for two days :(
>> 
>> Thanks ,
>> Zhivko Vasilev
>> 
> 
> -- Ken Murchison Cyrus Development Team FastMail US LLC
> Email had 1 attachment:


>  * murch.vcf
>   1k (text/x-vcard)


Links:

  1. https://my.ip.address:443/jmap
  2. mailto:u...@cyrus.mailtemi.com
  3. https://my.ip.address:443/jmap
  4. http://35.192.121.94/jmap
  5. https://my.ip.address:443/jmap
  6. http://35.192.121.94/jmap


Cyrus Jmap support question

2018-05-21 Thread Zhivko Vasilev
Hello Everyone,

I hope you can help me.

I'm implementing a JMAP client and try to use Cyrus as reference server.Send 
and Receive via IMAP/SMTP work fine.
But when I try to connect via HTTP/2 , connection is reset by HTTP/2
reset stream command.
imapd.log file show only  "starttls: TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-
SHA384 (256/256 bits new) no authentication"
My http2 call is POST https://[1]cyrus.mailtemi.com[2]:443/jmap[3]
HEADERS:
"accept", "application/json"
"content-type", "application/json"
"Authorization", "base64 encoded user name:pass"
BODY:
{"methodCalls":[["Mailbox/get",{},"#1"]],"using":["jmap-
core","jmap-mail"]}
Is there a way to turn on HTTP log to track what I do incorrectly.

I tried to track with curl  the server allways reponded with HTTP
error 301.The  command I've tried was
"curl --verbose --http2 -X POST \
 -H "Content-Type: application/json" \
 -H "Accept: application/json" \
 --user u...@cyrus.mailtemi.com:q \
 -d '[["Mailbox/get", {}, "#1"],"using":["jmap-core","jmap-
 mail"]]' \ http://[4]35.192.121.94:443[5]/jmap[6]";
returned
* Connected to 35.192.121.94 (35.192.121.94) port 80 (#0)
* Server auth using Basic with user 'u...@cyrus.mailtemi.com'
> POST /jmap HTTP/1.1
> Host: 35.192.121.94
> Authorization: Basic dTFAY3lydXMubWFpbHRlbWkuY29tOnE=
> User-Agent: curl/7.58.0
> Connection: Upgrade, HTTP2-Settings
> Upgrade: h2c
> HTTP2-Settings: AAMAAABkAARAAAIA
> Content-Type: application/json
> Accept: application/json
> Content-Length: 61
>
* upload completely sent off: 61 out of 61 bytes
< HTTP/1.1 101 Switching Protocols
< Connection: Upgrade
< Upgrade: h2c
* Received 101
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after
  upgrade: len=0* Connection state changed (MAX_CONCURRENT_STREAMS updated)!
< HTTP/2 301
< date: Mon, 21 May 2018 17:36:58 GMT
< location: /jmap/
< vary: Accept-Encoding
< content-length: 0
<
* Connection #0 to host 35.192.121.94 left intact

Please give me some advice or clue how to track what is the problem.
I'm stuck at this point for two days :(

Thanks ,
Zhivko Vasilev


Links:

  1. https://my.ip.address:443/jmap
  2. mailto:u...@cyrus.mailtemi.com
  3. https://my.ip.address:443/jmap
  4. http://35.192.121.94/jmap
  5. https://my.ip.address:443/jmap
  6. http://35.192.121.94/jmap