linagora / tmail-flutter

A multi-platform (Flutter) application for reading your emails, with your favorite devices, using the JMAP protocol!
GNU Affero General Public License v3.0
279 stars 61 forks source link

Cannot send email #2370

Open lillian-b opened 7 months ago

lillian-b commented 7 months ago

Description

I am trying to send an email through my stalwart mailserver. I have configured an identity in settings.

Expected result

Email sends successfully

Current behavior

UI shows Failure to send your message.

Preconditions (optional)

Reproduction Steps

Here is the request made by tmail: (I have obscured my email address)

{
    "methodCalls": [
        [
            "Mailbox/set",
            {
                "accountId": "a",
                "create": {
                    "5aaf0431-9212-11ee-bf89-dbd9c906062b": {
                        "isSubscribed": true,
                        "name": "Outbox"
                    }
                }
            },
            "c0"
        ],
        [
            "Email/set",
            {
                "accountId": "a",
                "create": {
                    "5aaf0432-9212-11ee-bf89-dbd9c906062b": {
                        "bcc": [],
                        "bodyValues": {
                            "5aaf0430-9212-11ee-bf89-dbd9c906062b": {
                                "isEncodingProblem": false,
                                "isTruncated": false,
                                "value": "<br><div>yes (if this email arrives, anyway)<br></div>"
                            }
                        },
                        "cc": [],
                        "from": [
                            {
                                "email": "me@mydomain.com",
                                "name": "admin"
                            }
                        ],
                        "header:User-Agent:asText": "Team-Mail/0.10.5 Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/119.0",
                        "htmlBody": [
                            {
                                "partId": "5aaf0430-9212-11ee-bf89-dbd9c906062b",
                                "type": "text/html"
                            }
                        ],
                        "mailboxIds": {
                            "#5aaf0431-9212-11ee-bf89-dbd9c906062b": true
                        },
                        "replyTo": [
                            {
                                "email": "admin",
                                "name": null
                            }
                        ],
                        "subject": "so does this work now",
                        "to": [
                            {
                                "email": "my-test-email@gmail.com",
                                "name": null
                            }
                        ]
                    }
                }
            },
            "c1"
        ],
        [
            "EmailSubmission/set",
            {
                "accountId": "a",
                "create": {
                    "5aaf0433-9212-11ee-bf89-dbd9c906062b": {
                        "emailId": "#5aaf0432-9212-11ee-bf89-dbd9c906062b",
                        "envelope": {
                            "mailFrom": {
                                "email": "me@mydomain.com"
                            },
                            "rcptTo": [
                                {
                                    "email": "my-test-email@gmail.com"
                                }
                            ]
                        },
                        "identityId": "a"
                    }
                },
                "onSuccessUpdateEmail": {
                    "#5aaf0433-9212-11ee-bf89-dbd9c906062b": {
                        "keywords/$draft": null,
                        "keywords/$seen": true,
                        "mailboxIds/#5aaf0431-9212-11ee-bf89-dbd9c906062b": null,
                        "mailboxIds/d": true
                    }
                }
            },
            "c2"
        ]
    ],
    "using": [
        "urn:ietf:params:jmap:submission",
        "urn:ietf:params:jmap:mail",
        "urn:ietf:params:jmap:core"
    ]
}

And the response from stalwart:

{
    "methodResponses": [
        [
            "Mailbox/set",
            {
                "accountId": "a",
                "oldState": "sam",
                "newState": "sam",
                "notCreated": {
                    "5aaf0431-9212-11ee-bf89-dbd9c906062b": {
                        "type": "invalidProperties",
                        "description": "A mailbox with name 'Outbox' already exists.",
                        "properties": [
                            "name"
                        ]
                    }
                }
            },
            "c0"
        ],
        [
            "error",
            {
                "type": "invalidResultReference",
                "description": "Invalid reference to non-existing object \"5aaf0431-9212-11ee-bf89-dbd9c906062b\" from \"5aaf0432-9212-11ee-bf89-dbd9c906062b\""
            },
            "c1"
        ],
        [
            "error",
            {
                "type": "invalidResultReference",
                "description": "Invalid reference to non-existing object \"5aaf0432-9212-11ee-bf89-dbd9c906062b\" from \"5aaf0433-9212-11ee-bf89-dbd9c906062b\""
            },
            "c2"
        ]
    ],
    "sessionState": "3e25b2a0"
}

Acceptance criteria

The list of acceptance criteria (defined in the corresponding User Story or coming from your functional knowledge of the product) These acceptance criteria must be met by the corrective implementation done by the developers.

I don't know what this means

Context

Devices, OS Tmail web running in Docker Client: Firefox 119 on macOS 13.6.2

Additional information

frequency, log files,... Always

hoangdat commented 7 months ago

Hi, this was discussed in https://github.com/linagora/tmail-flutter/discussions/2230. IMO, TeamMail now can work with stalwart well

lillian-b commented 7 months ago

What's the status of this ticket? I'm happy to work on a fix myself if someone would point me to the relevant code.

dab246 commented 7 months ago

@lillian-b We are fixing it. Please see PR #2398