mailkit_12314

    A MoonBit-native email and MIME parsing toolkit for .eml messages.

    email
    mime
    rfc5322
    eml
    moonbit
    Download zip
    Author
    Version
    0.1.0
    License
    MIT
    Last updated
    2 months ago
    Downloads
    32

    No dependencies

    #MoonMailKit 12314

    MoonBit-native email and MIME parsing toolkit for .eml, MIME multipart, attachments, mailbox archives, and mail analysis workflows.

    ///|
    let result = @mailkit_12314.parse_message(@mailkit_12314.simple_plain_eml())

    ///|
    let text = @mailkit_12314.plain_text(result.message)

    Run:

    moon check moon test moon run cmd/main

    Address

    pub struct Address {
    display : String
    mailbox : String
    } derive(Eq,
    Debug
    )

    AddressBookEntry

    pub struct AddressBookEntry {
    mailbox : String
    display : String
    domain : String
    sent : Int
    received : Int
    } derive(Eq,
    Debug
    )

    ArchiveBucket

    pub struct ArchiveBucket {
    key : ArchiveKey
    messages : Array[MailMessage]
    } derive(Eq,
    Debug
    )

    ArchiveKey

    pub struct ArchiveKey {
    year : Int
    month : Int
    category : String
    sender_domain : String
    } derive(Eq,
    Debug
    )

    AttachmentInfo

    pub struct AttachmentInfo {
    filename : String
    content_type : String
    encoding : TransferEncoding
    size : Int
    } derive(Eq,
    Debug
    )

    AuthResult

    pub struct AuthResult {
    auth_method : String
    result : String
    properties : Array[(String, String)]
    } derive(Eq,
    Debug
    )

    AuthenticationResults

    pub struct AuthenticationResults {
    authserv_id : String
    results : Array[AuthResult]
    } derive(Eq,
    Debug
    )

    BodyKind

    pub enum BodyKind {
    PlainText
    HtmlText
    Multipart(String)
    Attachment
    UnknownBody
    } derive(Eq,
    Debug
    )

    Capability

    pub struct Capability {
    name : String
    status : String
    description : String
    } derive(Eq,
    Debug
    )

    Contact

    pub struct Contact {
    display : String
    mailbox : String
    domain : String
    } derive(Eq,
    Debug
    )

    ContentType

    pub struct ContentType {
    media_type : String
    subtype : String
    charset : String
    boundary : String
    name : String
    params : Array[(String, String)]
    } derive(Eq,
    Debug
    )

    DeliveryStatus

    pub struct DeliveryStatus {
    final_recipient : String
    action : String
    status : String
    diagnostic_code : String
    remote_mta : String
    } derive(Eq,
    Debug
    )

    DraftAttachment

    pub struct DraftAttachment {
    filename : String
    content_type : String
    body : String
    encoding : TransferEncoding
    } derive(Eq,
    Debug
    )

    pub struct Header {
    name : String
    value : String
    } derive(Eq,
    Debug
    )

    HeaderCheck

    pub struct HeaderCheck {
    code : String
    detail : String
    } derive(Eq,
    Debug
    )

    Limitation

    pub struct Limitation {
    area : String
    detail : String
    planned : Bool
    } derive(Eq,
    Debug
    )

    LintFinding

    pub struct LintFinding {
    severity : Severity
    code : String
    message : String
    } derive(Eq,
    Debug
    )

    ListMetadata

    pub struct ListMetadata {
    list_id : String
    unsubscribe : Array[String]
    archive : String
    post : String
    help : String
    } derive(Eq,
    Debug
    )

    MailCategory

    pub(all) enum MailCategory {
    Personal
    Newsletter
    Notification
    Security
    Billing
    BuildSystem
    CalendarInvite
    Bounce
    UnknownCategory
    } derive(Eq,
    Debug
    )

    MailDate

    pub struct MailDate {
    weekday : String
    day : Int
    month : String
    year : Int
    time : String
    zone : String
    } derive(Eq,
    Debug
    )

    MailMessage

    pub struct MailMessage {
    headers : Array[Header]
    from : Array[Address]
    to : Array[Address]
    cc : Array[Address]
    subject : String
    date : String
    message_id : String
    root : MailPart
    } derive(Eq,
    Debug
    )

    MailPart

    pub struct MailPart {
    headers : Array[Header]
    content_type : ContentType
    encoding : TransferEncoding
    disposition : String
    filename : String
    raw_body : String
    decoded_body : String
    children : Array[MailPart]
    } derive(Eq,
    Debug
    )

    MailPolicy

    pub struct MailPolicy {
    max_parts : Int
    max_attachments : Int
    max_attachment_size : Int
    allow_html : Bool
    } derive(Eq,
    Debug
    )

    MailQuery

    pub struct MailQuery {
    from_contains : String
    to_contains : String
    subject_contains : String
    body_contains : String
    has_attachment : Bool
    } derive(Eq,
    Debug
    )

    MailStats

    pub struct MailStats {
    messages : Int
    parts : Int
    attachments : Int
    with_html : Int
    with_plain : Int
    with_authentication_results : Int
    } derive(Eq,
    Debug
    )

    MailboxIndex

    pub struct MailboxIndex {
    messages : Array[MailMessage]
    domains : Array[String]
    stats : MailStats
    } derive(Eq,
    Debug
    )

    MboxEntry

    pub struct MboxEntry {
    envelope : String
    raw_message : String
    } derive(Eq,
    Debug
    )

    MessageDraft

    pub struct MessageDraft {
    from : Address
    to : Array[Address]
    cc : Array[Address]
    subject : String
    date : String
    message_id : String
    text_body : String
    html_body : String
    attachments : Array[DraftAttachment]
    } derive(Eq,
    Debug
    )

    ParseIssue

    pub struct ParseIssue {
    code : String
    message : String
    } derive(Eq,
    Debug
    )

    ParseResult

    pub struct ParseResult {
    message : MailMessage
    issues : Array[ParseIssue]
    } derive(Eq,
    Debug
    )

    PolicyViolation

    pub struct PolicyViolation {
    code : String
    message : String
    } derive(Eq,
    Debug
    )

    PrivacyFinding

    pub struct PrivacyFinding {
    code : String
    detail : String
    } derive(Eq,
    Debug
    )

    ReceivedHop

    pub struct ReceivedHop {
    from_host : String
    by_host : String
    protocol : String
    id : String
    date : String
    raw : String
    } derive(Eq,
    Debug
    )

    ReleaseCheck

    pub struct ReleaseCheck {
    name : String
    passed : Bool
    note : String
    } derive(Eq,
    Debug
    )

    SecuritySignal

    pub struct SecuritySignal {
    code : String
    weight : Int
    detail : String
    } derive(Eq,
    Debug
    )

    Severity

    pub(all) enum Severity {
    Info
    Warning
    Error
    } derive(Eq,
    Debug
    )

    ThreadInfo

    pub struct ThreadInfo {
    message_id : String
    in_reply_to : String
    references : Array[String]
    root_id : String
    } derive(Eq,
    Debug
    )

    TransferEncoding

    pub enum TransferEncoding {
    SevenBit
    EightBit
    Binary
    Base64
    QuotedPrintable
    UnknownEncoding(String)
    } derive(Eq,
    Debug
    )

    address

    fn address(display : String, mailbox : String) -> Address

    address_book_lookup

    fn address_book_lookup(entries : Array[AddressBookEntry], mailbox : String) -> AddressBookEntry?

    address_book_summary

    fn address_book_summary(entries : Array[AddressBookEntry]) -> String

    all_domains

    fn all_domains(messages : Array[MailMessage]) -> Array[String]

    all_header_values

    fn all_header_values(headers : Array[Header], name : String) -> Array[String]

    archive_bucket_count

    fn archive_bucket_count(messages : Array[MailMessage]) -> Int

    archive_by_category

    fn archive_by_category(messages : Array[MailMessage], category : MailCategory) -> Array[MailMessage]

    archive_by_sender_domain

    fn archive_by_sender_domain(messages : Array[MailMessage], domain : String) -> Array[MailMessage]

    archive_by_year_month

    fn archive_by_year_month(messages : Array[MailMessage], year : Int, month : Int) -> Array[MailMessage]

    archive_health_report

    fn archive_health_report(messages : Array[MailMessage]) -> String

    archive_key

    fn archive_key(message : MailMessage) -> ArchiveKey

    archive_key_string

    fn archive_key_string(key : ArchiveKey) -> String

    archive_manifest

    fn archive_manifest(messages : Array[MailMessage]) -> String

    archive_subjects

    fn archive_subjects(bucket : ArchiveBucket) -> Array[String]

    attachment_count

    fn attachment_count(message : MailMessage) -> Int

    attachment_infos

    fn attachment_infos(message : MailMessage) -> Array[AttachmentInfo]

    attachment_names

    fn attachment_names(message : MailMessage) -> Array[String]

    auth_method_result

    fn auth_method_result(auth : AuthenticationResults, auth_method : String) -> String

    auth_summary

    fn auth_summary(message : MailMessage) -> String

    authenticated_route_eml

    fn authenticated_route_eml() -> String

    authentication_results_from_message

    fn authentication_results_from_message(message : MailMessage) -> Array[AuthenticationResults]

    base64_eml

    fn base64_eml() -> String

    body_kind

    fn body_kind(part : MailPart) -> BodyKind

    build_address_book

    fn build_address_book(messages : Array[MailMessage]) -> Array[AddressBookEntry]

    build_failure_eml

    fn build_failure_eml() -> String

    build_index

    fn build_index(messages : Array[MailMessage]) -> MailboxIndex

    calendar_notice_eml

    fn calendar_notice_eml() -> String

    capabilities

    fn capabilities() -> Array[Capability]

    capability

    fn capability(name : String, status : String, description : String) -> Capability

    capability_count

    fn capability_count() -> Int

    capability_markdown

    fn capability_markdown() -> String

    capability_names

    fn capability_names() -> Array[String]

    category_counts

    fn category_counts(messages : Array[MailMessage]) -> Array[(String, Int)]

    category_name

    fn category_name(category : MailCategory) -> String

    check_headers

    fn check_headers(headers : Array[Header]) -> Array[HeaderCheck]

    check_message_headers

    fn check_message_headers(message : MailMessage) -> Array[HeaderCheck]

    check_policy

    fn check_policy(message : MailMessage, policy : MailPolicy) -> Array[PolicyViolation]

    classify_message

    fn classify_message(message : MailMessage) -> MailCategory

    collapse_spaces

    fn collapse_spaces(input : String) -> String

    compute_stats

    fn compute_stats(messages : Array[MailMessage]) -> MailStats

    contact_from_address

    fn contact_from_address(addr : Address) -> Contact

    content_type

    fn content_type(media_type : String, subtype : String, charset : String, boundary : String, name : String, params : Array[(String, String)]) -> ContentType

    content_type_from_headers

    fn content_type_from_headers(headers : Array[Header]) -> ContentType

    corpus_json

    fn corpus_json(messages : Array[MailMessage]) -> String

    corpus_markdown_report

    fn corpus_markdown_report(messages : Array[MailMessage]) -> String

    corpus_messages

    fn corpus_messages() -> Array[String]

    date_month_number

    fn date_month_number(date : MailDate) -> Int

    date_year

    fn date_year(message : MailMessage) -> Int

    decode_base64_text

    fn decode_base64_text(input : String) -> String

    decode_body

    fn decode_body(input : String, encoding : TransferEncoding) -> String

    decode_header_value

    fn decode_header_value(value : String) -> String

    decode_quoted_printable

    fn decode_quoted_printable(input : String) -> String

    decode_rfc2231_value

    fn decode_rfc2231_value(value : String) -> String

    default_content_type

    fn default_content_type() -> ContentType

    default_policy

    fn default_policy() -> MailPolicy

    delivery_failure_eml

    fn delivery_failure_eml() -> String

    delivery_statuses

    fn delivery_statuses(message : MailMessage) -> Array[DeliveryStatus]

    disposition_from_headers

    fn disposition_from_headers(headers : Array[Header]) -> String

    domain_histogram

    fn domain_histogram(entries : Array[AddressBookEntry]) -> Array[(String, Int)]

    draft

    fn draft(from : Address, to : Array[Address], subject : String) -> MessageDraft

    draft_attachment

    fn draft_attachment(filename : String, content_type : String, body : String) -> DraftAttachment

    draft_attachment_encoded

    fn draft_attachment_encoded(filename : String, content_type : String, body : String, encoding : TransferEncoding) -> DraftAttachment

    dsn_summary

    fn dsn_summary(message : MailMessage) -> String

    empty_message

    fn empty_message() -> MailMessage

    empty_part

    fn empty_part() -> MailPart

    encoding_from_headers

    fn encoding_from_headers(headers : Array[Header]) -> TransferEncoding

    ends_with

    fn ends_with(input : String, suffix : String) -> Bool

    error_count

    fn error_count(findings : Array[LintFinding]) -> Int

    escape_json

    fn escape_json(input : String) -> String

    extract_urls

    fn extract_urls(input : String) -> Array[String]

    failed_recipient_count

    fn failed_recipient_count(message : MailMessage) -> Int

    filename_from_headers

    fn filename_from_headers(headers : Array[Header], ct : ContentType) -> String

    filename_star_from_headers

    fn filename_star_from_headers(headers : Array[Header]) -> String

    filter_messages

    fn filter_messages(messages : Array[MailMessage], input : MailQuery) -> Array[MailMessage]

    find_archive_bucket

    fn find_archive_bucket(buckets : Array[ArchiveBucket], key_text : String) -> ArchiveBucket?

    finding

    fn finding(severity : Severity, code : String, message : String) -> LintFinding

    first_part_by_content_type

    fn first_part_by_content_type(message : MailMessage, media_type : String, subtype : String) -> MailPart?

    first_received_by

    fn first_received_by(message : MailMessage) -> String

    flatten_parts

    fn flatten_parts(message : MailMessage) -> Array[MailPart]

    format_address

    fn format_address(addr : Address) -> String

    frequent_senders

    fn frequent_senders(entries : Array[AddressBookEntry], min_sent : Int) -> Array[AddressBookEntry]

    group_archive

    fn group_archive(messages : Array[MailMessage]) -> Array[ArchiveBucket]

    group_thread_roots

    fn group_thread_roots(messages : Array[MailMessage]) -> Array[(String, Int)]

    has_attachment_named

    fn has_attachment_named(message : MailMessage, filename : String) -> Bool

    has_auth_fail

    fn has_auth_fail(message : MailMessage, auth_method : String) -> Bool

    has_auth_pass

    fn has_auth_pass(message : MailMessage, auth_method : String) -> Bool

    has_capability

    fn has_capability(name : String) -> Bool

    has_header_check

    fn has_header_check(checks : Array[HeaderCheck], code : String) -> Bool

    has_issues

    fn has_issues(result : ParseResult) -> Bool

    has_lint_code

    fn has_lint_code(findings : Array[LintFinding], code : String) -> Bool

    has_list_unsubscribe

    fn has_list_unsubscribe(message : MailMessage) -> Bool

    has_policy_violation

    fn has_policy_violation(violations : Array[PolicyViolation], code : String) -> Bool

    has_privacy_code

    fn has_privacy_code(findings : Array[PrivacyFinding], code : String) -> Bool

    has_security_signal

    fn has_security_signal(signals : Array[SecuritySignal], code : String) -> Bool

    fn header(name : String, value : String) -> Header

    header_value

    fn header_value(headers : Array[Header], name : String) -> String

    hex_value

    fn hex_value(ch : Char) -> Int

    html_text

    fn html_text(message : MailMessage) -> String

    implemented_capability_count

    fn implemented_capability_count() -> Int

    index_domain_count

    fn index_domain_count(index : MailboxIndex) -> Int

    index_of

    fn index_of(input : String, needle : Char) -> Int

    index_report

    fn index_report(index : MailboxIndex) -> String

    fn index_search(index : MailboxIndex, input : MailQuery) -> Array[MailMessage]

    index_subjects

    fn index_subjects(index : MailboxIndex) -> Array[String]

    invoice_notice_eml

    fn invoice_notice_eml() -> String

    is_attachment

    fn is_attachment(part : MailPart) -> Bool

    is_bounce

    fn is_bounce(message : MailMessage) -> Bool

    is_header_continuation

    fn is_header_continuation(line : String) -> Bool

    is_high_risk

    fn is_high_risk(message : MailMessage) -> Bool

    is_html

    fn is_html(part : MailPart) -> Bool

    is_multipart

    fn is_multipart(part : MailPart) -> Bool

    is_plain

    fn is_plain(part : MailPart) -> Bool

    is_space

    fn is_space(ch : Char) -> Bool

    is_suspicious_filename

    fn is_suspicious_filename(filename : String) -> Bool

    is_text

    fn is_text(part : MailPart) -> Bool

    known_limitations

    fn known_limitations() -> Array[Limitation]

    last_received_from

    fn last_received_from(message : MailMessage) -> String

    limitation

    fn limitation(area : String, detail : String, planned : Bool) -> Limitation

    limitation_markdown

    fn limitation_markdown() -> String

    lint_message

    fn lint_message(message : MailMessage) -> Array[LintFinding]

    list_metadata

    fn list_metadata(message : MailMessage) -> ListMetadata

    lower_ascii

    fn lower_ascii(input : String) -> String

    mail_part

    fn mail_part(headers : Array[Header], content_type : ContentType, encoding : TransferEncoding, disposition : String, filename : String, raw_body : String, decoded_body : String, children : Array[MailPart]) -> MailPart

    mailbox_domain

    fn mailbox_domain(mailbox : String) -> String

    markdown_report

    fn markdown_report(message : MailMessage) -> String

    matches_query

    fn matches_query(message : MailMessage, input : MailQuery) -> Bool

    max_depth

    fn max_depth(message : MailMessage) -> Int

    mbox_message_count

    fn mbox_message_count(input : String) -> Int

    message_contacts

    fn message_contacts(message : MailMessage) -> Array[Contact]

    message_date

    fn message_date(message : MailMessage) -> MailDate

    message_json

    fn message_json(message : MailMessage) -> String

    message_preview

    fn message_preview(message : MailMessage, limit : Int) -> String

    message_urls

    fn message_urls(message : MailMessage) -> Array[String]

    messages_by_category

    fn messages_by_category(messages : Array[MailMessage], category : MailCategory) -> Array[MailMessage]

    messages_from_domain

    fn messages_from_domain(messages : Array[MailMessage], domain : String) -> Array[MailMessage]

    messages_with_attachments

    fn messages_with_attachments(messages : Array[MailMessage]) -> Array[MailMessage]

    messages_with_lint_errors

    fn messages_with_lint_errors(messages : Array[MailMessage]) -> Array[MailMessage]

    missing_boundary_eml

    fn missing_boundary_eml() -> String

    multipart_alternative_eml

    fn multipart_alternative_eml() -> String

    multipart_mixed_with_attachment_eml

    fn multipart_mixed_with_attachment_eml() -> String

    mvp_status

    fn mvp_status() -> String

    newsletter_eml

    fn newsletter_eml() -> String

    normalize_display_name

    fn normalize_display_name(value : String) -> String

    normalize_line_endings

    fn normalize_line_endings(input : String) -> String

    normalize_subject

    fn normalize_subject(value : String) -> String

    normalize_to_crlf

    fn normalize_to_crlf(input : String) -> String

    package_name

    fn package_name() -> String

    parse_address

    fn parse_address(value : String) -> Address

    parse_address_list

    fn parse_address_list(value : String) -> Array[Address]

    parse_authentication_results

    fn parse_authentication_results(value : String) -> AuthenticationResults

    parse_content_type

    fn parse_content_type(value : String) -> ContentType

    parse_delivery_status_body

    fn parse_delivery_status_body(body : String) -> Array[DeliveryStatus]

    parse_encoding

    fn parse_encoding(value : String) -> TransferEncoding

    parse_header_block

    fn parse_header_block(input : String) -> Array[Header]

    parse_issue

    fn parse_issue(code : String, message : String) -> ParseIssue

    parse_mail_date

    fn parse_mail_date(value : String) -> MailDate

    parse_mbox

    fn parse_mbox(input : String) -> Array[MboxEntry]

    parse_mbox_messages

    fn parse_mbox_messages(input : String) -> Array[MailMessage]

    parse_message

    fn parse_message(raw : String) -> ParseResult

    parse_message_id_list

    fn parse_message_id_list(value : String) -> Array[String]

    parse_prepared_message

    fn parse_prepared_message(input : String) -> ParseResult

    parse_received

    fn parse_received(value : String) -> ReceivedHop

    parsed_corpus

    fn parsed_corpus() -> Array[MailMessage]

    part_count

    fn part_count(message : MailMessage) -> Int

    part_json

    fn part_json(part : MailPart) -> String

    parts_by_media_type

    fn parts_by_media_type(message : MailMessage, media_type : String) -> Array[MailPart]

    password_reset_eml

    fn password_reset_eml() -> String

    percent_decode

    fn percent_decode(input : String) -> String

    phishing_reset_eml

    fn phishing_reset_eml() -> String

    plain_text

    fn plain_text(message : MailMessage) -> String

    planned_limitation_count

    fn planned_limitation_count() -> Int

    preferred_unsubscribe_url

    fn preferred_unsubscribe_url(message : MailMessage) -> String

    prepare_raw_message

    fn prepare_raw_message(input : String) -> String

    privacy_findings

    fn privacy_findings(message : MailMessage) -> Array[PrivacyFinding]

    privacy_score

    fn privacy_score(message : MailMessage) -> Int

    project_banner

    fn project_banner() -> String

    project_name

    fn project_name() -> String

    project_tagline

    fn project_tagline() -> String

    project_version

    fn project_version() -> String

    query

    fn query() -> MailQuery

    query_body

    fn query_body(input : MailQuery, value : String) -> MailQuery

    query_from

    fn query_from(input : MailQuery, value : String) -> MailQuery

    query_has_attachment

    fn query_has_attachment(input : MailQuery) -> MailQuery

    query_subject

    fn query_subject(input : MailQuery, value : String) -> MailQuery

    query_to

    fn query_to(input : MailQuery, value : String) -> MailQuery

    quoted_printable_eml

    fn quoted_printable_eml() -> String

    received_hops

    fn received_hops(message : MailMessage) -> Array[ReceivedHop]

    received_path_summary

    fn received_path_summary(message : MailMessage) -> String

    recipient_domains

    fn recipient_domains(message : MailMessage) -> Array[String]

    release_check

    fn release_check(name : String, passed : Bool, note : String) -> ReleaseCheck

    release_check_markdown

    fn release_check_markdown() -> String

    release_checks

    fn release_checks() -> Array[ReleaseCheck]

    release_ready

    fn release_ready() -> Bool

    remove_bom

    fn remove_bom(input : String) -> String

    remove_quotes

    fn remove_quotes(input : String) -> String

    render_mbox

    fn render_mbox(messages : Array[String]) -> String

    render_message

    fn render_message(input : MessageDraft) -> String

    reply_to_domain

    fn reply_to_domain(message : MailMessage) -> String

    roadmap_summary

    fn roadmap_summary() -> String

    same_thread

    fn same_thread(a : MailMessage, b : MailMessage) -> Bool

    security_score

    fn security_score(message : MailMessage) -> Int

    security_signals

    fn security_signals(message : MailMessage) -> Array[SecuritySignal]

    security_summary

    fn security_summary(message : MailMessage) -> String

    sender_domain

    fn sender_domain(message : MailMessage) -> String

    signal

    fn signal(code : String, weight : Int, detail : String) -> SecuritySignal

    simple_plain_eml

    fn simple_plain_eml() -> String

    slice

    fn slice(input : String, start : Int, end : Int) -> String

    split_char

    fn split_char(input : String, sep : Char) -> Array[String]

    split_lines

    fn split_lines(input : String) -> Array[String]

    split_once

    fn split_once(input : String, sep : Char) -> (String, String)?

    starts_with

    fn starts_with(input : String, prefix : String) -> Bool

    stats_summary

    fn stats_summary(stats : MailStats) -> String

    strict_policy

    fn strict_policy() -> MailPolicy

    strip_cr

    fn strip_cr(input : String) -> String

    strip_html

    fn strip_html(input : String) -> String

    summary

    fn summary(message : MailMessage) -> String

    support_ticket_eml

    fn support_ticket_eml() -> String

    suspicious_attachment_eml

    fn suspicious_attachment_eml() -> String

    text_parts

    fn text_parts(message : MailMessage) -> Array[MailPart]

    text_preview

    fn text_preview(input : String, limit : Int) -> String

    thread_info

    fn thread_info(message : MailMessage) -> ThreadInfo

    thread_reply_eml

    fn thread_reply_eml() -> String

    total_attachment_size

    fn total_attachment_size(message : MailMessage) -> Int

    tracked_newsletter_eml

    fn tracked_newsletter_eml() -> String

    trim_ascii

    fn trim_ascii(input : String) -> String

    warning_count

    fn warning_count(findings : Array[LintFinding]) -> Int

    with_attachment

    fn with_attachment(input : MessageDraft, attachment : DraftAttachment) -> MessageDraft

    with_cc

    fn with_cc(input : MessageDraft, cc : Array[Address]) -> MessageDraft

    with_date

    fn with_date(input : MessageDraft, date : String) -> MessageDraft

    with_html

    fn with_html(input : MessageDraft, html : String) -> MessageDraft

    with_message_id

    fn with_message_id(input : MessageDraft, message_id : String) -> MessageDraft

    with_text

    fn with_text(input : MessageDraft, text : String) -> MessageDraft