Uploaded image for project: 'James Server'
  1. James Server
  2. JAMES-3566

EmailSubmission/set does an Email/set implicit call when no onSuccess properties

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.6.0
    • 3.7.0, 3.6.1
    • JMAP
    • None

    Description

      {
        "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"]]
      }
      

      Returns:

      {
          "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"
              ]
          ]
      }
      

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

      Thus this would be more appropriate:

      {
          "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"
              ]
          ]
      }
      

      Reported by Tung on Gitter...

      Attachments

        Issue Links

          Activity

            People

              aduprat Antoine Duprat
              btellier Benoit Tellier
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m