hailer 0.6.0 → 0.7.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: c8cd926b627c51b8e8c96b95ad79bb68b8fbba9c4ca26ab466f03f41283cc35b
4
- data.tar.gz: 7a4344f35eccd875fe2110aa10a35b0767d42c6acf025260c6813c732e644cb8
3
+ metadata.gz: 432076a3cffc3d7d7b2850545389146cd3febc6ab4901558d112f81c2c7184e0
4
+ data.tar.gz: 00cd4f6b7b10523ad17f6c46bdb5c9bd4f20a994b6ec38fa11d1751aebe53f09
5
5
  SHA512:
6
- metadata.gz: 5b9aeebb39e331fb930cfcce8a7063d28a33fedf2314881bab62e469b4674286e807bffdd14b532d1db47199fcf1eb55f2b3cd0612cb1fcbbea2028430faf055
7
- data.tar.gz: 7622c206fdfccefbee24a7c05952500c8e83a4fca3d0a84bbe05da2f3ebdf9eec4db1a37d6398f04639ed240c023ca2442f88295d83bd11f6ea41dd537a7860d
6
+ metadata.gz: be3c8ca567cdfa92d7835f82352814f90da890b211d61169d8a1441ffde657e1f02e6f32cc7b0899624f7e78369351eb85edb53ea8747b567072cf21e0f2be83
7
+ data.tar.gz: 9b19395e0f7f80b667cadf9f4056887042e4afd54627ce1a42005f81d658114ced19f6c0bfa093d6871a0cbe58d4b65118d059137e269421cfb3ccfa7e1529b2
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.7.0
4
+
5
+ - Postmark provider (`provider = "postmark"`, `[postmark] message_stream`, `POSTMARK_SERVER_TOKEN`): Rails MIME parsed into Postmark's JSON, sync and queued sends, correlation as Metadata, `hailer postmark-server` token check. SES-only settings are refused with it.
6
+ - **Breaking for source builds:** providers are cargo features, `ses` and `postmark`; a build needs at least one, and platform gems carry both. A binary without the configured provider refuses to start and names the feature.
7
+ - The AWS SDK is gone: SESv2, SQS and STS go through hailer's own SigV4 client (verified against AWS's signing test suite) with env, shared-file, web identity, container and IMDSv2 credentials. The platform binary drops from 17 MiB to 9 MiB.
8
+ - HTTP clients (Postmark, Emailable, RDAP) moved from reqwest to rama, with rustls on ring; every request sends `user-agent: hailer/<version>`.
9
+ - Dependency requirements loosened to their compatibility boundary and upgraded (behavior-machines-circuit 0.3, base64 0.23, sha2 0.11).
10
+
3
11
  ## Working tree — durable delivery (unreleased)
4
12
 
5
13
  - Opt-in `:hailer_queued` Rails adapter with stable job keys and frozen intake retries.
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
- SESv2 is the first provider.
10
+ Sends through SESv2 or Postmark.
11
11
 
12
12
  ```mermaid
13
13
  flowchart LR
@@ -78,10 +78,22 @@ 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
81
+ cargo install --path . --locked --features ses,postmark
82
82
  export HAILER_BINARY=/absolute/path/to/hailer
83
83
  ```
