Lan Khuat created JAMES-3422:
--------------------------------

             Summary: Email/set destroy implementation
                 Key: JAMES-3422
                 URL: https://issues.apache.org/jira/browse/JAMES-3422
             Project: James Server
          Issue Type: Bug
            Reporter: Lan Khuat


This is the implementation of the destroy part of Email/set.

>From JMAP specs [https://jmap.io/spec-mail.html#emailset] :
{quote}Destroying an Email removes it from all Mailboxes to which it belonged. 
To just delete an Email to trash, simply change the mailboxIds property, so it 
is now in the Mailbox with a role property equal to trash, and remove all other 
Mailbox ids.
{quote}
{quote}When emptying the trash, clients SHOULD NOT destroy Emails that are also 
in a Mailbox other than trash. For those Emails, they SHOULD just remove the 
trash Mailbox from the Email.
{quote}
When destroying an email, it removes it from all mailboxes to which it belongs. 
Any other operation is an update of {{Mailboxids}} and is of no concern in this 
ticket.

*Example*

*Request*

```
 {{{
   "using": [ "urn:ietf:params:jmap:core", "urn:ietf:params:jmap:mail" ],
   "methodCalls": [
       [
           "Email/set",
           \{
                "accountId": 
"29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
                "destroy": ["0001"]
           },
           "c1"]
      ]
}}}
```
{{}}
*Response*

```
 {{{
  "sessionState": "75128aab4b1b",
  "methodResponses": [[
    "Mailbox/set",
    \{
      "accountId": 
"29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
      "newState": "000001",
      "destroyed": ["0001"]
    },
    "c1"]]
}}}
```
{{}}
*DoD*
 * Write integration tests showing email is getting removed from all Mailboxes 
it belongs to and deleted from the system when doing an Email/set destroy



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to