Repository navigation
mail-ingest: pin the mailserver certificate when it has expired - #31
Merged
Merged
Conversation
The mailserver serves the Let's Encrypt certificate Caddy used to renew. Caddy left the stack and the certificate expired on 13 February, so mail-ingest's verified STARTTLS fails and it will not log in. While the certificate is expired, mailserver's secrets.sh records its SHA-256 fingerprint and mail-ingest trusts exactly that certificate, ignoring CA, name and dates. Any other certificate is refused before the password is sent. Once a valid certificate is served the pin is cleared and normal verification applies again, so renewal needs no change here.
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.
mail-ingest verifies the mailserver certificate before it logs in (#29). If that certificate has expired, the login fails and inbound stops until it's renewed.
mailserver/secrets.shrecords its SHA-256 (DER) fingerprint asMAIL_INGEST_TLS_FINGERPRINT. It clears the value once a valid certificate is served.Renewing the certificate is still the real fix; the pin only keeps inbound working in the meantime.
Tests: two new unit tests cover a matching pin and a mismatched one. One existing test,
test_timestamp_more_than_five_minutes_in_the_future_is_rejected, is timing-sensitive on slow runs (int(time.time()) + 301can land inside the window).