RFC 8514

Internet Message Access Protocol (IMAP) - SAVEDATE Extension

πŸ“… published January 2019, from ietf

RFC 8514: Internet Message Access Protocol (IMAP) - SAVEDATE Extension πŸ’–

Bestie, this one's by S. Bosch of Open Xchange Oy. It's a Standards Track doc, dated January 2019, with ISSN 2070-1721. It doesn't list anything it obsoletes or updates, so it's a standalone main character πŸŽ€

Table of Contents

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   2
   2.  Conventions Used in This Document . . . . . . . . . . . . . .   3
   3.  Save Date Message Attribute . . . . . . . . . . . . . . . . .   3
   4.  IMAP Protocol Changes . . . . . . . . . . . . . . . . . . . .   4
     4.1.  CAPABILITY Identification . . . . . . . . . . . . . . . .   4
     4.2.  FETCH Command and Response Extensions . . . . . . . . . .   4
     4.3.  SEARCH Command Extension  . . . . . . . . . . . . . . . .   4
   5.  Formal Syntax . . . . . . . . . . . . . . . . . . . . . . . .   5
   6.  Security Considerations . . . . . . . . . . . . . . . . . . .   5
   7.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .   6
   8.  Normative References  . . . . . . . . . . . . . . . . . . . .   6
   Acknowledgements  . . . . . . . . . . . . . . . . . . . . . . . .   7
   Author's Address  . . . . . . . . . . . . . . . . . . . . . . . .   7

Abstract

okay so this doc adds a new capability called SAVEDATE to IMAP (the Internet Message Access Protocol) ✨ It defines a new message attribute called "save date". Unlike the existing "internal date" attribute, the save date always tells you the moment the message was saved in its current mailbox πŸ¦‹ The FETCH command gets a way to retrieve it, and the SEARCH command gets a way to use it in search criteria. It's giving organization πŸ’…

Status of This Memo

This is an Internet Standards Track document. 🌸

This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 7841.

Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at https://www.rfc-editor.org/info/rfc8514. πŸ”₯

Copyright (c) 2019 IETF Trust and the persons identified as the document authors. All rights reserved. πŸŽ€

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. πŸ“œ


1. Introduction ✨

okay so this doc extends IMAP [IMAP4rev1] with a new capability called "SAVEDATE" πŸ’– That capability adds a new IMAP message attribute called "save date". The save date is the date and time at which a message was saved in the mailbox where it currently lives.

The save date is kind of like the existing "internal date" attribute, because both get set at delivery time. But the internal date can be set to whatever value you want for messages delivered with the APPEND command, and it's usually copied from the source message for messages delivered with the COPY command. The save date is different 😀 It's always set to the current date and time at the moment the message is saved in the mailbox, no matter how the message got there or where it came from. Iconic.

The save date is useful for automatically removing messages from a mailbox after a configured amount of time 🧚 For that to work, you need to know when the message was saved in the mailbox, and the internal date can't reliably tell you that.

Here's a classic example. Lots of clients move deleted messages to a Trash mailbox, and those messages count as "deleted" the moment they land there. To keep Trash from getting huge, a client might want to permanently remove (expunge) everything in Trash that was deleted before a certain time, like a configurable expiration interval πŸ—‘οΈ The internal date won't work for that, because it probably points to when the message was first received. The right thing to compare is when it was saved to the Trash mailbox. Archiving solutions have similar patterns, so it's not just a Trash thing πŸ“

So the SAVEDATE capability extends the FETCH command and response so you can grab the date and time a message was saved. It also extends the SEARCH command so you can search messages by when they were saved in the mailbox 🫢

2. Conventions Used in This Document

In examples, "C:" marks lines sent by a client connected to a server. "S:" marks lines sent by the server to the client. πŸ’…

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [KEYWORDS] [KEYWORDS-UPD] when, and only when, they appear in all capitals, as shown here. πŸŽ€ Only the all-caps versions count as the official requirement words, so lowercase is just regular English πŸ™ˆ

