Skip to content

Comments

Fix/complete rule element support#1

Open
Seblat5ch wants to merge 2 commits intoasklar:mainfrom
Seblat5ch:fix/complete-rule-element-support
Open

Fix/complete rule element support#1
Seblat5ch wants to merge 2 commits intoasklar:mainfrom
Seblat5ch:fix/complete-rule-element-support

Conversation

@Seblat5ch
Copy link

Summary

Adds complete rule element support for parsing Outlook 2019 .rwz files with all conditions, actions, and exceptions per the RWZ Format Specification.

The original parser only handled ~15 element types and crashed on unknown IDs. This update adds support for all documented element types, enabling successful parsing of real-world .rwz files.

Changes

  • Added 15 missing data type classes: ImportanceRuleElementData, SensitivityRuleElementData, CategoriesListRuleElementData, PathRuleElementData, DisplayMessageInNewItemAlertWindowRuleElementData, FlagRuleElementData, DeferDeliveryRuleElementData, PerformCustomActionRuleElementData, AutomaticReplyRuleElementData, RunScriptRuleElementData, FlagForFollowUpRuleElementData, ApplyRetentionPolicyRuleElementData, OnThisComputerOnlyRuleElementData, SizeInSpecificRangeRuleElementData, ReceivedInSpecificDateSpanRuleElementData, FormTypeRuleElementData, ThroughAccountRuleElementData, SenderInSpecifiedAddressBookRuleElementData
  • Fixed incorrect action-to-data-type mappings (e.g. 0x139 "move a copy" was SimpleRuleElementData, should be MoveToFolderRuleElementData)
  • Added all exception element cases (0x1F4-0x21B) — these were completely missing
  • Fixed RuleHeader separator logic for last rule (no separator per spec)
  • Fixed FlaggedForActionRuleElementData to properly read Extended + Reserved + actionName (was empty class)
  • Replaced hard assertions with softAssert for graceful error handling
  • Made input file path configurable via CLI argument (process.argv[2])

Testing

Successfully parsed an Outlook 2019 .rwz file containing 137 rules with 0 errors.

…and exceptions

- Added 15 missing data type classes per RWZ spec
- Fixed incorrect action-to-data-type mappings
- Added all exception element cases (0x1F4-0x21B)
- Fixed RuleHeader separator logic for last rule
- Made input file path configurable via CLI argument
- Replaced hard assertions with softAssert for graceful error handling
- Successfully tested against Outlook 2019 file with 137 rules
@hughbe
Copy link

hughbe commented Feb 17, 2026

Hey @asklar just wondering if you encountered any problems with the specification when you made this? I'm keen to make sure it's accurate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants