feat: add email forwarding management UI#138
Closed
filippoadessi wants to merge 1 commit intostalwartlabs:mainfrom
Closed
feat: add email forwarding management UI#138filippoadessi wants to merge 1 commit intostalwartlabs:mainfrom
filippoadessi wants to merge 1 commit intostalwartlabs:mainfrom
Conversation
|
|
Adds a dedicated email forwarding management section to the Directory module that allows administrators to manage per-address forwarding rules without manually editing Sieve scripts. ## Storage model Rules are persisted in the settings store under the prefix `mail.forward.<from_address>.*`: - `mail.forward.<addr>.to.0`, `.to.1`, … — destination addresses - `mail.forward.<addr>.keep-copy` — boolean (deliver to local mailbox too) A per-domain Sieve script (`sieve.trusted.scripts.<domain_underscored>.contents`) is generated / updated / deleted automatically on every create, edit, or delete operation. The script uses the `redirect` extension; when `keep-copy` is true it uses `:copy` to keep a local copy. ## New pages - **Directory → Forwards** (`/manage/directory/forwards`) List view with search, pagination, bulk-delete, and inline Sieve script rebuild on deletion. - **Directory → Forwards → Edit** (`/manage/directory/forwards/:id/edit`) Create / edit a forward rule: from-address (fixed on edit), one or more destination addresses (textarea, comma/newline/semicolon separated), keep-copy toggle. ## Inline editing in Account detail The account edit page (`/manage/directory/accounts/:id/edit`) gains a **Forwarding** tab for Individual accounts. The UI mirrors the Aliases field: a stacked list of editable address inputs with add/remove buttons. Forward settings are loaded on account open and saved atomically with "Save changes" — no separate save step. ## Files changed - `src/pages/directory/forward/mod.rs` — `ForwardRule`, helpers (`forward_prefix`, `build_sieve_script`, `domain_script_id`), and the `AccountForwardSection` Leptos component used inside the account editor - `src/pages/directory/forward/list.rs` — `ForwardList` component, `parse_forward_settings`, `rebuild_sieve_for_domains`, `fetch_all_forwards` - `src/pages/directory/forward/edit.rs` — `ForwardEdit` component - `src/pages/directory/mod.rs` — `pub mod forward` - `src/pages/directory/edit.rs` — forward signals, load resource, save integration, new Forwarding tab with `AccountForwardSection` - `src/main.rs` — routes `/directory/forwards` and `/directory/forwards/:id/edit`; menu entries under Directory (both desktop and mobile layouts) - `src/pages/config/mod.rs` — minor cleanup
e36d21c to
998e0c1
Compare
|
Text from #137 (comment)
|
Member
|
Thanks but AI generated code is not accepted. In addition to that the webadmin is going to be rewritten from scratch in the next few days. |
Author
|
Thanks for your reply. I use forwarding feature and stalwart has a sieve scripting management workflow for this and it’s not so friendly as I expect. I thought that a little patch to webadmin could be useful not only for me.
I will wait for the new webadmin application.
Bye
Filippo
Il 22 mar 2026, 19:07 +0100, Maurus Decimus ***@***.***>, ha scritto:
… mdecimus left a comment (stalwartlabs/webadmin#138)
Thanks but AI generated code is not accepted. In addition to that the webadmin is going to be rewritten from scratch in the next few days.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
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.
Summary
Adds a dedicated email forwarding management section to the Directory module, allowing administrators to create, edit, and delete per-address forwarding rules without manually editing Sieve scripts.
Storage model
Rules are stored in the settings store under
mail.forward.<from_address>.*:mail.forward.<addr>.to.0,.to.1, … — destination addresses (array)mail.forward.<addr>.keep-copy— boolean; whentrueuses Sieve:copyto keep a local mailbox copyA per-domain Sieve trusted script (
sieve.trusted.scripts.<domain_underscored>.contents) is generated, updated, or deleted automatically on every create / edit / delete operation.New pages
/manage/directory/forwards) — paginated list with search and bulk delete; Sieve scripts are rebuilt on deletion./manage/directory/forwards/:id/edit) — create or edit a rule: source address (fixed on edit), one or more destination addresses, keep-copy toggle.Inline editing in the Account detail page
The account edit page (
/manage/directory/accounts/:id/edit) gains a Forwarding tab for Individual accounts. The UI mirrors the existing Aliases field: a stacked list of editable inputs with add/remove buttons and a keep-copy checkbox. Forward settings are loaded automatically when the account is opened and saved atomically together with "Save changes" — no separate save step required.Test plan
sieve.trusted.scriptssettings-listpermission🤖 Generated with Claude Code