Closed gorenje closed 2 years ago
Hi!
The identityId
property is mandatory in EmailSubmission/set{create}
(at least that's what the https://jmap.io/spec-mail.html#identities spec suggests).
The standard way would be to first obtain the existing Identity ids of the authenticated user (with Identity/get
). Then select the identity for sending that Email.
However, for the sake of this example, it should work if you add the identityId to the request like:
["EmailSubmission/set",
{
"accountId": account_id,
"onSuccessDestroyEmail": ["#sendIt"],
"create": {
"sendIt": {
"identityId": account_id, <--- THIS LINE HERE
"emailId": "#draft",
}
},
},
"b",
],
Cheers, Robert
Hi!
That might well be the case however the current hello-world.py does not do that.
I've actually set the IdentityId and it didn't work - same error. Exactly at the spot you mention above. Also the identityId that I used corrresponded to an identity that matched the from email used in the initial draft email.
Have you got a working example?
The error message isn't helpful either "InvalidProperties 'identityId'" --> the same message whether I set the id or not. It would be much more helpful to know exactly what is invalid about the property not that it's invalid. E.g. "IdentityId doesn't match from email in draft email #draft" or "identityId is mandatory please set it" ...
Sorry but something is still not working for me .. :(
Cheers, Gerrit
@gorenje You're hitting an annoying problem at our (Fastmail's) end. In the not too distant past, we put in stricter checking of identityId (and the email being sent with them), and this changed the required arguments when creating an EmailSubmission. It now needs to go into the envelope, too. If you look at the JMAP passed from Fastmail's web UI to the backend (you will want to put &compress=0
on your URL), you can see what's up.
That said, we know this is an annoying situation, and plan to make everything work the way you'd expect. I expect the problem will be fixed in a week or two, maybe three. (We're trying to land a few related changes in a row, here.) When that happens, the results of Identity/get will lead you to a value you can put in to the identityId of the new EmailSubmission.
Until then, if you need to use this, check out the envelope being created by the web UI. Sorry for the inconvenience!
@rjbs Cheers! That worked, I've created a PR with a working version of the hello-world.py - even if only for reference purposes.
Btw thanks for the tip with the &compress=0
- I was trying to diagnosis this issue using the UI but got stuck exactly at that: the requests were compressed!
Hi There!
I've been playing around with the python3 example here and keep getting the same error when trying to submit the test email:
I can create the draft but not send it - so the authentication stuff is working ...
Does the example need updating?
Cheers!