hailer 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7040caa31450c39c7584a6473a49ae17cb3fd74550f8081cf633fa67e50dd01d
4
- data.tar.gz: cdffc1376da92c0248e34796f6a0d22d4653ff92c537b7ac10cb4c28f14bd072
3
+ metadata.gz: 3cea8300dc2899118c24fff411618e008bae311dfa636347143f122444a0a5c4
4
+ data.tar.gz: 119dab0d2481d5bd9d06457dfabb2960f7cd9ec84c0373a4b2191919aee11dc3
5
5
  SHA512:
6
- metadata.gz: b51170cf7e389c5df4ad1c7cb80772aead8580ed4d3e71f2da0df90d1e3c4e2f95549cf73527cf14cd8093914d3f18e4783ad555d21c047bd37125056de520c7
7
- data.tar.gz: 46ce1ae89ecf529e3c0b7e5e95d5fb876f2c7d33d630a99891090bf52b74bf236c5ca2777b1e4ef2729e2e8cf034b144ea1182dc26990e2ac2a1391d78ca1c5c
6
+ metadata.gz: e5714ff92ba044310e69e35e1789c63925b548ccf1a7e979b266bc16f20a168847a03316f0bfbdc7b8de8545902290f295c1a063753f9a596b2684b205c3f8f8
7
+ data.tar.gz: 5d8f4dd778e553c576ca1152d1dbb6922efcc08b72c7057a0b2935b4d79aa2ce7e01b2c0ef0e154b4d8291f75bd2c1636209b57e64cc19ca0c45592045ecbdae
data/CHANGELOG.md CHANGED
@@ -7,6 +7,18 @@
7
7
  - Opt-in fault injection (`[rogue]`, `rogue-machines`): `hailer arm-experiment`/`disarm-experiment`/`list-experiments` against the provider, SQS feedback or the verifier, with a mandatory expiry of at most 24 hours. Migration `06_rogue_experiments`.
8
8
  - breaker-machines 0.22, behavior-machines 0.3, behavior-machines-circuit 0.4, chrono-machines 0.10, throttle-machines 0.5, state-machines 0.34: the whole family on one state-machines. Every other dependency at its latest compatible release.
9
9
 
