Postmaster forward mails every member again when the spam scan re-runs
- Dominant language
- Python
- Stars
- 4
- Forks
- 0
- Avg merge
- 8h 24m
- Merged PRs (30d)
- 115
Description
`forward_postmaster_message` is enqueued from the clean branch of `check_incoming_spam` (`services/email/mta/tasks.py`), a task carrying `retry=SPAM_SCAN_RETRY`. Nothing records that a copy already went out — unlike a webhook, which is tracked by `WebhookDelivery`. So a retry after the enqueue point, or any re-run of the scan for the same message, mails every member of the organisation a second time.
Deferred during review of the postmaster-forward work (branch `codingjoe-mta-forward-non-reports`); the app is not in production yet, so no queue migration was needed either.
Defer line as reported:
> `suspicion: the forward enqueue has no idempotency guard — any second run of check_incoming_spam for the same message (retry after partial failure, rescan) sends the copy to every member again. [services/email/mta/tasks.py]:L306`
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.