84
84
 
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`):
87
+ rama generates its libresolv bindings with bindgen.
88
+
89
+ | Feature | Adds |
90
+ | --- | --- |
91
+ | `ses` | SES sending, SQS feedback, suppression sync, rate discovery, `ses-*` and `sync-suppressions` commands (hailer's own SigV4 client, no AWS SDK) |
92
+ | `postmark` | MIME parsing for Postmark's JSON API, `postmark-server` command |
93
+
94
+ A binary without the configured provider refuses to start and names the
95
+ feature to rebuild with.
96
+
85
97
  Run it as a Mothership HTTP bay. Merge this example into your fleet manifest;
86
98
  the bind must stay private and must not be routed on a public listener:
87
99
 
@@ -102,9 +114,43 @@ docking Unix socket; it does **not** run another HTTP server. For containers,
102
114
  use a private network listener with network policy instead of a loopback address
103
115
  if Rails runs in a different network namespace.
104
116
 
105
- Give the **service**, not the Rails adapter, AWS region and credentials through
106
- the standard AWS credential chain. Its identity needs `ses:SendEmail`, and the
107
- SES account/identities must be configured for sending.
117
+ Give the **service**, not the Rails adapter, AWS region and credentials. Hailer
118
+ looks where the AWS SDKs do, in this order: `AWS_ACCESS_KEY_ID` /
119
+ `AWS_SECRET_ACCESS_KEY` (+ `AWS_SESSION_TOKEN`); the shared `~/.aws/credentials`
120
+ and `~/.aws/config` files (`AWS_PROFILE`, static keys); an EKS web identity
121
+ (`AWS_WEB_IDENTITY_TOKEN_FILE` + `AWS_ROLE_ARN`); an ECS or EKS Pod Identity
122
+ container role; the EC2 instance role over IMDSv2. A profile that needs SSO,
123
+ `credential_process` or role chaining is refused with the key it uses. The
124
+ region comes from `AWS_REGION`, `AWS_DEFAULT_REGION`, the profile, or IMDS.
125
+ Its identity needs `ses:SendEmail`, and the SES account/identities must be
126
+ configured for sending.
127
+
128
+ ### Postmark
129
+
130
+ ```toml
131
+ provider = "postmark"
132
+
133
+ [postmark]
134
+ message_stream = "outbound" # the default
135
+ ```
136
+
137
+ Set `POSTMARK_SERVER_TOKEN` in the service's environment, never in
138
+ `hailer.toml`. `hailer postmark-server` checks the token and names its server.
139
+
140
+ Postmark's API takes JSON, not raw MIME, so Hailer parses the Rails message
141
+ and Postmark rebuilds it. Recipients, subject, text/HTML bodies, attachments
142
+ (inline images by `cid:`), Reply-To, `Message-ID` and other custom headers
143
+ carry over; the MIME structure itself does not. Recipients come from the
144
+ envelope, as with SES. An explicit `smtp_envelope_from` only stands in for a
145
+ missing From header: Postmark owns the bounce address.
146
+
147
+ The SES-only settings (`ses_configuration_set`, `[feedback]`,
148
+ `[suppression_sync]`, `rate_limit.discover_from_aws`) are refused with
149
+ `provider = "postmark"`. Postmark bounces and suppressions are not read yet,
150
+ so a queued unknown outcome waits for `hailer resolve-message`. Postmark
151
+ refuses a message (406, suppressed) only when every recipient is inactive in
152
+ its suppression list; otherwise it accepts and skips the inactive ones, which
153
+ Hailer logs as a warning with the count, never the addresses.
108
154
 
109
155
  ### PostgreSQL
110
156
 
@@ -410,6 +456,9 @@ The SES SDK makes **one send attempt**. AWS throttling/transient failures return
410
456
  503, permanent service rejections 502, and disconnects/timeouts/missing message
411
457
  IDs carry the explicit unknown-outcome code. None of these responses authorizes
412
458
  an automatic retry of an ambiguous send.
459
+ Postmark sends are single-attempt too: throttling, a refused token and 5xx
460
+ return 503, other refusals 502, and lost or unreadable answers the
461
+ unknown-outcome code.
413
462
 
414
463
  ## Status
415
464
 
@@ -425,7 +474,7 @@ missing code.
425
474
  ```sh
426
475
  bundle install
427
476
  bundle exec rake
428
- HAILER_TEST_DATABASE_URL=postgres://test_user:password@127.0.0.1/hailer_test cargo test --locked
477
+ HAILER_TEST_DATABASE_URL=postgres://test_user:password@127.0.0.1/hailer_test cargo test --locked --features ses,postmark
429
478
  cargo fmt --all -- --check
430
479
  ```
431
480
 
data/hailer.example.toml CHANGED
@@ -3,6 +3,12 @@ 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.
8
+ # provider = "postmark"
9
+ # [postmark]
10
+ # message_stream = "outbound"
11
+
6
12
  # Optional SES event-publishing configuration set. Its events must include mail
7
13
  # tags and reach the dedicated SNS/SQS feedback route to resolve unknown sends.
8
14
  # Otherwise configure an appropriate default set on the sending identity.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Hailer
4
- VERSION = '0.6.0'
4
+ VERSION = '0.7.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.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Abdelkader Boudih
@@ -201,7 +201,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
201
201
  - !ruby/object:Gem::Version
202
202
  version: '0'
203
203
  requirements: []
204
- rubygems_version: 4.0.10
204
+ rubygems_version: 4.0.20
205
205
  specification_version: 4
206
206
  summary: ActionMailer delivery through the Hailer mail ship
207
207
  test_files: []