Benoit Tellier created JAMES-3436:
-------------------------------------

             Summary: Saving Draft: convenience header & empty body
                 Key: JAMES-3436
                 URL: https://issues.apache.org/jira/browse/JAMES-3436
             Project: James Server
          Issue Type: Sub-task
          Components: JMAP
    Affects Versions: master
            Reporter: Benoit Tellier
            Assignee: Antoine Duprat
             Fix For: master


= Why

As a user, I want to create a mail draft (but empty body for the moment)

= How

Implement [`Email/set create` ](https://jmap.io/spec-mail.html#emailset)

{code:java}
[[ "Email/set", {
  "accountId": "ue150411c",
  "create": {
    "k192": {
      "mailboxIds": {
        "2ea1ca41b38e": true
      },
      "keywords": {
        "$seen": true,
        "$draft": true
      },
      "from": [{
        "name": "Joe Bloggs",
        "email": "j...@example.com"
      }],
      "subject": "World domination",
      "receivedAt": **"2018-07-10T01:03:11Z",
      "sentAt": "2018-07-10T11:03:11+10:00",
    }
  }
}, "0" ]]
{code}

Notes: 

* omitting the body part for now (see #3910)
* not all headers are allowed for now, only the convenience ones, as: 
  * `references` | defaults to null
  * `inReplyTo` | defaults to null
  * `sender` | default to `from`
  * `from` | defaults to null
  * `to` | defaults to null
  * `cc` | defaults to null
  * `bcc` | defaults to null
  * `replyTo` | defaults to `to`
  * `subject` | defaults to null
  * `sentAt` | defaults to `now`
* other parameters can set:
  * `mailboxIds` must be set
  * `keywords` | default is null 
  * `receivedAt` | default is time of creation on server
* server-set parameters:
  * `id`
  * `threadId`
  * `size` 

Restrictions:

* The headers property MUST NOT be given on either the top-level Email or an 
EmailBodyPart — the client must set each header field as an individual property.
* There MUST NOT be two properties that represent the same header field (e.g., 
header:from and from) within the Email or particular EmailBodyPart.
* Header fields MUST NOT be specified in parsed forms that are forbidden for 
that particular field.
* Header fields beginning with Content- MUST NOT be specified on the Email 
object, only on EmailBodyPart objects.

= Definition of Done 

Write integration tests about email creation and error handlings.

Delegation needs to be handled.



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

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

Reply via email to