~bitfehler/m2dir

6009dabe3c4c5972315dc48d06cd2545ae4704a7 — Conrad Hoffmann 2 months ago 100b768
Use IANA names for standard flags

They were already the reference anyways, and just using the IANA name is
a much more neutral approach. The `$Deleted` IMAP flag was pulled in
because it is likely to occur often in the wild.
1 files changed, 23 insertions(+), 35 deletions(-)

M index.md
M index.md => index.md +23 -35
@@ 311,45 311,33 @@ uses different flags.
These flags are used for special purposes and are usually not be presented
verbatim to the user (though they may trigger certain visual cues in the
presentation, such as the highlighting of unread messages). As such, they start
with a backslash (`\`) to avoid conflicts with user-defined flags. Note that it
is technically possible to have user-defined flags starting with a backslash,
but it is **strongly recommended** that applications do not allow this. 
with a dollar sign (`$`) to avoid conflicts with user-defined flags. Note that
it is technically possible to have user-defined flags starting with a dollar
sign, but it is **strongly recommended** that applications do not allow this.

The standard flags are: all [IMAP system flags][imap-flags], verbatim, minus
the deprecated `\Recent`, plus all [IANA-defined IMAP keywords][iana-kw], but
with the leading `$` replaced with a `\`.
The standard flags are all [IANA-defined IMAP keywords][iana-kw], verbatim,
minus the reserved `$recent`, plus the [IMAP flag][imap-flags] `\Deleted`, but
with the leading `\` replaced with a `$`.

At the time of this writing, these are:

* `\Seen` - Message has been read. Corresponds to the IMAP flag of the same
  name.
* `\Answered` - Message has been answered. Corresponds to the IMAP flag of the
  same name.
* `\Forwarded` - Message has been forwarded. Corresponds to the IMAP keyword
  `$Forwarded`.
* `\Flagged` - Message is "flagged" for urgent/special attention. Corresponds
  to the IMAP flag of the same name.
* `\Deleted` - Message is "deleted" for removal by later EXPUNGE. Corresponds
  to the IMAP flag of the same name.
* `\Draft` - Message has not completed composition (marked as a draft).
  Corresponds to the IMAP flag of the same name.
* `\Important` - Message is marked as "important". Corresponds to the IMAP
  keyword `$Important`.
* `\MDNSent` - A Message Disposition Notification has been sent. Corresponds to
  the IMAP keyword `$MDNSent`.
* `\Junk` - Message definitely contains junk. Corresponds to the IMAP keyword
  `$Junk`.
* `\NotJunk` - Message does definitely not contain junk. Corresponds to the
  IMAP keyword `$NotJunk`.
* `\Phishing` - Message is likely a phishing attempt. Corresponds to the IMAP
  keyword `$Phishing`.
* `$seen` - Message has been read.
* `$answered` - Message has been answered.
* `$Forwarded` - Message has been forwarded.
* `$flagged` - Message is "flagged" (by the user) for urgent/special attention.
* `$Deleted` - Message is marked "deleted", for later removal.
* `$draft` - Message has not completed composition (marked as a draft).
* `$Important` - Message is marked as "important".
* `$MDNSent` - A Message Disposition Notification has been sent.
* `$Junk` - Message definitely contains junk.
* `$NotJunk` - Message does definitely not contain junk.
* `$Phishing` - Message is likely a phishing attempt.

[imap-flags]: https://www.rfc-editor.org/rfc/rfc9051#name-flags-message-attribute
[iana-kw]: https://www.iana.org/assignments/imap-jmap-keywords/imap-jmap-keywords.xhtml

New flags may be defined later. Any new IMAP keywords (i.e. scope "IMAP" or
"BOTH") added to the IANA registry automatically become a standard m2dir flag
(with the leading `$` replaced with a `\`).
New flags may be defined later. Any new keywords added to the IANA registry
automatically become a standard m2dir flag.

# Mail delivery
[delivery]: #mail-delivery


@@ 357,10 345,10 @@ New flags may be defined later. Any new IMAP keywords (i.e. scope "IMAP" or
## Default delivery folder

An application delivering a new message which originates from a remote without
a well-defined folder hierarchy (for example SMTP-delivery) **must** perform the
following steps to determine the final storage location for the message. It is
assumed that the application has a configured target directory for mail for a
certain user (e.g. `~/Mail`):
a well-defined folder hierarchy (for example SMTP-delivery) **must** perform
the following steps to determine the final storage location for the message. It
is assumed that the application has a configured target directory for mail for
a certain user (e.g. `~/Mail`):

1. Check if target directory is a valid m2dir (contains `.m2dir` marker file)
   * If yes, deliver message to this directory; done