Skip to content

feat: Add sender-based routing support with backward compatibility (Fixes #145)#157

Open
EINDEX wants to merge 12 commits intoYoRyan:mainfrom
EINDEX:main
Open

feat: Add sender-based routing support with backward compatibility (Fixes #145)#157
EINDEX wants to merge 12 commits intoYoRyan:mainfrom
EINDEX:main

Conversation

@EINDEX
Copy link

@EINDEX EINDEX commented Jan 7, 2026

Summary

Adds support for routing notifications based on sender email address in addition to recipient address.

Backward Compatible: Users do not need to upgrade the config for this update.

Resolves #145

Changes

  • Enhanced SimpleRouter to match on both sender and receiver patterns using fnmatch
  • Supports two configuration formats:
    • Direct: sender -> config (implicit *@* receiver)
    • Nested: sender -> receiver -> config

Example

Sender-based routing:

configs:
  unifi@domain.com:
    urls:
      - pushover://...
  uisp@domain.com:
    urls:
      - discord://...

Fine-grained control:

configs:
  monitoring@*:
    alerts@mycompany.com:
      urls:
        - slack://...## Testing
  • ✅ Added tests for direct and nested configurations
  • ✅ Pattern matching with wildcards
  • ✅ All existing tests pass (backward compatible)

Note

This integrates sender routing directly into the core router, unlike my import_code gist approach.
This provides better maintainability and doesn't require separate config files.

EINDEX and others added 11 commits June 28, 2025 20:22
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3 to 4.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@v3...v4)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
…gurations

- Modified the senders attribute to include receiver keys.
- Enhanced the load_from_yaml function to handle both direct and nested configurations.
- Updated tests to reflect changes in sender and receiver key handling.

Signed-off-by: EINDEX <snowstarlbk@gmail.com>
@EINDEX EINDEX mentioned this pull request Jan 7, 2026
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.

Routing by sender

2 participants