···
@see <https://www.rfc-editor.org/rfc/rfc8621.html#section-1.5> RFC 8621, Section 1.5 *)
val push_event_type_email_delivery : string
+
(** Keyword string constants for JMAP email flags.
+
Provides easy access to standardized keyword string values.
@see <https://www.rfc-editor.org/rfc/rfc8621.html#section-4.1.1> RFC 8621, Section 4.1.1 *)
+
(** {1 IMAP System Flags} *)
+
(** "$draft": The Email is a draft the user is composing *)
+
(** "$seen": The Email has been read *)
+
(** "$flagged": The Email has been flagged for urgent/special attention *)
+
(** "$answered": The Email has been replied to *)
+
(** {1 Common Extension Keywords} *)
+
(** "$forwarded": The Email has been forwarded *)
+
(** "$phishing": The Email is likely to be phishing *)
+
(** "$junk": The Email is spam/junk *)
+
(** "$notjunk": The Email is explicitly marked as not spam/junk *)
+
(** {1 Apple Mail and Vendor Extensions}
+
@see <https://datatracker.ietf.org/doc/draft-ietf-mailmaint-messageflag-mailboxattribute/> *)
+
(** "$notify": Request to be notified when this email gets a reply *)
+
(** "$muted": Email is muted (notifications disabled) *)
+
(** "$followed": Email thread is followed for notifications *)
+
(** "$memo": Email has a memo/note associated with it *)
+
(** "$hasmemo": Email has a memo, annotation or note property *)
+
(** "$autosent": Email was generated or sent automatically *)
+
(** "$unsubscribed": User has unsubscribed from this sender *)
+
val unsubscribed : string
+
(** "$canunsubscribe": Email contains unsubscribe information *)
+
val canunsubscribe : string
+
(** "$imported": Email was imported from another system *)
+
(** "$istrusted": Email is from a trusted/verified sender *)
+
(** "$maskedemail": Email is to/from a masked/anonymous address *)
+
val maskedemail : string
+
(** "$new": Email was recently delivered *)
+
(** {1 Apple Mail Color Flag Bits} *)
+
(** "$MailFlagBit0": First color flag bit (red) *)
+
val mailflagbit0 : string
+
(** "$MailFlagBit1": Second color flag bit (orange) *)
+
val mailflagbit1 : string
+
(** "$MailFlagBit2": Third color flag bit (yellow) *)
+
val mailflagbit2 : string
+
(** {1 Color Flag Combinations} *)
+
(** Get color flag bit values for a specific color
+
@return A list of flags to set to create the requested color *)
+
val color_flags : [`Red | `Orange | `Yellow | `Green | `Blue | `Purple | `Gray] -> string list
+
(** Check if a string is a valid keyword according to the RFC
+
@see <https://www.rfc-editor.org/rfc/rfc8621.html#section-4.1.1> RFC 8621, Section 4.1.1 *)
+
val is_valid : string -> bool
+
(** For backward compatibility - DEPRECATED, use Keyword.draft instead *)
val keyword_draft : string
+
(** For backward compatibility - DEPRECATED, use Keyword.seen instead *)
val keyword_seen : string
+
(** For backward compatibility - DEPRECATED, use Keyword.flagged instead *)
val keyword_flagged : string
+
(** For backward compatibility - DEPRECATED, use Keyword.answered instead *)
val keyword_answered : string
+
(** For backward compatibility - DEPRECATED, use Keyword.forwarded instead *)
val keyword_forwarded : string
+
(** For backward compatibility - DEPRECATED, use Keyword.phishing instead *)
val keyword_phishing : string
+
(** For backward compatibility - DEPRECATED, use Keyword.junk instead *)
val keyword_junk : string
+
(** For backward compatibility - DEPRECATED, use Keyword.notjunk instead *)
val keyword_notjunk : string
+
(** Email keyword operations.
+
Functions to manipulate and update email keywords/flags. *)
(** Add a keyword/flag to an email *)
val add : Types.Email.t -> Types.Keywords.keyword -> Types.Email.t
(** Remove a keyword/flag from an email *)
val remove : Types.Email.t -> Types.Keywords.keyword -> Types.Email.t
+
(** {1 System Flag Operations} *)
(** Mark an email as seen/read *)
val mark_as_seen : Types.Email.t -> Types.Email.t
···
(** Mark an email as phishing *)
val mark_as_phishing : Types.Email.t -> Types.Email.t
+
(** {1 Extension Flag Operations} *)
+
(** Mark an email for notification when replied to *)
+
val mark_as_notify : Types.Email.t -> Types.Email.t
+
(** Remove notification flag from an email *)
+
val unmark_notify : Types.Email.t -> Types.Email.t
+
(** Mark an email as muted (no notifications) *)
+
val mark_as_muted : Types.Email.t -> Types.Email.t
+
(** Unmute an email (allow notifications) *)
+
val unmark_muted : Types.Email.t -> Types.Email.t
+
(** Mark an email thread as followed for notifications *)
+
val mark_as_followed : Types.Email.t -> Types.Email.t
+
(** Remove followed status from an email thread *)
+
val unmark_followed : Types.Email.t -> Types.Email.t
+
(** Mark an email with a memo *)
+
val mark_as_memo : Types.Email.t -> Types.Email.t
+
(** Mark an email with the hasmemo flag *)
+
val mark_as_hasmemo : Types.Email.t -> Types.Email.t
+
(** Mark an email as automatically sent *)
+
val mark_as_autosent : Types.Email.t -> Types.Email.t
+
(** Mark an email as being from an unsubscribed sender *)
+
val mark_as_unsubscribed : Types.Email.t -> Types.Email.t
+
(** Mark an email as having unsubscribe capability *)
+
val mark_as_canunsubscribe : Types.Email.t -> Types.Email.t
+
(** Mark an email as imported from another system *)
+
val mark_as_imported : Types.Email.t -> Types.Email.t
+
(** Mark an email as from a trusted/verified sender *)
+
val mark_as_trusted : Types.Email.t -> Types.Email.t
+
(** Mark an email as having masked/anonymous address *)
+
val mark_as_maskedemail : Types.Email.t -> Types.Email.t
+
(** Mark an email as new/recent *)
+
val mark_as_new : Types.Email.t -> Types.Email.t
+
(** Remove new/recent flag from an email *)
+
val unmark_new : Types.Email.t -> Types.Email.t
+
(** {1 Color Flag Operations} *)
+
(** Set color flag bits on an email *)
+
val set_color_flags : Types.Email.t -> red:bool -> orange:bool -> yellow:bool -> Types.Email.t
+
(** Mark an email with a predefined color *)
+
val mark_as_color : Types.Email.t ->
+
[`Red | `Orange | `Yellow | `Green | `Blue | `Purple | `Gray] -> Types.Email.t
+
(** Remove all color flag bits from an email *)
+
val clear_color_flags : Types.Email.t -> Types.Email.t
+
(** {1 Custom Flag Operations} *)
(** Add a custom keyword to an email *)
val add_custom : Types.Email.t -> string -> Types.Email.t
(** Remove a custom keyword from an email *)
val remove_custom : Types.Email.t -> string -> Types.Email.t
+
(** {1 Patch Object Creation} *)
(** Create a patch object to add a keyword to emails *)
val add_keyword_patch : Types.Keywords.keyword -> Jmap.Methods.patch_object
···
(** Create a patch object to mark emails as unseen/unread *)
val mark_unseen_patch : unit -> Jmap.Methods.patch_object
+
(** Create a patch object to set a specific color on emails *)
+
val set_color_patch : [`Red | `Orange | `Yellow | `Green | `Blue | `Purple | `Gray] ->
+
Jmap.Methods.patch_object
(** Conversion functions for JMAP/IMAP compatibility *)
+
(** {1 Keyword/Flag Conversion} *)
(** Convert a JMAP keyword variant to IMAP flag *)
val keyword_to_imap_flag : Types.Keywords.keyword -> string
(** Convert an IMAP flag to JMAP keyword variant *)
val imap_flag_to_keyword : string -> Types.Keywords.keyword
+
(** Check if a string is valid for use as a custom keyword according to RFC 8621.
+
@deprecated Use Keyword.is_valid instead. *)
val is_valid_custom_keyword : string -> bool
(** Get the JMAP protocol string representation of a keyword *)
···
(** Parse a JMAP protocol string into a keyword variant *)
val string_to_keyword : string -> Types.Keywords.keyword
+
(** {1 Color Conversion} *)
+
(** Convert a color name to the corresponding flag bit combination *)
+
val color_to_flags : [`Red | `Orange | `Yellow | `Green | `Blue | `Purple | `Gray] ->
+
Types.Keywords.keyword list
+
(** Try to determine a color from a set of keywords *)
+
val keywords_to_color : Types.Keywords.t ->
+
[`Red | `Orange | `Yellow | `Green | `Blue | `Purple | `Gray | `None] option
(** {1 Helper Functions} *)