You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by "Benoit Tellier (Jira)" <se...@james.apache.org> on 2021/04/16 16:16:00 UTC

[jira] [Created] (JAMES-3566) EmailSubmission/set does an Email/set implicit call when no onSuccess properties

Benoit Tellier created JAMES-3566:
-------------------------------------

             Summary: EmailSubmission/set does an Email/set implicit call when no onSuccess properties
                 Key: JAMES-3566
                 URL: https://issues.apache.org/jira/browse/JAMES-3566
             Project: James Server
          Issue Type: Bug
          Components: JMAP
    Affects Versions: 3.6.0
            Reporter: Benoit Tellier
            Assignee: Antoine Duprat
             Fix For: 3.7.0, 3.6.1


{code:java}
{
  "using": ["urn:ietf:params:jmap:core", "urn:ietf:params:jmap:mail", "urn:ietf:params:jmap:submission"],
  "methodCalls": [
     ["EmailSubmission/set", {
       "accountId": "$ACCOUNT_ID",
       "create": {
         "k1490": {
           "emailId": "${messageId.serialize}",
           "envelope": {
             "mailFrom": {"email": "${BOB.asString}"},
             "rcptTo": [{"email": "${ANDRE.asString}"}]
           }
         }
    }
  }, "c1"]]
}
{code}

Returns:

{code:java}
{
    "sessionState": "2c9f1b12-b35a-43e6-9af2-0106fb53a943",
    "methodResponses": [
        [
            "EmailSubmission/set",
            {
                "accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
                "newState": "2c9f1b12-b35a-43e6-9af2-0106fb53a943",
                "notCreated": {
                    "k1490": {
                        "type": "forbiddenMailFrom",
                        "description": "Attempt to send a mail whose MimeMessage From and Sender fields not allowed for connected user: List(andre@domain.tld)"
                    }
                }
            },
            "c1"
        ],
        [
            "Email/set",
            {
                "accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
                "oldState": "668a394e-a324-4d3d-bef0-945ae79f18c8",
                "newState": "668a394e-a324-4d3d-bef0-945ae79f18c8"
            },
            "c1"
        ]
    ]
}
{code}

The empty Email/set call should not be performed when no onSuccessXXX properties is specified.

Thus this would be more appropriate:


{code:java}
{
    "sessionState": "2c9f1b12-b35a-43e6-9af2-0106fb53a943",
    "methodResponses": [
        [
            "EmailSubmission/set",
            {
                "accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
                "newState": "2c9f1b12-b35a-43e6-9af2-0106fb53a943",
                "notCreated": {
                    "k1490": {
                        "type": "forbiddenMailFrom",
                        "description": "Attempt to send a mail whose MimeMessage From and Sender fields not allowed for connected user: List(andre@domain.tld)"
                    }
                }
            },
            "c1"
        ]
    ]
}
{code}

Reported by Tung on Gitter...




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

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org