10
+ ## [0.9.0](https://github.com/seuros/hailer/compare/v0.8.0...v0.9.0) (2026-11-22)
11
+
12
+
13
+ ### Features
14
+
15
+ * add SMTP provider ([4d9cb2d](https://github.com/seuros/hailer/commit/4d9cb2d3a96b58d6f757119c8da1daa67abdf3ab))
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * preserve SMTP envelopes and negotiate mail extensions ([a573336](https://github.com/seuros/hailer/commit/a5733363f3a05b5b3a1152a5e63f7ed8d677a226))
21
+
10
22
  ## [0.8.0](https://github.com/seuros/hailer/compare/v0.7.1...v0.8.0) (2026-11-18)
11
23
 
12
24
 
data/README.md CHANGED
@@ -7,7 +7,7 @@ This repository is two things:
7
7
  - **`hailer` gem** — an ActionMailer adapter, feedback client, and executable
8
8
  launcher. Platform gems bundle the Rust binary. No Ruby AWS SDK or native extension.
9
9
  - **`hailer` crate** — a standalone Rust mail ship, supervised by Mothership.
10
- Sends through SESv2 or Postmark.
10
+ Sends through SESv2, Postmark, or SMTP.
11
11
 
12
12
  ```mermaid
13
13
  flowchart LR
@@ -78,18 +78,19 @@ The source (`ruby`) gem has the same Rails client and launcher, but no binary.
78
78
  For source development or an unsupported platform:
79
79
 
80
80
  ```sh
81
- cargo install --path . --locked --features ses,postmark
81
+ cargo install --path . --locked --features ses,postmark,smtp
82
82
  export HAILER_BINARY=/absolute/path/to/hailer
83
83
  ```
84
84
 
85
85
  Each provider is a cargo feature, and a build needs at least one. Platform
86
- gems carry both. On glibc Linux the build needs libclang (`libclang-dev`):
86
+ gems carry all three. On glibc Linux the build needs libclang (`libclang-dev`):
87
87
  rama generates its libresolv bindings with bindgen.
88
88
 
89
89
  | Feature | Adds |
90
90
  | --- | --- |
91
91
  | `ses` | SES sending, SQS feedback, suppression sync, rate discovery, `ses-*` and `sync-suppressions` commands (hailer's own SigV4 client, no AWS SDK) |
92
92
  | `postmark` | MIME parsing for Postmark's JSON API, `postmark-server` command |
93
+ | `smtp` | Native async SMTP submission (`STARTTLS`, implicit TLS, `AUTH PLAIN`/`LOGIN`), `smtp-check` command |
93
94
 
94
95
  A binary without the configured provider refuses to start and names the
95
96
  feature to rebuild with.
@@ -155,6 +156,44 @@ refuses a message (406, suppressed) only when every recipient is inactive in
155
156
  its suppression list; otherwise it accepts and skips the inactive ones, which
156
157
  Hailer logs as a warning with the count, never the addresses.
157
158
 
159
+ ### SMTP
160
+
161
+ ```toml
162
+ provider = "smtp"
163
+
164
+ [smtp]
165
+ host = "mail.example.com"
166
+ port = 587 # defaults: 587 (starttls), 465 (implicit), 25 (none)
167
+ tls = "starttls" # "starttls" (default), "implicit", or "none"
168
+ auth = "auto" # "auto" (default), "plain", "login", or "none"
169
+ helo_domain = "mail.example.com"
170
+ ```
171
+
172
+ Set `SMTP_USERNAME` and `SMTP_PASSWORD` in the service's environment, never in
173
+ `hailer.toml`. When `auth = "auto"` and neither variable is set, Hailer sends
174
+ without `AUTH` (useful for local relays or Mailpit); setting only one variable
175
+ is refused, and `auth = "plain"` or `"login"` requires both. `hailer smtp-check`
176
+ connects without requiring PostgreSQL, verifies TLS and authentication, and
177
+ prints the server greeting and capabilities without leaking credentials.
178
+
179
+ Unlike Postmark, SMTP passes Rails's rendered MIME through verbatim after CRLF
180
+ normalization and RFC 5321 dot-stuffing, preserving MIME structure, inline
181
+ attachments, custom headers, and DKIM signatures (queued dispatches prepend
182
+ unsigned `X-Hailer-Message-Id` and `X-Hailer-Attempt-Id` headers). Explicit
183
+ `smtp_envelope_from` sets `MAIL FROM`; otherwise Hailer checks `Return-Path`,
184
+ `Sender`, then `From`, in that order. Messages with UTF-8 envelope addresses
185
+ or headers require `SMTPUTF8`, and 8-bit bodies require `8BITMIME`. Hailer
186
+ rejects messages before transmission if the relay lacks a required extension.
187
+ `tls = "starttls"` requires the server to advertise and
188
+ complete `STARTTLS` and refuses plaintext downgrade or buffered pre-TLS bytes.
189
+ Connections to dual-stack hosts stagger IPv6 and IPv4 attempts so a blackholed
190
+ address family does not stall sends.
191
+
192
+ The SES-only settings (`ses_configuration_set`, `[feedback]`,
193
+ `[suppression_sync]`, `rate_limit.discover_from_aws`) and `[postmark]` are
194
+ refused with `provider = "smtp"`. SMTP bounces and suppressions are not read by
195
+ Hailer, so a queued unknown outcome waits for `hailer resolve-message`.
196
+
158
197
  ### PostgreSQL
159
198
 
160
199
  PostgreSQL is the **only live backend**. Hailer owns a `hailer` schema,
@@ -469,6 +508,10 @@ an automatic retry of an ambiguous send.
469
508
  Postmark sends are single-attempt too: throttling, a refused token and 5xx
470
509
  return 503, other refusals 502, and lost or unreadable answers the
471
510
  unknown-outcome code.
511
+ SMTP sends are single-attempt too: failures before `DATA` transmission return
512
+ 503 (queued: `request_not_dispatched` or retryable `provider_unauthorized` /
513
+ `provider_throttled`), 5xx rejections return 502, and timeouts or disconnects
514
+ after transmitting `DATA` return the unknown-outcome code (`held_unknown`).
472
515
 
473
516
  Every synchronous send runs on one budget (`deadline-machines`): Mothership's
474
517
  `request_timeout` for the bay, read from `MS_BAY_DRAIN_TIMEOUT` (60 s when
@@ -478,7 +521,7 @@ spends the last 5 s, and a lookup that cannot finish in what is left counts as
478
521
  `unknown`. The provider call's timeout is cut to the remaining budget; with
479
522
  under 2 s left nothing is sent and the answer is 503 `code: "budget_spent"`
480
523
  (`Hailer::UnavailableError`, safe to retry). Queued dispatch keeps the
481
- provider's own 20 s timeout.
524
+ provider's own timeout (20 s for SES and Postmark, 30 s for SMTP).
482
525
 
483
526
  ## Fault injection
484
527
 
@@ -500,7 +543,7 @@ monotonic clock from the time PostgreSQL says is left.
500
543
 
501
544
  | Target | `raise` | `delay` | `garble` |
502
545
  | --- | --- | --- | --- |
503
- | `provider` (SES/Postmark) | unreachable: nothing sent; sync sends answer 503 and count against the breaker, queued dispatch retries | served inside the send timeout; at least as long is an unknown outcome (queued: `held_unknown`) | sent, but the id comes back as `rogue-<id>` |
546
+ | `provider` (SES/Postmark/SMTP) | unreachable: nothing sent; sync sends answer 503 and count against the breaker, queued dispatch retries | served inside the send timeout; at least as long is an unknown outcome (queued: `held_unknown`) | sent, but the id comes back as `rogue-<id>` |
504
547
  | `feedback` (SQS) | receive fails, consumer backs off | receive starts late | bodies replaced and left unacknowledged, so SQS redelivers them |
505
548
  | `verifier` (Emailable) | lookup fails open as `unknown` | served inside the lookup budget | refused: a garbled verdict would be cached past the experiment |
506
549
 
@@ -518,7 +561,7 @@ missing code.
518
561
  ```sh
519
562
  bundle install
520
563
  bundle exec rake
521
- HAILER_TEST_DATABASE_URL=postgres://test_user:password@127.0.0.1/hailer_test cargo test --locked --features ses,postmark
564
+ HAILER_TEST_DATABASE_URL=postgres://test_user:password@127.0.0.1/hailer_test cargo test --locked --features ses,postmark,smtp
522
565
  cargo fmt --all -- --check
523
566
  ```
524
567
 
data/hailer.example.toml CHANGED
@@ -3,11 +3,20 @@ threads = 2
3
3
  database_pool_size = 5
4
4
  shutdown_timeout_seconds = 30
5
5
 
6
- # "ses" (default) or "postmark". Postmark reads POSTMARK_SERVER_TOKEN from the
7
- # environment and refuses the SES-only settings below.
6
+ # "ses" (default), "postmark", or "smtp". Postmark reads POSTMARK_SERVER_TOKEN
7
+ # and SMTP reads SMTP_USERNAME / SMTP_PASSWORD from the environment; both
8
+ # refuse the SES-only settings below.
8
9
  # provider = "postmark"
9
10
  # [postmark]
10
11
  # message_stream = "outbound"
12
+ #
13
+ # provider = "smtp"
14
+ # [smtp]
15
+ # host = "mail.example.com"
16
+ # port = 587 # defaults: 587 (starttls), 465 (implicit), 25 (none)
17
+ # tls = "starttls" # "starttls" (default), "implicit", or "none"
18
+ # auth = "auto" # "auto" (default), "plain", "login", or "none"
19
+ # helo_domain = "mail.example.com"
11
20
 
12
21
  # Optional SES event-publishing configuration set. Its events must include mail
13
22
  # tags and reach the dedicated SNS/SQS feedback route to resolve unknown sends.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Hailer
4
- VERSION = '0.8.0'
4
+ VERSION = '0.9.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hailer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Abdelkader Boudih