funcnode-mail

funcnode-mail (FnMailer)

Mail sending for Crystal (>= 1.20.2) web services: several mailboxes of one domain, persistent file spool, retries with backoff, rate limiting, bulk campaigns, IMAP bounce monitoring, suppression list, Crystal and HTTP callbacks. Fully thread-safe; works under -Dpreview_mt.

Two deployment modes share one interface (Funcnode::Mail::MailerApi + AdminApi via #admin), so switching is one initialization line:

  • EmbeddedFnMailer.new(config) inside your application process.
  • Remote — the fn-mailer-server binary on a mail host + Client.new(host, port, token: ...) in the application (TCP/MessagePack protocol, optional TLS, token auth); fn-mailer-ctl for operations.

Quick taste

require "funcnode-mail"
alias Mail = Funcnode::Mail

mailer = Mail::FnMailer.new("config/mail.yaml") # missing file -> commented template + ConfigError

send_id = mailer.send(Mail::Message.new(
  from: "no-reply",                        # mailbox key from the config
  to: Mail::Address.new("user@example.com"),
  subject: "Confirm your email",
  text_body: "Follow the link: ...",
  idempotency_key: "confirm:42"))          # repeated send returns the same id

mailer.on_event { |event| ... }            # queued/accepted/failed/bounced/...

Documentation (Russian)

Full documentation with examples lives in doc/:

Runnable programs: examples/.

Installation

dependencies:
  funcnode-mail:
    gitlab: funcnode_crystal/funcnode-mail

Windows note: shards install needs Developer Mode (symlinks).

Development

crystal spec        # also -Dpreview_mt / --no-debug variants
crystal tool format
shards build        # fn-mailer-server, fn-mailer-ctl

Contributors

Repository

funcnode-mail

Owner
Statistic
  • 0
  • 0
  • 0
  • 0
  • 2
  • about 6 hours ago
  • July 10, 2026
License

Links
Synced at

Sat, 01 Aug 2026 22:08:12 GMT

Languages