
---@class mbox_header*
---@field name string header name.
---@field value string header value.

---@class mbox_message*
---@field headers table<string, string|string[]> headers。
---@field body string text.

---@class mbox*
---@type mbox*
local M = {}

--- Split a single mbox message.
---@param message string Message text.
---@return string headers headers text.
---@return string body text.
function M.split_message(message) end

--- Split headers text.
---@param headers string headers text.
---@return string[] lines header OK.
function M.split_headers(headers) end

--- Parse a single header.
---@param header string header text.
---@return string name header name.
---@return string value header value.
function M.parse_header(header) end

--- Parse headers.
---@param headers string headers text.
---@return table<string, string|string[]> result headers surface.
function M.parse_headers(headers) end

--- Parse the From line.
---@param from string From OK.
---@return table result Parse the results.
function M.parse_from(from) end

--- Split mbox text.
---@param mbox string mbox text.
---@return string[] messages Message list.
function M.split_mbox(mbox) end

--- Parse mbox text.
---@param mbox string mbox text.
---@return mbox_message[] messages Message list.
function M.parse(mbox) end

--- Parse a single message.
---@param message string Message text.
---@return mbox_message parsed Parse the results.
function M.parse_message(message) end

return M
