{"action":"closed","issue":{"url":"https://api.github.com/repos/jmapio/jmap-perl/issues/38","repository_url":"https://api.github.com/repos/jmapio/jmap-perl","labels_url":"https://api.github.com/repos/jmapio/jmap-perl/issues/38/labels{/name}","comments_url":"https://api.github.com/repos/jmapio/jmap-perl/issues/38/comments","events_url":"https://api.github.com/repos/jmapio/jmap-perl/issues/38/events","html_url":"https://github.com/jmapio/jmap-perl/issues/38","id":174270086,"number":38,"title":"setMessages from takes an object when it should take a list of objects","user":{"login":"wolfsage","id":643871,"avatar_url":"https://avatars.githubusercontent.com/u/643871?v=3","gravatar_id":"","url":"https://api.github.com/users/wolfsage","html_url":"https://github.com/wolfsage","followers_url":"https://api.github.com/users/wolfsage/followers","following_url":"https://api.github.com/users/wolfsage/following{/other_user}","gists_url":"https://api.github.com/users/wolfsage/gists{/gist_id}","starred_url":"https://api.github.com/users/wolfsage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wolfsage/subscriptions","organizations_url":"https://api.github.com/users/wolfsage/orgs","repos_url":"https://api.github.com/users/wolfsage/repos","events_url":"https://api.github.com/users/wolfsage/events{/privacy}","received_events_url":"https://api.github.com/users/wolfsage/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-31T13:15:13Z","updated_at":"2016-12-06T10:05:44Z","closed_at":"2016-12-06T10:05:44Z","body":"According to the spec, both \"from\" and \"to\" are lists of objects:\n\n```\n  from: Emailer[]|null An array of name/email objects (see below) representing the parsed From header of the email, in the same order as they appear in the header. If the email  doesn’t have a From header, this is null. If the header exists but does not have any content, the response is an array of zero length.\n\n  to: Emailer[]|null An array of name/email objects (see below) representing the parsed To header of the email, in the same order as they appear in the header. If the email doesn’t have a To header, this is null. If the header exists but does not have any content, the response is an array of zero length.\n```\n\nHowever, JMAP Proxy only accepts an object for \"from\" when you call setMessages:\n\n```\n([\n  [\n    setMessages => {\n      create => {\n        1 => {\n          mailboxIds => [8], # outbox\n          from => { email => \"test\\@example.com\" },\n          to => [ { email => \"test2\\@example.com\" } ],\n          subject => \"Test mail\",\n          textBody => \"Hello there!\",\n        },\n      }\n    },\n  ],\n]\n```\n\n@rjbs points out that the spec changed; at one point from _used_ to be an object and not a list of objects:\n\n  https://github.com/jmapio/jmap/commit/7b45eb3c2e4983d17a819775238a28746cc7dc01\n\nI suspect JMAP Proxy was just never updated to account for this.\n\nThanks!\n"}}
{"actor":{"display_login":"brong"}}