RFC 3503

Message Disposition Notification (MDN) profile for Internet Message Access Protocol (IMAP)

πŸ“… published March 2003, from ietf

RFC 3503: Message Disposition Notification (MDN) profile for Internet Message Access Protocol (IMAP) πŸ’Œ

  • Network Working Group 🌐
  • Author: A. Melnikov, ACI Worldwide/MessagingDirect πŸ§‘β€πŸ’»
  • Category: Standards Track βœ…
  • Date: March 2003 πŸ“…
  • Obsoletes / Updates: nothing is listed in this title block πŸ€·β€β™€οΈ

Status of This Memo πŸ“œ

okay so this one is an Internet standards track protocol for the Internet community, and it's literally asking for discussion and suggestions for improvements 🫢 for the official standardization state and status, check the current edition of the "Internet Official Protocol Standards" (STD 1). distribution of this memo is unlimited, so share away πŸ’–

Copyright (C) The Internet Society (2003). All Rights Reserved. πŸ’œ

Abstract πŸ“

bestie, so the Message Disposition Notification (MDN) facility from RFC 2298 is how a message can ask "hey, did you actually process me?" and it also defines the format for the reply πŸ“¬ but here's the tea: it never explains how multiple Mail User Agents (MUAs) should handle generating MDNs when everyone is using an Internet Message Access Protocol (IMAP4) environment 😭

this document fills that gap πŸŽ€ it explains how to handle MDNs in that setup and gives guidelines for IMAP4 implementers who want MDN support in their products ✨

Table of Contents πŸ“š

1.  Conventions Used in this Document.............................  2
2.  Introduction and Overview.....................................  2
3.  Client behavior...............................................  3
    3.1. Client behavior when receiving a message.................  5
    3.2. Client behavior when copying a message...................  5
    3.3. Client behavior when sending a message...................  5
    3.4. Client behavior when saving a temporary message..........  5
4.  Server behavior...............................................  5
    4.1. Server that supports arbitrary keywords..................  5
    4.2. Server that supports only $MDNSent keyword...............  5
    4.3. Interaction with IMAP ACL extension......................  6
5.  Examples......................................................  6
6.  Security Considerations.......................................  7
7.  Formal Syntax.................................................  7
8.  Acknowledgments...............................................  7
9.  Normative References..........................................  8
10. Author's Address..............................................  8
11. Full Copyright Statement......................................  9

1. Conventions Used in this Document πŸŽ€

C: and S: in the examples are just showing which lines come from the client and which come from the server πŸ’β€β™€οΈ

the words "MUST", "MUST NOT", "SHOULD", "SHOULD NOT", and "MAY" are the all-caps ones that matter in this document, and they carry the meanings from "Key words for use in RFCs to Indicate Requirement Levels" [KEYWORDS] πŸ”₯ so when you see them in caps, they're serious, no cap

2. Introduction and Overview πŸ¦‹

this memo adds one extra [IMAP4] mailbox keyword so that multiple Mail User Agents (MUAs) can tell whether a requested receipt notification has already been sent πŸ™ˆ

btw, plain [MDN] doesn't need any special IMAP support when someone only uses the mailstore from one computer with a single MUA πŸ’… in that case the MUA just does what [MDN] describes: it does automatic processing, generates the MDNs, performs the requested action, and sends the MDNs with the user's permission 🫢 it won't send an MDN twice because it keeps track of what it already sent in a local configuration. but that falls apart when IMAP is used to reach the same mailstore from different locations or with different MUAs 😭

this document defines a new special purpose mailbox keyword, $MDNSent, and MUAs must use it. it doesn't add any new IMAP command or response. instead it describes a technique that MUAs should use to get along with each other 🀝

when a client opens a mailbox for the first time, it checks that the server can store the $MDNSent keyword by looking at the PERMANENTFLAGS response code πŸ‘€ and to support MDN in IMAP at all, a server MUST support either the $MDNSent keyword or arbitrary message keywords. no exceptions, bestie πŸ’€

3. Client behavior πŸ’…

the client side doesn't need many extra steps in mail processing. this timeline is a tweak on the one in Section 4 of [MDN] 🧚

-- User composes message.

-- User tells MUA to send message.

-- MUA passes message to MSA (original recipient information passed
      along).  MUA [optionally] saves message to a folder for sent mail
      with $MDNSent flag set.

-- MSA sends message to MTA.

-- Final MTA receives message.

