Repository navigation
Conversation
`MailMail._send()` tells a successful delivery from a failed one by the exception raised by `send_email()`, not by its return value. `mail_tracking` catches every exception and, when a `mail.tracking.email` record exists, records the error on the tracking record and returns normally, so core believes the mail was delivered: the recipient is marked as reached and its notification is written `sent` for a mail that never left, core's `except AssertionError` never runs so a NO_VALID_RECIPIENT is never classified, and the mail keeps the placeholder failure reason set before the sending loop. A tracking record is created for every outgoing email, so with `mail_tracking` installed core's whole failure-handling path is disabled for the database. This is not a duplicate of OCA#215/OCA#212, which added `else: raise`, i.e. it only re-raises when there is NO tracking record -- the branch that is dead in practice. The live case is the other one. Re-raise unconditionally. The error is still recorded on the tracking record by the `smtp_error()` call just above, so nothing is lost; only core's contract is restored. Note for adopters: delivery failures that used to be silent now surface as `exception` states on `mail.mail`/`mail.notification`, so a backlog of previously hidden failures may become visible at once on upgrade. Fixes OCA#253
|
Linked to Odoo task #33063 |
alan196
force-pushed
the
19.0-jarsa-fix-mail_tracking-reraise
branch
from
November 30, 2026 17:56
e62f27b to
d92ede7
Compare
Author
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.
Brings the upstream fix OCA#266 (already merged in
OCA/19.0) intoJarsa/19.0. Our fork is behind OCA and still swallows the exception when a tracking record exists.Cherry-pick of d3f4d09
[FIX] mail_tracking: do not swallow exceptions in send_email(authorship kept).All 46
mail_trackingtests pass, and pre-commit passes. The next rebase of the fork on OCA will drop this commit as already applied.Merge with "Rebase and merge".
🤖 Generated with Claude Code