Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TF-942 Auto generate missing default mailboxes in client side #974

Merged

Conversation

dab246
Copy link
Member

@dab246 dab246 commented Sep 23, 2022

#942

Related

Resolved

  • For jmap.linagora.com
Screen.Recording.2022-09-23.at.12.59.26.mov
  • For api.fastmail.com has mailbox with name Outbox
Screen.Recording.2022-09-23.at.15.00.20.mov
  • For api.fastmail.com has not mailbox with name Outbox
Screen.Recording.2022-09-23.at.15.01.48.mov

@dab246 dab246 requested review from hoangdat and ManhNTX September 23, 2022 08:16
@hoangdat
Copy link
Member

hoangdat commented Sep 23, 2022

hi @chibenwa @Arsnael How we can create mailbox and send email in the same JMAP request. I tried, but the json pointer too hard to me implement that.

Use-case

As a user, who don't have Outbox folder
I want to send email 

Proposal

  • Create Outbox folder if it is not existed (c1)
  • Set Email with created mailbox in c1 (c2)
  • Set EmailSubmission and move Email in c2 to Sent folder (c3)

Please help me to compose the JMAP request with it if we can. (We are implementing it in 2 separate JMAP requests)

@dab246 dab246 force-pushed the auto_generate_missing_default_mailboxes branch from bb87868 to a6a605a Compare September 26, 2022 03:20
@dab246 dab246 requested a review from hoangdat September 26, 2022 03:21
@Arsnael
Copy link
Member

Arsnael commented Sep 26, 2022

@hoangdat @dab246

Should work with something like that: Arsnael/james-project@622748f

If not tell me what's wrong and we can look deeper into this

This being the answer I get from the server:

{
    "sessionState": "2c9f1b12-b35a-43e6-9af2-0106fb53a943",
    "methodResponses": [
        [
            "Mailbox/set",
            {
                "accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
                "oldState": "bda01c0b-dcbe-4ae1-b70b-e770949d0ec1",
                "created": {
                    "C42": {
                        "totalThreads": 0,
                        "isSubscribed": true,
                        "totalEmails": 0,
                        "unreadThreads": 0,
                        "unreadEmails": 0,
                        "sortOrder": 1000,
                        "myRights": {
                            "mayReadItems": true,
                            "mayAddItems": true,
                            "mayRemoveItems": true,
                            "maySetSeen": true,
                            "maySetKeywords": true,
                            "mayCreateChild": true,
                            "mayRename": true,
                            "mayDelete": true,
                            "maySubmit": true
                        },
                        "id": "3"
                    }
                },
                "newState": "6af50957-1157-4e72-a44d-eb87c9dd3921"
            },
            "c0"
        ],
        [
            "Email/set",
            {
                "accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
                "oldState": "2c9f1b12-b35a-43e6-9af2-0106fb53a943",
                "newState": "55be4432-7ece-466a-8d1b-5b95e38e4768",
                "created": {
                    "e1526": {
                        "id": "1",
                        "blobId": "1",
                        "threadId": "1",
                        "size": 383
                    }
                }
            },
            "c1"
        ],
        [
            "EmailSubmission/set",
            {
                "accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
                "newState": "2c9f1b12-b35a-43e6-9af2-0106fb53a943",
                "created": {
                    "k1490": "1f8ace54-0ec1-44c5-bd2d-98f8358d333c"
                }
            },
            "c2"
        ],
        [
            "Email/set",
            {
                "accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
                "oldState": "55be4432-7ece-466a-8d1b-5b95e38e4768",
                "newState": "c820f03a-d832-4b9a-9f0a-ece47af5630a",
                "updated": {
                    "1": null
                }
            },
            "c2"
        ]
    ]
}

@dab246
Copy link
Member Author

dab246 commented Sep 26, 2022

@hoangdat @dab246

Should work with something like that: Arsnael/james-project@622748f

If not tell me what's wrong and we can look deeper into this

This being the answer I get from the server:

{
    "sessionState": "2c9f1b12-b35a-43e6-9af2-0106fb53a943",
    "methodResponses": [
        [
            "Mailbox/set",
            {
                "accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
                "oldState": "bda01c0b-dcbe-4ae1-b70b-e770949d0ec1",
                "created": {
                    "C42": {
                        "totalThreads": 0,
                        "isSubscribed": true,
                        "totalEmails": 0,
                        "unreadThreads": 0,
                        "unreadEmails": 0,
                        "sortOrder": 1000,
                        "myRights": {
                            "mayReadItems": true,
                            "mayAddItems": true,
                            "mayRemoveItems": true,
                            "maySetSeen": true,
                            "maySetKeywords": true,
                            "mayCreateChild": true,
                            "mayRename": true,
                            "mayDelete": true,
                            "maySubmit": true
                        },
                        "id": "3"
                    }
                },
                "newState": "6af50957-1157-4e72-a44d-eb87c9dd3921"
            },
            "c0"
        ],
        [
            "Email/set",
            {
                "accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
                "oldState": "2c9f1b12-b35a-43e6-9af2-0106fb53a943",
                "newState": "55be4432-7ece-466a-8d1b-5b95e38e4768",
                "created": {
                    "e1526": {
                        "id": "1",
                        "blobId": "1",
                        "threadId": "1",
                        "size": 383
                    }
                }
            },
            "c1"
        ],
        [
            "EmailSubmission/set",
            {
                "accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
                "newState": "2c9f1b12-b35a-43e6-9af2-0106fb53a943",
                "created": {
                    "k1490": "1f8ace54-0ec1-44c5-bd2d-98f8358d333c"
                }
            },
            "c2"
        ],
        [
            "Email/set",
            {
                "accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
                "oldState": "55be4432-7ece-466a-8d1b-5b95e38e4768",
                "newState": "c820f03a-d832-4b9a-9f0a-ece47af5630a",
                "updated": {
                    "1": null
                }
            },
            "c2"
        ]
    ]
}

@Arsnael Cool, Thanks u.

@dab246 dab246 force-pushed the auto_generate_missing_default_mailboxes branch from a6a605a to 6044225 Compare September 26, 2022 07:41
@hoangdat hoangdat merged commit 106a0c4 into linagora:master Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants