···
@see <https://www.rfc-editor.org/rfc/rfc8621.html#section-1.5> RFC 8621, Section 1.5 *)
val push_event_type_email_delivery : string
145
-
(** JMAP keywords corresponding to IMAP system flags.
145
+
(** Keyword string constants for JMAP email flags.
146
+
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 *)
148
+
module Keyword : sig
149
+
(** {1 IMAP System Flags} *)
151
+
(** "$draft": The Email is a draft the user is composing *)
154
+
(** "$seen": The Email has been read *)
157
+
(** "$flagged": The Email has been flagged for urgent/special attention *)
158
+
val flagged : string
160
+
(** "$answered": The Email has been replied to *)
161
+
val answered : string
163
+
(** {1 Common Extension Keywords} *)
165
+
(** "$forwarded": The Email has been forwarded *)
166
+
val forwarded : string
168
+
(** "$phishing": The Email is likely to be phishing *)
169
+
val phishing : string
171
+
(** "$junk": The Email is spam/junk *)
174
+
(** "$notjunk": The Email is explicitly marked as not spam/junk *)
175
+
val notjunk : string
177
+
(** {1 Apple Mail and Vendor Extensions}
178
+
@see <https://datatracker.ietf.org/doc/draft-ietf-mailmaint-messageflag-mailboxattribute/> *)
180
+
(** "$notify": Request to be notified when this email gets a reply *)
181
+
val notify : string
183
+
(** "$muted": Email is muted (notifications disabled) *)
186
+
(** "$followed": Email thread is followed for notifications *)
187
+
val followed : string
189
+
(** "$memo": Email has a memo/note associated with it *)
192
+
(** "$hasmemo": Email has a memo, annotation or note property *)
193
+
val hasmemo : string
195
+
(** "$autosent": Email was generated or sent automatically *)
196
+
val autosent : string
198
+
(** "$unsubscribed": User has unsubscribed from this sender *)
199
+
val unsubscribed : string
201
+
(** "$canunsubscribe": Email contains unsubscribe information *)
202
+
val canunsubscribe : string
204
+
(** "$imported": Email was imported from another system *)
205
+
val imported : string
207
+
(** "$istrusted": Email is from a trusted/verified sender *)
208
+
val istrusted : string
210
+
(** "$maskedemail": Email is to/from a masked/anonymous address *)
211
+
val maskedemail : string
213
+
(** "$new": Email was recently delivered *)
214
+
val new_mail : string
216
+
(** {1 Apple Mail Color Flag Bits} *)
218
+
(** "$MailFlagBit0": First color flag bit (red) *)
219
+
val mailflagbit0 : string
221
+
(** "$MailFlagBit1": Second color flag bit (orange) *)
222
+
val mailflagbit1 : string
224
+
(** "$MailFlagBit2": Third color flag bit (yellow) *)
225
+
val mailflagbit2 : string
227
+
(** {1 Color Flag Combinations} *)
229
+
(** Get color flag bit values for a specific color
230
+
@return A list of flags to set to create the requested color *)
231
+
val color_flags : [`Red | `Orange | `Yellow | `Green | `Blue | `Purple | `Gray] -> string list
233
+
(** Check if a string is a valid keyword according to the RFC
234
+
@see <https://www.rfc-editor.org/rfc/rfc8621.html#section-4.1.1> RFC 8621, Section 4.1.1 *)
235
+
val is_valid : string -> bool
238
+
(** For backward compatibility - DEPRECATED, use Keyword.draft instead *)
val keyword_draft : string
241
+
(** For backward compatibility - DEPRECATED, use Keyword.seen instead *)
val keyword_seen : string
244
+
(** For backward compatibility - DEPRECATED, use Keyword.flagged instead *)
val keyword_flagged : string
247
+
(** For backward compatibility - DEPRECATED, use Keyword.answered instead *)
val keyword_answered : string
152
-
(** Common JMAP keywords from RFC 5788.
153
-
@see <https://www.rfc-editor.org/rfc/rfc8621.html#section-4.1.1> RFC 8621, Section 4.1.1 *)
250
+
(** For backward compatibility - DEPRECATED, use Keyword.forwarded instead *)
val keyword_forwarded : string
253
+
(** For backward compatibility - DEPRECATED, use Keyword.phishing instead *)
val keyword_phishing : string
256
+
(** For backward compatibility - DEPRECATED, use Keyword.junk instead *)
val keyword_junk : string
259
+
(** For backward compatibility - DEPRECATED, use Keyword.notjunk instead *)
val keyword_notjunk : string
159
-
(** Functions to manipulate email flags/keywords *)
262
+
(** Email keyword operations.
263
+
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
271
+
(** {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
309
+
(** {1 Extension Flag Operations} *)
311
+
(** Mark an email for notification when replied to *)
312
+
val mark_as_notify : Types.Email.t -> Types.Email.t
314
+
(** Remove notification flag from an email *)
315
+
val unmark_notify : Types.Email.t -> Types.Email.t
317
+
(** Mark an email as muted (no notifications) *)
318
+
val mark_as_muted : Types.Email.t -> Types.Email.t
320
+
(** Unmute an email (allow notifications) *)
321
+
val unmark_muted : Types.Email.t -> Types.Email.t
323
+
(** Mark an email thread as followed for notifications *)
324
+
val mark_as_followed : Types.Email.t -> Types.Email.t
326
+
(** Remove followed status from an email thread *)
327
+
val unmark_followed : Types.Email.t -> Types.Email.t
329
+
(** Mark an email with a memo *)
330
+
val mark_as_memo : Types.Email.t -> Types.Email.t
332
+
(** Mark an email with the hasmemo flag *)
333
+
val mark_as_hasmemo : Types.Email.t -> Types.Email.t
335
+
(** Mark an email as automatically sent *)
336
+
val mark_as_autosent : Types.Email.t -> Types.Email.t
338
+
(** Mark an email as being from an unsubscribed sender *)
339
+
val mark_as_unsubscribed : Types.Email.t -> Types.Email.t
341
+
(** Mark an email as having unsubscribe capability *)
342
+
val mark_as_canunsubscribe : Types.Email.t -> Types.Email.t
344
+
(** Mark an email as imported from another system *)
345
+
val mark_as_imported : Types.Email.t -> Types.Email.t
347
+
(** Mark an email as from a trusted/verified sender *)
348
+
val mark_as_trusted : Types.Email.t -> Types.Email.t
350
+
(** Mark an email as having masked/anonymous address *)
351
+
val mark_as_maskedemail : Types.Email.t -> Types.Email.t
353
+
(** Mark an email as new/recent *)
354
+
val mark_as_new : Types.Email.t -> Types.Email.t
356
+
(** Remove new/recent flag from an email *)
357
+
val unmark_new : Types.Email.t -> Types.Email.t
359
+
(** {1 Color Flag Operations} *)
361
+
(** Set color flag bits on an email *)
362
+
val set_color_flags : Types.Email.t -> red:bool -> orange:bool -> yellow:bool -> Types.Email.t
364
+
(** Mark an email with a predefined color *)
365
+
val mark_as_color : Types.Email.t ->
366
+
[`Red | `Orange | `Yellow | `Green | `Blue | `Purple | `Gray] -> Types.Email.t
368
+
(** Remove all color flag bits from an email *)
369
+
val clear_color_flags : Types.Email.t -> Types.Email.t
371
+
(** {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
379
+
(** {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
393
+
(** Create a patch object to set a specific color on emails *)
394
+
val set_color_patch : [`Red | `Orange | `Yellow | `Green | `Blue | `Purple | `Gray] ->
395
+
Jmap.Methods.patch_object
(** Conversion functions for JMAP/IMAP compatibility *)
400
+
(** {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
230
-
(** Check if a string is valid for use as a custom keyword according to RFC 8621 *)
408
+
(** Check if a string is valid for use as a custom keyword according to RFC 8621.
409
+
@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
418
+
(** {1 Color Conversion} *)
420
+
(** Convert a color name to the corresponding flag bit combination *)
421
+
val color_to_flags : [`Red | `Orange | `Yellow | `Green | `Blue | `Purple | `Gray] ->
422
+
Types.Keywords.keyword list
424
+
(** Try to determine a color from a set of keywords *)
425
+
val keywords_to_color : Types.Keywords.t ->
426
+
[`Red | `Orange | `Yellow | `Green | `Blue | `Purple | `Gray | `None] option
(** {1 Helper Functions} *)