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

Benoit Tellier commented on JAMES-3530:
---------------------------------------

> I understand the James currently infers the role from the name. Can I find a 
> map of name->role somewhere?

https://github.com/apache/james-project/blob/master/mailbox/api/src/main/java/org/apache/james/mailbox/Role.java

You will see a set of pre-defined roles 


{code:java}
    public static final Role INBOX = new Role("inbox", DefaultMailboxes.INBOX, 
NON_CASE_SENSITIVE_COMPARATOR);
    public static final Role DRAFTS = new Role("drafts", 
DefaultMailboxes.DRAFTS, CASE_SENSITIVE_COMPARATOR);
    public static final Role OUTBOX = new Role("outbox", 
DefaultMailboxes.OUTBOX, CASE_SENSITIVE_COMPARATOR);
    public static final Role SENT = new Role("sent", DefaultMailboxes.SENT, 
CASE_SENSITIVE_COMPARATOR);
    public static final Role TRASH = new Role("trash", DefaultMailboxes.TRASH, 
CASE_SENSITIVE_COMPARATOR);
    public static final Role ARCHIVE = new Role("archive", 
DefaultMailboxes.ARCHIVE, CASE_SENSITIVE_COMPARATOR);
    public static final Role SPAM = new Role("spam", DefaultMailboxes.SPAM, 
CASE_SENSITIVE_COMPARATOR);
    public static final Role TEMPLATES = new Role("templates", 
DefaultMailboxes.TEMPLATES, CASE_SENSITIVE_COMPARATOR);
    public static final Role RESTORED_MESSAGES =
        new Role("restored messages", DefaultMailboxes.RESTORED_MESSAGES, 
CASE_SENSITIVE_COMPARATOR);
{code}

As well as a custom role set up (x-whatever mailbox will have the role whatever)

> Would it make sense, as a temporary work around, to ignore the role in the 
> Set Request if it was set to the 'correct' value. Meaning the value that 
> James would have assumed anyway?

To get your example working we would need more than that. We would need to 
ignore the role property (as we are not able to handle it).

I propose to ignore it, but only for create requests.

Would it be acceptable to you in terms of inter-operability temporary fix?


> JMAP Mailbox/set is unable to set role
> --------------------------------------
>
>                 Key: JAMES-3530
>                 URL: https://issues.apache.org/jira/browse/JAMES-3530
>             Project: James Server
>          Issue Type: Sub-task
>          Components: JMAP
>    Affects Versions: master
>            Reporter: Daniel Gultsch
>            Assignee: Antoine Duprat
>            Priority: Major
>
> An attempt to create a new mailbox with the role 'archive' fails with "Some 
> server-set properties were specified".
>  
> Role is not marked as a server-set property in the JMAP spec
> {code:java}
> {
>   "methodCalls": [
>     [
>       "Mailbox/set",
>       {
>         "accountId": 
> "cf2e474f942d8ea3192028d2e37d5b08b3ddd36fb986d2ad6a19d66277a981c4",
>         "create": {
>           "mb-archive": {
>             "name": "Archive",
>             "role": "archive"
>           }
>         },
>         "ifInState": "de6ce5c0-931f-11eb-b57c-1b93c9e59cb7"
>       },
>       "0"
>     ]
>   ],
>   "using": [
>     "urn:ietf:params:jmap:core",
>     "urn:ietf:params:jmap:mail"
>   ]
> }
> {code}
>  
> Response is:
> {code:java}
> {
>   "sessionState": "2c9f1b12-b35a-43e6-9af2-0106fb53a943",
>   "methodResponses": [
>     [
>       "Mailbox/set",
>       {
>         "accountId": 
> "cf2e474f942d8ea3192028d2e37d5b08b3ddd36fb986d2ad6a19d66277a981c4",
>         "oldState": "de6ce5c0-931f-11eb-b57c-1b93c9e59cb7",
>         "newState": "de6ce5c0-931f-11eb-b57c-1b93c9e59cb7",
>         "notCreated": {
>           "mb-archive": {
>             "type": "invalidArguments",
>             "description": "Some server-set properties were specified",
>             "properties": [
>               "role"
>             ]
>           }
>         }
>       },
>       "0"
>     ]
> }
> {code}



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