You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by "Benoit Tellier (Jira)" <se...@james.apache.org> on 2021/04/02 05:13:00 UTC

[jira] [Commented] (JAMES-3434) [JMAP] Send: EmailSubmission/create (user email)

    [ https://issues.apache.org/jira/browse/JAMES-3434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17313566#comment-17313566 ] 

Benoit Tellier commented on JAMES-3434:
---------------------------------------

@InputMice, behind the LTT.RS mobile app did perform a bug report on linagora bug tracker. I share it here: https://github.com/linagora/james-project/issues/4310

In brief, Re-reading https://jmap.io/spec-mail.html#emailsubmissionset 

I was convinced it was taking emailId (symetry with onSuccessDestroyEmail), I must admit I am wrong...

```
onSuccessUpdateEmail: Id[PatchObject]|null A map of EmailSubmission id to an object containing properties to update on the Email object referenced by the EmailSubmission if the create/update/destroy succeeds. (For references to EmailSubmissions created in the same “/set” invocation, this is equivalent to a creation-reference, so the id will be the creation id prefixed with a #.)
```

It needs to be an EmailSubmission id and the email id needs to be inferred from the EmailSubmission.

https://github.com/apache/james-project/pull/356 fixes this syntax, by doing a lookup within the current method call, find the submission, and takes the associated emailId.

Because we do not have storage for email submission, references accross method calls, and API requests will not be supported.

> [JMAP] Send: EmailSubmission/create (user email)
> ------------------------------------------------
>
>                 Key: JAMES-3434
>                 URL: https://issues.apache.org/jira/browse/JAMES-3434
>             Project: James Server
>          Issue Type: Sub-task
>            Reporter: René Cordier
>            Priority: Major
>             Fix For: 3.6.0
>
>
> h2. Why
> As a user, I want to send an existing email.
> h2. How
> Implement `EmailSubmission/set create`
> {code:json}
> [[ "EmailSubmission/set", {
>   "accountId": "ue411d190",
>   "create": {
>     "k1490": {
>       "emailId": "M7f6ed5bcfd7e2604d1753f6c",
>       "envelope": {
>         "mailFrom": {
>           "email": "john@example.com",
>           "parameters": null
>         },
>        "rcptTo": [{
>          "email": "jane@example.com",
>          "parameters": null
>        }]
>      }
>    }
>  }
> }, "0" ]]
> {code}
> Note: IdentityId is not specified.
> Note: EmailParameters should be left null.
> Creating an EmailSubmission gets the given email being sent.
> Restrictions:
>  * The FROM field of the envelope needs to belong to the sender. In which case it fails with `forbiddenMailFrom`.
>  * The FROM field of the EML needs to belong to the sender. In which case it fails with `forbiddenFrom`.
> h2. Definition of Done
> Write a unit test demonstrating you can send emails.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org