-- Final MTA delivers message to MUA (possibly generating DSN).

-- MUA logs into IMAP server, opens mailbox, verifies if mailbox can
      store $MDNSent keyword by examining PERMANENTFLAGS response.

-- MUA performs automatic processing and generates corresponding MDNs
      ("dispatched", "processed", "deleted", "denied" or "failed"
      disposition type with "automatic-action" and "MDN-sent-
      automatically" disposition modes) for messages that do not have
      $MDNSent keyword, or \Draft flag set. (*)

-- MUA sets the $MDNSent keyword for every message that required an
      automatic MDN to be sent, whether or not the MDN was sent.

-- MUA displays a list of messages to user.

-- User selects a message and requests that some action be performed
      on it.

-- MUA performs requested action and, with user's permission, sends
      appropriate MDN ("displayed", "dispatched", "processed",
      "deleted", "denied" or "failed" disposition type with "manual-
      action" and "MDN-sent-manually" or "MDN-sent-automatically"
      disposition mode).  If the generated MDN is saved to a mailbox
      with the APPEND command, the client MUST specify the $MDNSent
      keyword in the APPEND.

-- MUA sets the $MDNSent keyword for all messages for which the user
      confirmed the dispatching of disposition (or was explicitly
      prohibited to do so).

-- User possibly performs other actions on message, but no further
      MDNs are generated.
(*) Heads up, bestie: MUA MUST NOT use the \Recent flag as the signal that it should send an MDN 🚫 the reason is that [IMAP4] says, "If multiple connections have the same mailbox selected simultaneously, it is undefined which of these connections will see newly-arrived messages with \Recent set and which will see it without \Recent set". so relying on \Recent would make client behavior unpredictable across different IMAP4 servers πŸ’€ the client MAY use the \Seen flag as one of the indicators that an MDN must not be sent. the client MUST NOT use any other standard flags, like \Draft or \Answered, to indicate that an MDN was previously sent, since those already have their own well known meanings. either way, when the $MDNSent keyword is present, the client MUST ignore all other flags or keywords for the purpose of generating an MDN and MUST NOT send the MDN πŸ™…β€β™€οΈ

when the client opens a mailbox for the first time, it must verify that the server supports the $MDNSent keyword or arbitrary message keywords by examining the PERMANENTFLAGS response code πŸ‘€

the client MUST NOT try to set the $MDNSent keyword if the server can't store it permanently 🚫

the client MUST be prepared to get NO back from the server as the result of STORE $MDNSent when the server says it supports arbitrary keywords. the reason is that the server may limit how many message keywords it can store in one mailbox πŸ“¦ and a client SHOULD NOT send an MDN if it fails to store the $MDNSent keyword πŸ›‘

once the $MDNSent keyword is set, it MUST NOT be unset by a client πŸ”’ the client MAY set the $MDNSent keyword when a user denies sending the notification, and that stops every other MUA from sending an MDN for that message πŸ™Š

3.1. Client behavior when receiving a message πŸ“¨

the client MUST NOT send an MDN if a message has the $MDNSent keyword set. it also MUST NOT send an MDN if a message has the \Draft flag, because some clients use that flag to mark a message as incomplete ✍️

check the timeline in section 3 for the details on client behavior when receiving a message 🧚

3.2. Client behavior when copying a message πŸ“‹

the client SHOULD verify that $MDNSent is preserved on a COPY operation βœ… and when a message gets copied between servers with the APPEND command, the client MUST set the $MDNSent keyword correctly 🫢

3.3. Client behavior when sending a message πŸ“€

when saving a sent message to any folder, the client MUST set the $MDNSent keyword so another client doesn't send an MDN for that message πŸ’Œ

3.4. Client behavior when saving a temporary message πŸ’Ύ

when saving an unfinished message to any folder, client MUST set $MDNSent keyword to stop another client from sending an MDN for the message 🌸


5. Examples ✨

Okay, examples time, and these are so good. πŸ¦‹ Every one of them is a little conversation between the mail app (MUA) and the server, and they show exactly what the server says back.

  1. MUA opens mailbox for the first time. πŸ’Œ

a) The server supports storing of arbitrary keywords 🌈

C: a100 select INBOX
S: * FLAGS (\Flagged \Draft \Deleted \Seen)
S: * OK [PERMANENTFLAGS (\Flagged \Draft \Deleted \Seen \*)]
S: * 5 EXISTS
S: * 3 RECENT
S: * OK [UIDVALIDITY 894294713]
S: a100 OK [READ-WRITE] Completed

