Subject: [Jmap] Review: draft-ietf-jmap-mdn-04

From: "Bron Gondwana" <[email-masked]>
Date: Wed, 29 Jan 2020 17:21:45 +1100

As promised, a review of the current draft.

*2.1 MDN/set*

Looking at this some more, it doesn't make sense to call this method /set - it doesn't work the same way as regular set commands. It doesn't create an object which can later be fetched, or return an id. It would be better to rename this so it doesn't create confusion.

I suggest something like:

       [[ "MDN/generate", {
         "accountId": "ue150411c",
         "for": {
           "Md45b47b4877521042cec0938": {
             "subject": "Read receipt for: World domination",
             "textBody": "This receipt shows that the email has been
                 displayed on your recipient's computer. There is no
                 guaranty it has been read or understood.",
             "reportingUA": "linagora.com; OpenPaaS",
             "disposition": {
               "actionMode": "manual-action",
               "sendingMode": "MDN-sent-manually",
               "type": "displayed"
             }
           }
         }
       }, "R1" ]]

Response:

     [[ "MDN/generate", {
       "accountId": "ue150411c",
       "generated": {
         "Md45b47b4877521042cec0938": {
           "finalRecipient": "rfc822; [email-masked]",
           "originalMessageId": "<[email-masked]>"
         }
       }
     }, "R1" ],
     [ "Email/set", {
       "updated" : [ "Md45b47b4877521042cec0938" ],
       ... 
     }, "R1" ]]

and of course: there's also "notGenerated" : { "emailId" : { ErrorObject }} with probably a specific error code for mdnAlreadySent.

       [[ "MDN/generate", {
         "accountId": "ue150411c",
         "for": {
           "Md45b47b4877521042cec0938": {
             "subject": "Read receipt for: World domination",
             "textBody": "This receipt shows that the email has been
                 displayed on your recipient's computer. There is no
                 guaranty it has been read or understood.",
             "reportingUA": "linagora.com; OpenPaaS",
             "disposition": {
               "actionMode": "manual-action",
               "sendingMode": "MDN-sent-manually",
               "type": "displayed"
             }
           }
         }
       }, "R2" ]]

Response:

     [[ "MDN/generate", {
       "accountId": "ue150411c",
       "notGenerated": {
         "Md45b47b4877521042cec0938": {
           "type": "mdnAlreadySent",
           "description" : "$MDNSent keyword is already present"
         }
       }
     }, "R2" ],

The emailId makes sense as the key for the object, since it's only legal to do one per email.

*NOTE: *I didn't mention oldState and newState here. There's not much point, because the MDN itself doesn't have state. The Email/set response should have state, because email objects have state, but it doesn't make sense to have state for MDN objects, because you can't query or fetch them.*
*

*3.1. Sending an MDN for a received email
*

The first example needs to show the Email/set response with the same method call id. There should also be an example (as above) for the error case.

*3.2. Asking for MDN
*

"header:Disposition-Notification-To": "[email-masked]",

This doesn't do quite what you expect - default is "asRaw", which doesn't add a leading space. You probably want.

"header:Disposition-Notification-To:asText": "[email-masked]",

*3.3 Parsing a received MDN*

Likewise, this should have an example of what to do when it's called on a blob which doesn't parse as a MDN, or what happens when the blob doesn't exist.

*General Comments**
*

Ideally each method should mention what kinds of errors are likely to be created, e.g this kind of thing from RFC8620.

   The following SetError types are defined and may be returned for set
   operations on any record type where appropriate:

   o  "forbidden": The action
      would violate an ACL or other permissions policy.

   o  "overQuota": The create would exceed a server-
      defined limit on the number or total size of objects of this type.

   o  "tooLarge": The create would result in
      an object that exceeds a server-defined limit for the maximum size
      of a single object of this type.

   o  "rateLimit": Too many objects of this type have been
      created recently, and a server-defined rate limit has been
      reached.  It may work if tried again later.

   o  "notFound": The id given
      cannot be found.

Obviously, these need to be chosen from the existing error registry, or the IANA section should include registration for any newly added errors.

I expect security review might ask you to expand a little on the security considerations as well.

Cheers,

Bron.
*
*
-- 
 Bron Gondwana, CEO, Fastmail Pty Ltd
 [email-masked]