Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.6.0
    • None
    • None

    Description

      This is a first simple implementation of the creation part of Mailbox/set. It should follow the JMAP core specification section /set https://jmap.io/spec-core.html#set

      Request

      {
         "using": [ "urn:ietf:params:jmap:core", "urn:ietf:params:jmap:mail" ],
         "methodCalls": [
             [
                 "Mailbox/set", 
                 {
                      "accountId": "JMAP-ID",
                      "ifInState": null,
                      "create": {
                          "TEMP-MAILBOX-ID": {
                              "name": "mailbox_name",
                              "namespace": "Personal"
                          }
                      }
                 }
             ]
         ]
      }
      

      For now, this should be enough. Few notes:

      • ifInState is a State and is not managed at the moment, so it should be null
      • the Roles will be the ones we already have defined in james, knowing we probably miss others at the moment (see #1750)
      • parentId will be handled in #1737
      • isSubscribed will be handled in #1739
      • sortOrder is not handled yet, we attribute default values depending of the role (see #1749 )
      • other missing fields are server-set
      • namespace is not part of the specs
      • rights are handled in #1759
      • for now we can consider role and sortOrder server-set, regarding our current implementation

      Response

      {
         "methodResponses": [
             [
                 "Mailbox/set", 
                 {
                      "accountId": "JMAP-ID", // the requested accountId
                      "oldState": null,
                      "newState": null,
                      "created": {
                          "TEMP-MAILBOX-ID": {
                              "id": "0001",
                              "sortOrder": 10,
                              "role": "Inbox",
                              "totalEmails": 0,
                              "unreadEmails": 0,
                              "totalThreads": 0,
                              "unreadThreads": 0,
                              "myRights": {
                                  "mayReadItems":false,
                                  "mayAddItems":true,
                                  "mayRemoveItems":false,
                                  "maySetSeen":true,
                                  "maySetKeywords":false,
                                  "mayCreateChild":true,
                                  "mayRename":true,
                                  "mayDelete":false,
                                  "maySubmit":false
                              },
                              "quotas":{
                                 "quotaRoot":{
                                     "Message":{"used":18,"max":42},
                                     "Storage":{"used":12}
                                  }
                              }
                          }
                      }
                 }
             ]
         ], 
         "sessionState": "abc"
      }
      

      Notes:

      • notCreated will be handled in #1736
      • the core specs say that the response should return in created a map of Ids to their Mailbox object with the real id, including any properties not sent by the client (default values ommited by client and server-set values)
      • oldState and newState should be null for now, as we don't manage it atm

      DoD : POJO and serialization of the request and response Mailbox/set for creation + unit and integration tests

      Attachments

        Activity

          People

            Unassigned Unassigned
            rcordier René Cordier
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: