KumoMTA Docs
Internal Rust API
Initializing search
    KumoCorp/kumomta
    • Tutorial
    • User Guide
    • Reference Manual
    • FAQ
    • Changelog
    KumoCorp/kumomta
      • Quickstart Tutorial
      • Server Environment
      • System Preparation
      • Installing KumoMTA
      • Configuring KumoMTA
      • Starting KumoMTA
      • Testing KumoMTA
      • Checking Logs
      • Next Steps
    • User Guide
        • Preface and Legal Notices
        • About This Manual
        • How to Report Bugs
        • How to Get Help
        • Credits
        • History
        • Architecture
        • Lua Fundamentals
        • Installation Overview
        • Server Environment
        • Server Hardware
        • Operating System
        • System Preparation
        • Security Considerations
        • Installing on Linux
        • Upgrading
        • Installing on Docker
        • Building from Source
        • Configuration Concepts
        • Lua Policy Helpers
        • Example Server Policy
        • Configuring Spooling
        • Configuring Logging
        • Configuring SMTP Listeners
        • Configuring Inbound and Relay Domains
        • Configuring Bounce Classification
        • Configuring Feedback Loop Processing
        • Configuring HTTP Listeners
        • Configuring Sending IPs
        • Configuring Queue Management
        • Configuring Queue Rollup
        • Configuring Traffic Shaping
        • Configuring DKIM Signing
        • Starting KumoMTA
        • Getting Server Status
        • Troubleshooting KumoMTA
        • Injecting Messages using SMTP
        • Injecting Messages using HTTP
        • Routing Messages Via Proxy Servers
        • Viewing Logs
        • Canceling Queued Messages
        • Additional Utilities
        • Using the kcli Command-Line Client
        • KumoProxy SOCKS5 Server
      • Policy
        • Checking Inbound SMTP Authentication
        • Delivering Messages Using SMTP Auth
        • Custom Destination Routing
        • Routing Messages via HTTP Request
        • Routing Messages via AMQP
        • Routing Messages via Kafka
        • Storing Secrets in Hashicorp Vault
        • Publishing Log Events Via Webhooks
        • Rewriting Remote Server Responses
      • Clustering
        • Deployment Architecture
        • Aggregating Event Data
        • Implementing Shared Throttles
        • Clustered Traffic Shaping Automation
        • Scaling Clusters Up and Down
        • Deploying KumoMTA on Kubernetes
      • Performance
        • Architecture
        • Linux Tuning
        • DNS
        • Performance Testing
        • Understanding KumoMTA Message Flows
        • Log Hooks
      • Integrations
        • EmailElement
        • Ongage
        • Mautic
        • Postmastery
        • Tatami Monitor
        • Prometheus
        • Grafana
        • Hornetsecurity Spam Filter
        • Rspamd Spam filter
    • Reference Manual
      • Predefined Metadata
      • Queues
      • Configuration Lifecycle
      • SMTP Server Events
      • Memory Management
      • Template Syntax
        • cycler
        • dateformat
        • datetimeformat
        • filesizeformat
        • joiner
        • normalize_smtp_response
        • now
        • pluralize
        • timeformat
      • Log Record
      • kcli
        • kcli bounce-cancel
        • kcli bounce-list
        • kcli bounce
        • kcli inspect-message
        • kcli inspect-sched-q
        • kcli provider-summary
        • kcli queue-summary
        • kcli rebind
        • kcli set-log-filter
        • kcli suspend-cancel
        • kcli suspend-list
        • kcli suspend-ready-q-cancel
        • kcli suspend-ready-q-list
        • kcli suspend-ready-q
        • kcli suspend
        • kcli top
        • kcli trace-smtp-client
        • kcli trace-smtp-server
        • kcli xfer-cancel
        • kcli xfer
      • module: kumo
        • apply_supplemental_trace_header
        • available_parallelism
        • bump_config_epoch
        • configure_accounting_db_path
        • configure_bounce_classifier
        • configure_local_logs
          • back_pressure
          • compression_level
          • filter_event
          • headers
          • log_dir
          • max_file_size
          • max_segment_duration
          • meta
          • min_free_inodes
          • min_free_space
          • per_record
        • configure_log_hook
        • configure_redis_throttles
        • define_spool
          • flush
          • kind
          • min_free_inodes
          • min_free_space
          • name
          • path
          • rocks_params
        • disconnect
        • eval_config_monitor_globs
        • generate_rfc3464_message
        • glob
        • inject_message
        • invoke_get_egress_path_config
        • invoke_get_egress_pool
        • invoke_get_egress_source
        • invoke_get_queue_config
        • json_encode
        • json_encode_pretty
        • json_load
        • json_parse
        • log_debug
        • log_error
        • log_info
        • log_warn
        • make_egress_path
          • additional_connection_limits
          • additional_message_rate_throttles
          • additional_source_selection_rates
          • allow_smtp_auth_plain_without_tls
          • banner_timeout
          • connect_timeout
          • connection_limit
          • consecutive_connection_failures_before_delay
          • data_dot_timeout
          • data_timeout
          • dispatcher_wakeup_strategy
          • ehlo_domain
          • ehlo_timeout
          • enable_dane
          • enable_mta_sts
          • enable_pipelining
          • enable_rset
          • enable_tls
          • idle_timeout
          • ignore_8bit_checks
          • low_memory_reduction_policy
          • mail_from_timeout
          • maintainer_wakeup_strategy
          • max_connection_rate
          • max_deliveries_per_connection
          • max_message_rate
          • max_ready
          • max_recipients_per_batch
          • no_memory_reduction_policy
          • openssl_cipher_list
          • openssl_cipher_suites
          • openssl_options
          • opportunistic_tls_reconnect_on_failed_handshake
          • prohibited_hosts
          • rcpt_to_timeout
          • reconnect_strategy
          • refresh_interval
          • refresh_strategy
          • remember_broken_tls
          • rset_timeout
          • rustls_cipher_suites
          • skip_hosts
          • smtp_auth_plain_password
          • smtp_auth_plain_username
          • smtp_port
          • source_selection_rate
          • starttls_timeout
          • suspended
          • system_shutdown_timeout
          • tls_certificate
          • tls_prefer_openssl
          • tls_private_key
          • try_next_host_on_transport_error
          • use_lmtp
        • make_egress_pool
          • entries
          • name
          • ttl
        • make_egress_source
          • ehlo_domain
          • ha_proxy_server
          • ha_proxy_source_address
          • name
          • remote_port
          • socks5_proxy_server
          • socks5_proxy_source_address
          • source_address
          • ttl
        • make_listener_domain
          • log_arf
          • log_oob
          • relay_from
          • relay_to
        • make_message
        • make_queue_config
          • egress_pool
          • max_age
          • max_message_rate
          • max_retry_interval
          • protocol
          • reap_interval
          • refresh_interval
          • refresh_strategy
          • retry_interval
          • shrink_policy
          • strategy
          • timerwheel_tick_interval
        • make_throttle
        • memoize
        • on
        • read_dir
        • reject
        • set_config_monitor_globs
        • set_diagnostic_log_filter
        • set_httpinject_recipient_rate_limit
        • set_httpinject_threads
        • set_logging_threads
        • set_lruttl_cache_capacity
        • set_max_lua_context_age
        • set_max_lua_context_use_count
        • set_max_spare_lua_contexts
        • set_memory_hard_limit
        • set_memory_low_thresh
        • set_memory_soft_limit
        • set_qmaint_threads
        • set_ready_qmaint_threads
        • set_readyq_threads
        • set_smtpsrv_threads
        • set_spoolin_threads
        • sleep
        • spawn_task
        • start_esmtp_listener
          • allow_xclient
          • banner
          • batch_handling
          • client_timeout
          • data_buffer_size
          • data_processing_timeout
          • deferred_queue
          • deferred_spool
          • hostname
          • invalid_line_endings
          • line_length_hard_limit
          • listen
          • max_connections
          • max_message_size
          • max_messages_per_connection
          • max_recipients_per_message
          • meta
          • peer
          • relay_hosts
          • require_proxy_protocol
          • tls_certificate
          • tls_private_key
          • tls_required_client_ca
          • trace_headers
          • via
        • start_http_listener
          • hostname
          • listen
          • request_body_limit
          • tls_certificate
          • tls_private_key
          • trusted_hosts
          • use_tls
        • toml_encode
        • toml_encode_pretty
        • toml_load
        • toml_parse
        • uncached_glob
        • version
      • module: kumo.amqp
        • basic_publish
        • build_client
      • module: kumo.api.inject
        • inject_v1
      • module: kumo.crypto
        • aes_decrypt_block
        • aes_encrypt_block
        • aws_sign_v4
      • module: kumo.digest
        • crc32
        • hmac_sha1
        • hmac_sha224
        • hmac_sha256
        • hmac_sha384
        • hmac_sha512
        • sha1
        • sha224
        • sha256
        • sha384
        • sha3_256
        • sha3_384
        • sha3_512
        • sha512
        • sha512_256
      • module: kumo.dkim
        • ed25519_signer
        • rsa_sha256_signer
        • set_signing_threads
      • module: kumo.dns
        • configure_resolver
        • configure_unbound_resolver
        • define_resolver
        • lookup_addr
        • lookup_mx
        • lookup_ptr
        • lookup_txt
        • ptr_host
        • rbl_lookup
        • reverse_ip
        • set_mx_concurrency_limit
        • set_mx_negative_cache_ttl
        • set_mx_timeout
      • module: kumo.encode
        • base32_decode
        • base32_encode
        • base32_nopad_decode
        • base32_nopad_encode
        • base32hex_decode
        • base32hex_encode
        • base32hex_nopad_decode
        • base32hex_nopad_encode
        • base64_decode
        • base64_encode
        • base64_nopad_decode
        • base64_nopad_encode
        • base64url_decode
        • base64url_encode
        • base64url_nopad_decode
        • base64url_nopad_encode
        • hex_decode
        • hex_encode
      • module: kumo.cidr
        • make_map
      • module: kumo.domain_map
        • new
      • module: kumo.file_type
        • from_bytes
        • from_extension
        • from_media_type
      • module: kumo.fs
        • glob
        • open
        • read_dir
        • uncached_glob
      • module: kumo.http
        • Request
        • Response
        • build_client
        • build_url
        • connect_websocket
      • module: kumo.kafka
        • build_producer
      • module: kumo.mimepart
        • builder
        • new_binary
        • new_html
        • new_multipart
        • new_text
        • new_text_plain
        • parse
      • module: kumo.mpsc
        • define
      • module: kumo.regex_set_map
        • new
      • module: kumo.secrets
        • load
      • module: kumo.serde
        • json_encode
        • json_encode_pretty
        • json_load
        • json_parse
        • toml_encode
        • toml_encode_pretty
        • toml_load
        • toml_parse
        • yaml_encode
        • yaml_load
        • yaml_parse
      • module: kumo.shaping
        • load
      • module: kumo.spf
        • check_host
        • check_msg
      • module: kumo.uuid
        • new_v1
        • new_v4
        • new_v6
        • new_v7
        • parse
      • module: redis
        • open
      • module: regex
        • compile
        • escape
      • module: sqlite
        • open
      • module: string
        • eval_template
        • normalize_smtp_response
        • psl_domain
        • psl_suffix
        • replace
        • replacen
        • rsplit
        • rsplitn
        • split
        • split_ascii_whitespace
        • split_whitespace
        • splitn
        • trim
        • trim_end
        • trim_start
        • wrap
      • module: kumo.time
        • Time
        • TimeDelta
        • from_unix_timestamp
        • now
        • parse_duration
        • parse_rfc2822
        • parse_rfc3339
        • sleep
        • start_timer
        • with_ymd_hms
      • module: policy-extras.mail_auth
        • check
        • iprev
        • iprev_msg
      • module: tsa
        • configure_tsa_db_path
        • start_http_listener
      • object: address
        • domain
        • email
        • user
      • object: addressheader
        • domain
        • email
        • list
        • name
        • user
      • object: authenticationresult
      • object: connectionmeta
      • object: headermap
        • append
        • bcc
        • cc
        • comments
        • content_disposition
        • content_id
        • content_transfer_encoding
        • content_type
        • from
        • get_first_named
        • iter
        • message_id
        • mime_version
        • prepend
        • references
        • remove_all_named
        • reply_to
        • resent_bcc
        • resent_cc
        • resent_from
        • resent_sender
        • sender
        • set_bcc
        • set_cc
        • set_comments
        • set_content_disposition
        • set_content_id
        • set_content_transfer_encoding
        • set_content_type
        • set_from
        • set_message_id
        • set_mime_version
        • set_references
        • set_reply_to
        • set_resent_bcc
        • set_resent_cc
        • set_resent_from
        • set_resent_sender
        • set_resent_to
        • set_sender
        • set_subject
        • set_to
        • subject
        • to
      • object: header
        • address_list
        • authentication_results
        • mailbox_list
        • message_id
        • message_id_list
        • mime_params
        • name
        • raw_value
        • unstructured
        • value
      • object: keysource
      • object: message
        • add_authentication_results
        • append_header
        • append_text_html
        • append_text_plain
        • arc_seal
        • arc_verify
        • check_fix_conformance
        • dkim_sign
        • dkim_verify
        • from_header
        • get_address_header
        • get_all_headers
        • get_all_named_header_values
        • get_data
        • get_first_named_header_value
        • get_meta
        • id
        • import_scheduling_header
        • import_x_headers
        • num_attempts
        • parse_mime
        • parse_rfc3464
        • prepend_header
        • queue_name
        • recipient
        • recipient_list
        • remove_all_named_headers
        • remove_x_headers
        • save
        • sender
        • set_data
        • set_due
        • set_force_sync
        • set_meta
        • set_recipient
        • set_scheduling
        • set_sender
        • shrink
        • shrink_data
        • to_header
      • object: mimepart
        • append_part
        • body
        • get_simple_structure
        • headers
        • id
        • rebuild
        • replace_body
      • events
        • get_egress_path_config
        • get_egress_pool
        • get_egress_source
        • get_listener_domain
        • get_queue_config
        • http_message_generated
        • http_server_validate_auth_basic
        • init
        • pre_init
        • rebind_message
        • requeue_message
        • should_enqueue_log_record
        • shutdown_logging
        • smtp_client_rewrite_delivery_status
        • smtp_server_auth_plain
        • smtp_server_connection_accepted
        • smtp_server_data
        • smtp_server_ehlo
        • smtp_server_get_dynamic_parameters
        • smtp_server_mail_from
        • smtp_server_message_deferred_inject
        • smtp_server_message_received
        • smtp_server_rcpt_to
        • smtp_server_rewrite_response
        • smtp_server_split_transaction
        • spool_message_enumerated
        • throttle_insert_ready_queue
        • tsa_init
        • tsa_load_shaping_data
        • xfer_message_received
      • HTTP API Explorer
      • HTTP API
        • `DELETE /api/admin/bounce/v1`
        • `GET /api/admin/bounce/v1`
        • `POST /api/admin/bounce/v1`
        • `POST /api/admin/set_diagnostic_log_filter/v1`
        • `POST /api/inject/v1`
        • `GET /metrics.json`
        • `GET /metrics`
      • Internal Rust API
        • bounce_classify
        • cidr_map
        • config
        • data_loader
        • dns_resolver
        • domain_map
        • duration_serde
        • kumo_address
        • kumo_api_types
        • kumo_chrono_helper
        • kumo_dkim
        • kumo_dmarc
        • kumo_log_types
        • kumo_prometheus
        • kumo_server_common
        • kumo_server_lifecycle
        • kumo_server_memory
        • kumo_server_runtime
        • kumo_spf
        • kumo_template
        • kumo_wrap
        • lruttl
        • maildir
        • mailparsing
        • message
        • mod_amqp
        • mod_aws_sigv4
        • mod_crypto
        • mod_digest
        • mod_dns_resolver
        • mod_encode
        • mod_file_type
        • mod_filesystem
        • mod_http
        • mod_kafka
        • mod_memoize
        • mod_mimepart
        • mod_mpsc
        • mod_redis
        • mod_regex
        • mod_serde
        • mod_smtp_response_normalize
        • mod_sqlite
        • mod_string
        • mod_time
        • mod_uuid
        • mta_sts
        • regex_set_map
        • rfc5321
        • spool
        • throttle
        • timeq
        • uuid_helper
        • version_info
      • Tags
    • FAQ
      • Can I Migrate From Momentum (Ecelerity) to KumoMTA?
      • Can I Migrate From PowerMTA to KumoMTA?
      • Does KumoMTA Follow Secure Development Lifecycle (SDLC) Practices?
      • How do I flush a queue?
      • How Can I Get Help With KumoMTA?
      • How Can I Tell What Traffic Shaping Rules Apply To A Domain?
      • How do I skip IPv6 MX hosts for outbound SMTP?
      • How do I create an always-suspended queue?
      • How do I include multiple configuration files from a directory?
      • Is There a SaaS Version of KumoMTA?
      • How Can I Apply Multiple DKIM Signatures to a Message?
      • Why is KumoMTA Accepting Connections From Systems Not Listed in relay_hosts?
      • How do I resolve a `Permission Denied` error?
      • How Do I Configure POP3/IMAP?
      • How Do Shared Throttles Work for Small Connection Limits in a Cluster?
      • How Do I Avoid Having a Single Point of Failure?
      • How Can I Test TLS Injection?
      • What is KumoMTA?
      • Who is KumoMTA For?
    • Changelog
      • Unreleased Changes in The Mainline
      • Release 2025.10.06-5ec871ab
      • Release 2025.05.06-b29689af
      • Release 2025.03.19-1d3f1f67
      • Release 2025.01.29-833f82a8
      • Release 2025.01.23-7273d2bc
      • Release 2024.11.08-d383b033
      • Release 2024.09.02-c5476b89
      • Release 2024.06.10-84e84b89
      • Release 2023.12.28-63cde9c7
      • Release 2023.11.28-b5252a41
      • Release 2023.08.22-4d895015 - Automation
      • Release 2023.06.22-51b72a83
      • Release 2023.05.10-e88ad036 - Beta 2
      • Release 2023.03.31-36aa20de - Beta1

    Internal Rust API

    This section contains automatically generated documentation from the internal Rust code. It is included in here to aid those hacking on the internals.

    There are no stability guarantees with this API: it may change without any regard for backward compatibility.

    The following crates are part of the KumoMTA workspace:

    • bounce_classify
    • cidr_map
    • config
    • data_loader
    • dns_resolver
    • domain_map
    • duration_serde
    • kumo_address
    • kumo_api_types
    • kumo_chrono_helper
    • kumo_dkim
    • kumo_dmarc
    • kumo_log_types
    • kumo_prometheus
    • kumo_server_common
    • kumo_server_lifecycle
    • kumo_server_memory
    • kumo_server_runtime
    • kumo_spf
    • kumo_template
    • kumo_wrap
    • lruttl
    • maildir
    • mailparsing
    • message
    • mod_amqp
    • mod_aws_sigv4
    • mod_crypto
    • mod_digest
    • mod_dns_resolver
    • mod_encode
    • mod_file_type
    • mod_filesystem
    • mod_http
    • mod_kafka
    • mod_memoize
    • mod_mimepart
    • mod_mpsc
    • mod_redis
    • mod_regex
    • mod_serde
    • mod_smtp_response_normalize
    • mod_sqlite
    • mod_string
    • mod_time
    • mod_uuid
    • mta_sts
    • regex_set_map
    • rfc5321
    • spool
    • throttle
    • timeq
    • uuid_helper
    • version_info
    Previous
    `GET /metrics`
    Next
    bounce_classify
    Copyright © 2023 Kumo Corp
    Made with Material for MkDocs