Skip to main content

Crate mailkite

Crate mailkite 

Source

Structs§

AttachmentUpload
Describes a file to upload via Client::upload_attachment. Provide the file ONE of four ways (checked in this order): url, bytes, path, or content (base64). retention_days optionally overrides how long the hosted file lives.
Client
Talks to the MailKite API.
Error
Returned for any non-2xx response (or a local failure). status is the HTTP status code (0 for a transport/local error), message is the API’s error field when present, and body is the parsed response body when there was one.

Constants§

DEFAULT_BASE_URL
The production API base URL.
DEFAULT_TOLERANCE_MS
Reject webhook events older than this (ms) to block replays. Pass 0 to verify_webhook_with_tolerance to disable the freshness check.

Functions§

decrypt
Reverse encrypt: given an at-rest envelope (JSON string) and an RSA private key (PKCS#8 PEM), return the original UTF-8 plaintext. Local only.
enc
Percent-encode one path or query segment (RFC 3986 unreserved set kept).
encrypt
Protect a UTF-8 plaintext to an RSA public key (SPKI PEM), returning the at-rest envelope serialized as a compact JSON string. Hybrid scheme — a fresh AES-256-GCM content key encrypts the data and is wrapped with RSA-OAEP (SHA-256). Local only — no network call.
page_query
Build the list query string: "" when nothing is set, otherwise ?before=&limit=&search= (only the params that are present, in this order).
reply_block_sender
{"status":"ok","actions":[{"type":"block-sender"}]} — block the sender.
reply_drop
{"status":"drop"} — drop (discard) the message.
reply_ok
{"status":"ok"} — acknowledge a webhook event.
reply_spam
{"status":"spam"} — mark the message as spam.
verify_webhook
Package-level webhook verification with the default 5-minute replay window.
verify_webhook_with_tolerance
Verify the signature and reject events older than tolerance_ms (0 disables the freshness check). Parses t=<ms>,v1=<hex> and checks HMAC-SHA256(secret, "<t>.<payload>").