3. Save Date Message Attribute

The save date is the date and time at which the message was saved in the mailbox where it's now located 🌈 Unlike the internal date defined by [IMAP4rev1], this value can't be set arbitrarily when a message is delivered with the IMAP APPEND command. Also, when a message is delivered to a mailbox with the IMAP COPY command [IMAP4rev1] or the IMAP MOVE command [IMAP-MOVE], the save date is not copied from the source message. Instead, the current date and time at which the message is delivered to a mailbox MUST be used to set the save date. Once it's calculated, the save date MUST NOT change as long as the message stays in that same mailbox πŸ”’

So if a message gets copied to another mailbox, its save date in the source mailbox stays exactly the same. Only the new copy gets a new save date ✨ That also means that when a message is moved to another mailbox, whether with the MOVE command or with a command sequence involving the COPY command [IMAP-MOVE], the message always gets a fresh save date in the destination mailbox πŸ¦‹

Some mailboxes have underlying storage that doesn't support the save date attribute at all. How that's handled is spelled out in detail in the next section, for each IMAP command involved 🧚

4. IMAP Protocol Changes

4.1. CAPABILITY Identification

Okay this one's simple. IMAP servers that support this extension MUST include "SAVEDATE" in the response list to the CAPABILITY command πŸ’–

4.2. FETCH Command and Response Extensions

This extension defines one new data item for the FETCH command πŸŽ€

  • SAVEDATE: the save date of the message.

It also defines one new data item for the FETCH response 🌸

  • SAVEDATE: a string representing the save date of the message. BUT if the underlying mailbox storage doesn't support the save date message attribute, the value returned for the SAVEDATE item is always NIL, not a string. 😭

Here's an example, bestie πŸ‘‘

C: A101 FETCH 998 (SAVEDATE)
S: * 998 FETCH (SAVEDATE "01-Jan-2015 18:50:53 +0100")
S: A101 OK Fetch completed.

4.3. SEARCH Command Extension

This extension defines four new search keys for the SEARCH command πŸ”

  • SAVEDBEFORE <date>: messages whose save date (ignoring time and timezone) is earlier than the specified date.
  • SAVEDON <date>: messages whose save date (ignoring time and timezone) falls within the specified date.
  • SAVEDSINCE <date>: messages whose save date (ignoring time and timezone) is within or later than the specified date.
  • SAVEDATESUPPORTED: matches all messages in the mailbox when that mailbox's underlying storage supports the save date attribute. Conversely, it matches no messages in the mailbox when the save date attribute isn't supported. 🧐
Heads up: when the underlying storage of a mailbox doesn't support the save date attribute, the SAVEDBEFORE, SAVEDON, and SAVEDSINCE search keys MUST use the internal date attribute instead. 🚨 In the context of the IMAP Multimailbox SEARCH Extension [MULTISEARCH], this fallback MUST apply to each mailbox individually, so only the mailboxes that lack save date support fall back to the internal date.

Some examples to vibe with πŸ’…

C: A102 SEARCH SAVEDON 28-Dec-2014
S: * SEARCH 993 994
S: A102 OK Search completed.
C: A103 SEARCH SAVEDSINCE 28-Dec-2014
S: * SEARCH 993 994 995 996 997 998 999 1000 1001
S: A103 OK Search completed.

πŸŽ€ Part 1 of 2 ends here. Sections 5 through 8, the Acknowledgements, the Author's Address, and the full References list are coming in part 2 πŸ’–

Author's Address πŸ’Œ

okay bestie, last stop! 🧚 this is where you find the human behind the spec. the author is Stephan Bosch from Open Xchange Oy in Espoo, Finland, and you can reach him at the email below πŸ’–

   Stephan Bosch
   Open Xchange Oy
   Lars Sonckin kaari 12
   Espoo  02600
   Finland

   Email: stephan.bosch@open-xchange.com

that's the whole RFC, babe!! πŸ¦‹ you made it through the entire thing 😭🫢 we are so proud of you ✨

πŸ“¦ where this page comes from