[Migrated PR #52] [FIX] Route SPV mail from trusted Moebiusol forwards #5

Closed
opened 2026-10-09 04:25:51 +00:00 by moeardent · 2 comments
Owner

Summary

  • Change class: bugfix
  • Promotion target: 18.0 after review and CI
  • Trace ref: 01a02870-5b59-7910-9a4a-7751b7cf3035

Scope

Included

  • Replace the hard-coded anaf.ro SPV sender gate with active parser-registry matching.
  • Accept configured direct ANAF and trusted moebiusol.eu forwarding identities.
  • Validate retained sender/recipient header consistency and fail closed on mismatch.
  • Preserve the email-trigger-only contract: create SPV expected-document evidence, never accounting postings.
  • Add regression coverage for internal forwarding, direct parser behavior, header mismatch, and supported SPV classifications.

Out of scope

  • Automatic accounting posting from email metadata.
  • New ANAF API or mailbox protocol.
  • Changes to existing e-Factura acquisition or Treasury parser algorithms.

Implementation Notes

  • Root cause: live record 14 was fetched successfully but bypassed the SPV parser because routing required literal anaf.ro; the configured sender pattern was unused.
  • Additional defect fixed: the optional parser model recordset was treated as unavailable when empty, even when the model was installed.
  • Data/schema impact: no schema change.
  • Operational impact: a correctly forwarded Documente noi SPV message should route to moe.spv.notification and create expected SPV documents; unrelated or inconsistent messages remain quarantined.

Verification Evidence

  • ruff check on changed Python files: passed.
  • Python compilation: passed.
  • python3 ci/validate_addons.py: passed.
  • PYTHONDONTWRITEBYTECODE=1 pytest -q ci: 123 passed, 110 subtests passed.
  • Live reproduction record: intake 14, fetched 1/1, quarantined before SPV dispatch.
  • Required next evidence: TeamCity Odoo TransactionCase run and controlled live mailbox acceptance after deployment.

Residual Risks

  • Internal sender acceptance is configuration-based; the mailbox remains the trust boundary and header inconsistency fails closed.
  • The email remains only a trigger; downstream retrieved-document parsing and accountant approval are separate controls.

Promotion and Recovery

  • Intended next step: review request, TeamCity validation, then DEV/GitOps promotion if gates pass.
  • Rollback: revert the single source commit and redeploy the prior release revision.

Source PR branches: fix/spv-mail-routing-and-parser-dispatch -> 18.0

## Summary - Change class: bugfix - Promotion target: `18.0` after review and CI - Trace ref: `01a02870-5b59-7910-9a4a-7751b7cf3035` ## Scope ### Included - Replace the hard-coded `anaf.ro` SPV sender gate with active parser-registry matching. - Accept configured direct ANAF and trusted `moebiusol.eu` forwarding identities. - Validate retained sender/recipient header consistency and fail closed on mismatch. - Preserve the email-trigger-only contract: create SPV expected-document evidence, never accounting postings. - Add regression coverage for internal forwarding, direct parser behavior, header mismatch, and supported SPV classifications. ### Out of scope - Automatic accounting posting from email metadata. - New ANAF API or mailbox protocol. - Changes to existing e-Factura acquisition or Treasury parser algorithms. ## Implementation Notes - Root cause: live record 14 was fetched successfully but bypassed the SPV parser because routing required literal `anaf.ro`; the configured sender pattern was unused. - Additional defect fixed: the optional parser model recordset was treated as unavailable when empty, even when the model was installed. - Data/schema impact: no schema change. - Operational impact: a correctly forwarded `Documente noi SPV` message should route to `moe.spv.notification` and create expected SPV documents; unrelated or inconsistent messages remain quarantined. ## Verification Evidence - `ruff check` on changed Python files: passed. - Python compilation: passed. - `python3 ci/validate_addons.py`: passed. - `PYTHONDONTWRITEBYTECODE=1 pytest -q ci`: 123 passed, 110 subtests passed. - Live reproduction record: intake 14, fetched 1/1, quarantined before SPV dispatch. - Required next evidence: TeamCity Odoo TransactionCase run and controlled live mailbox acceptance after deployment. ## Residual Risks - Internal sender acceptance is configuration-based; the mailbox remains the trust boundary and header inconsistency fails closed. - The email remains only a trigger; downstream retrieved-document parsing and accountant approval are separate controls. ## Promotion and Recovery - Intended next step: review request, TeamCity validation, then DEV/GitOps promotion if gates pass. - Rollback: revert the single source commit and redeploy the prior release revision. Source PR branches: fix/spv-mail-routing-and-parser-dispatch -> 18.0 <!-- migrated-from: pull-request-fallback Moebiusol/odoo-custom-addons #52 -->
Author
Owner

Migrated Codeberg review

  • Reviewer: cristianlorand
  • State: APPROVED
  • Submitted: 2026-08-22T21:39:24+02:00
  • Commit: 786f8e9e26b32ec5d06446e1ca873e971278dd6a

(no review body)

### Migrated Codeberg review - Reviewer: `cristianlorand` - State: `APPROVED` - Submitted: `2026-08-22T21:39:24+02:00` - Commit: `786f8e9e26b32ec5d06446e1ca873e971278dd6a` (no review body) <!-- migrated-from: review Moebiusol/odoo-custom-addons #1751123 -->
Author
Owner

Migrated Codeberg pull-request comment

  • Author: moe-thebot-lorand2
  • Created: 2026-08-22T16:58:03+02:00

Verification update

  • TeamCity build 14204 completed successfully on revision 786f8e9e26b32ec5d06446e1ca873e971278dd6a.
  • Odoo application suite: 0 failed, 0 error(s) of 1253 tests.
  • Historical upgrade-compatibility databases completed successfully; CI published 28 artifacts.
  • Covered fix: trusted configurable moebiusol.eu SPV forwards, raw-header consistency checks, automatic parser dispatch, fail-closed quarantine, and classification/downstream regression tests.

Ready for Cristian's human review. Merge and GitOps promotion remain intentionally gated on that review.

### Migrated Codeberg pull-request comment - Author: `moe-thebot-lorand2` - Created: `2026-08-22T16:58:03+02:00` ## Verification update - TeamCity build [14204](https://teamcity.internal.moebiusol.eu/buildConfiguration/OdooCustomAddons_Pipeline/14204) completed successfully on revision `786f8e9e26b32ec5d06446e1ca873e971278dd6a`. - Odoo application suite: `0 failed, 0 error(s) of 1253 tests`. - Historical upgrade-compatibility databases completed successfully; CI published 28 artifacts. - Covered fix: trusted configurable `moebiusol.eu` SPV forwards, raw-header consistency checks, automatic parser dispatch, fail-closed quarantine, and classification/downstream regression tests. Ready for Cristian's human review. Merge and GitOps promotion remain intentionally gated on that review. <!-- migrated-from: comment Moebiusol/odoo-custom-addons #21543728 -->
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: moebiusol/odoo-custom-addons#5
No description provided.