Repository navigation
mail-ingest: relay on an authenticated, local-only listener - #29
Merged
tcoretech merged 1 commit intoNov 19, 2026
Merged
Conversation
…ops rejecting inbound Since PERMIT_DOCKER=none, mail-ingest is no longer in mynetworks, so Postfix runs the SPF policy on every message it relays. That checks the original sender's SPF against mail-ingest's Docker address, so every sender that publishes -all has been rejected with 550 5.7.23 (hotmail, Amazon SES, Postmark, dribbble). ~all senders were delivered, which is why it went unnoticed. Mailgun has already checked SPF and DKIM by the time we see the message. mailserver gets a second smtpd on 10587, added by a tracked user-patches.sh: STARTTLS and a login as mail-ingest@ only, local recipients only, no SPF policy, and the login hidden from the milters so Rspamd, OpenDKIM and OpenDMARC still treat the message as inbound. The same login is refused on 587/465, so a leaked credential cannot send out. The password is generated by secrets.sh and the account created by startup.sh, like the other mail accounts. mail-ingest logs in on that port, verifying the certificate against the mailserver's public name. It now also checks RCPT replies: a refused recipient used to surface only as "no valid recipients" at DATA, and with several recipients a refused one was silently dropped.
This was referenced Nov 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With
PERMIT_DOCKER=none, mail-ingest isn't inmynetworks, so Postfix runs the SPF policy on every message it relays. It checks the original sender's SPF against mail-ingest's container address, so every sender that publishes-allis rejected with550 5.7.23. The upstream provider has already checked SPF and DKIM by that point.mailserver: a tracked
config/user-patches.sh, copied in byprepare.sh, adds an smtpd on10587that isn't published on the host. It:mail-ingest@<domain>; no other login is accepted (check_sasl_access)reject_unauth_destinationin both relay and recipient restrictions, so it can't relay even when authenticatedsecrets.shgenerates the password andstartup.shprovisions the account, the same way as the other mail accounts.mail-ingest: logs in after STARTTLS, verifying the certificate against
MAILSERVER_WEBMAIL_HOSTNAME. It also checks RCPT replies, so a refused recipient is reported instead of being dropped when others are accepted.Alternatives considered:
PERMIT_DOCKER=network/connected-networksreopens the relay to every container.skip_addressesties trust to Docker addressing.Tests: unit tests cover STARTTLS before login, no login without STARTTLS, the unauthenticated fallback, and refused and partly refused recipients.
user-patches.shwas run twice against the DMS image: it's idempotent and passespostfix check.