[ 
https://issues.apache.org/jira/browse/JAMES-3422?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lan Khuat updated JAMES-3422:
-----------------------------
    Description: 
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*
{code:java}
{
   "using": [ "urn:ietf:params:jmap:core", "urn:ietf:params:jmap:mail" ],
   "methodCalls": [
       [
           "Email/set",
           {
                "accountId": 
"29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
                "destroy": ["0001"]
           },
           "c1"]
      ]
}
{code}

 *Response*

 
{code:java}
{
  "sessionState": "75128aab4b1b",
  "methodResponses": [[
    "Mailbox/set",
    {
      "accountId": 
"29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
      "newState": "000001",
      "destroyed": ["0001"]
    },
    "c1"]]
}{code}

 *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

  was:
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


> 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
>            Priority: Major
>
> 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*
> {code:java}
> {
>    "using": [ "urn:ietf:params:jmap:core", "urn:ietf:params:jmap:mail" ],
>    "methodCalls": [
>        [
>            "Email/set",
>            {
>                 "accountId": 
> "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
>                 "destroy": ["0001"]
>            },
>            "c1"]
>       ]
> }
> {code}
>  *Response*
>  
> {code:java}
> {
>   "sessionState": "75128aab4b1b",
>   "methodResponses": [[
>     "Mailbox/set",
>     {
>       "accountId": 
> "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
>       "newState": "000001",
>       "destroyed": ["0001"]
>     },
>     "c1"]]
> }{code}
>  *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: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org

Reply via email to