this repo has no description
at main 75 lines 2.2 kB view raw
1(*--------------------------------------------------------------------------- 2 Copyright (c) 2025 Anil Madhavapeddy. All rights reserved. 3 SPDX-License-Identifier: ISC 4 ---------------------------------------------------------------------------*) 5 6(** Email body types as defined in RFC 8621 Section 4.1.4 7 8 @canonical Jmap.Proto.Email_body *) 9 10(** {1 Body Value} *) 11 12(** Fetched body part content. *) 13module Value : sig 14 type t = { 15 value : string; 16 (** The body part content. *) 17 is_encoding_problem : bool; 18 (** True if there was a problem decoding the content transfer encoding. *) 19 is_truncated : bool; 20 (** True if the value was truncated. *) 21 } 22 23 val value : t -> string 24 val is_encoding_problem : t -> bool 25 val is_truncated : t -> bool 26 27 val jsont : t Jsont.t 28end 29 30(** {1 Body Part} *) 31 32(** An email body part structure. *) 33module Part : sig 34 type t = { 35 part_id : string option; 36 (** Identifier for this part, used to fetch content. *) 37 blob_id : Proto_id.t option; 38 (** Blob id if the part can be fetched as a blob. *) 39 size : int64 option; 40 (** Size in octets. *) 41 headers : Mail_header.t list option; 42 (** Headers specific to this part. *) 43 name : string option; 44 (** Suggested filename from Content-Disposition. *) 45 type_ : string; 46 (** MIME type (e.g., "text/plain"). *) 47 charset : string option; 48 (** Character set parameter. *) 49 disposition : string option; 50 (** Content-Disposition value. *) 51 cid : string option; 52 (** Content-ID value. *) 53 language : string list option; 54 (** Content-Language values. *) 55 location : string option; 56 (** Content-Location value. *) 57 sub_parts : t list option; 58 (** Nested parts for multipart types. *) 59 } 60 61 val part_id : t -> string option 62 val blob_id : t -> Proto_id.t option 63 val size : t -> int64 option 64 val headers : t -> Mail_header.t list option 65 val name : t -> string option 66 val type_ : t -> string 67 val charset : t -> string option 68 val disposition : t -> string option 69 val cid : t -> string option 70 val language : t -> string list option 71 val location : t -> string option 72 val sub_parts : t -> t list option 73 74 val jsont : t Jsont.t 75end