Repository navigation
Fix: fall back to INTERNALDATE when Date header is missing or invalid - #28
Merged
dominicgisler merged 4 commits intoMar 30, 2026
Conversation
Emails without a Date header get a zero time from go-message's Header.Date(), which silently passes the error check (returns nil error) but then always fails the maxage range check. These messages are skipped every scan cycle and never sent to the spam provider. This is actively exploited by spam in the wild — phishing emails spoofing well-known brands commonly omit Date (and Message-ID) headers, making them invisible to the scanner. The fix requests INTERNALDATE in the IMAP fetch options and falls back to it when the parsed Date is zero. INTERNALDATE is the server-received timestamp and is always present per RFC 3501. Fixes dominicgisler#26
Builds for amd64 and arm64, publishes to ghcr.io.
The previous fix handled missing Date headers (zero time) but not invalid ones. Spam commonly uses malformed dates like "24:45:17 0500" which cause a parse error — these were still being skipped. Now both cases (missing and invalid Date) fall back to INTERNALDATE instead of skipping the message.
Owner
|
Thanks for the PR. Please remove the additional workflow, then I'll gladly merge it back. |
The build-fork.yml workflow was only needed for building the patched Docker image on the fork. Not appropriate for the upstream repo. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
Dateheader are silently skipped becauseHeader.Date()returns a zero time, which always falls outside themaxagerange checkDateheader are also skipped becauseHeader.Date()returns an error and the code doescontinueThis PR falls back to the IMAP
INTERNALDATEwhen theDateheader is missing or unparseable, ensuring these emails are still scanned.Fixes #26