b) The server supports storing of the $MDNSent keyword πŸŽ€

C: a100 select INBOX
S: * FLAGS (\Flagged \Draft \Deleted \Seen $MDNSent)
S: * OK [PERMANENTFLAGS (\Flagged \Draft \Deleted \Seen $MDNSent)]
S: * 5 EXISTS
S: * 3 RECENT
S: * OK [UIDVALIDITY 894294713]
S: a100 OK [READ-WRITE] Completed
  1. The MUA successfully sets the $MDNSent keyword πŸ’…
C: a200 STORE 4 +FLAGS ($MDNSent)
S: * 4 FETCH (FLAGS (\Flagged \Seen $MDNSent))
S: * FLAGS ($MDNSent \Flagged \Deleted \Draft \Seen)
S: * OK [PERMANENTFLAGS ($MDNSent \Flagged \Deleted \Draft \Seen \*)]
S: a200 OK STORE completed
  1. The server refuses to store the $MDNSent keyword πŸ’€
C: a200 STORE 4 +FLAGS ($MDNSent)
S: a200 NO STORE failed : no space left to store $MDNSent keyword
  1. All clients and servers MUST treat the $MDNSent keyword as case insensitive in all operations, as stated in [IMAP]. πŸ™ˆ Yes, the server is allowed to be chaotic about capital letters, but the keyword still has to match no matter how it's typed!
C: a300 FETCH 1:* FLAGS
S: * 1 FETCH (FLAGS (\Seen))
S: * 2 FETCH (FLAGS (\Answered \Seen $MdnSENt))
S: * 3 FETCH (FLAGS ())
S: * 4 FETCH (FLAGS (\Flagged \Seen $MdnSENT))
S: * 5 FETCH (FLAGS ($MDNSent))
S: * 6 FETCH (FLAGS (\Recent))
S: a300 OK FETCH completed
C: a400 SEARCH KEYWORDS $mdnsent
S: * SEARCH 2 4 5
S: a400 OK SEARCH completed

6. Security Considerations πŸ”

Good news, bestie: there are no known security issues with this extension, at least none that aren't already covered in [MDN] and/or [IMAP4]. 🫢

Heads up! Section 4.3 changes the ACL checking requirements on an IMAP server that implements the IMAP [ACL] extension. Read that section carefully, it matters a lot. 🚨

7. Formal Syntax πŸ“œ

Okay, here's the grammar part. It uses the augmented Backus-Naur Form (BNF) notation as specified in [RFC-822], as modified by [IMAP4]. Any non-terminals that are referenced but not defined below are defined by [IMAP4], so go check there if you're confused. 🧚

Alphabetic characters are case-insensitive, unless it's noted otherwise. Using upper or lower case to write out token strings is just for editorial clarity. Implementations MUST accept these strings in a case-insensitive fashion. πŸ’œ

flag_keyword    ::= "$MDNSent" / other_keywords

other_keywords  ::= atom

8. Acknowledgments 🌸

This document came out of discussions on the IMAP mailing list, so big shout-out to that whole crew. πŸ₯° Special gratitude goes to Cyrus Daboo and Randall Gellens for reviewing it, you two are iconic. πŸ‘‘

Thank you to my father, who, as he has helped to make me who I am, I miss you terribly. πŸ•ŠοΈπŸ’–

9. Normative References πŸ“š

[KEYWORDS] Bradner, S., "Key words for use in RFCs to Indicate
           Requirement Levels", BCP 14, RFC 2119, March 1997.

[MDN]      Fajman, R., "An Extensible Message Format for Message
           Disposition Notifications", RFC 2298, March 1998.

[IMAP4]    Crispin, M., "Internet Message Access Protocol - Version
           4rev1", RFC 3501, March 2003.

[ACL]      Myers, J., "IMAP4 ACL extension", RFC 2086, January 1997.

10. Author's Address πŸ–‹οΈ

Alexey Melnikov
ACI Worldwide/MessagingDirect
59 Clarendon Road
Watford, Hertfordshire
United Kingdom, WD17 1FQ

Phone: +44 1923 81 2877
EMail: mel@messagingdirect.com

Copyright (C) The Internet Society (2003). All Rights Reserved.

This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English.

The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns.

This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

Acknowledgement πŸ’›

Funding for the RFC Editor function is currently provided by the Internet Society. ✨

πŸ“¦ where this page comes from