Add standalone dynamic invoice Sieve rule

The prompts used to arrive at this change since the previous commit

User reported the Dynamisch kwartaal Roundcube filter is empty and asked for a new file containing a dynamic invoice-quarter filter while keeping the rest of the plan approved.

Any special observations that may be relevant for version management for this version. Be brief.

invoice_dynamic_quarter.sieve uses Date header year capture plus regex month tests and compiles with sievec. Existing untracked financ.sieve, codex.session, roundcube.txt, plan.md, and verplaats_log.json were left untouched.
This commit is contained in:
2026-07-05 22:28:36 +02:00
parent 12a82f570a
commit 7b345b8795
2 changed files with 41 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
# invoice_dynamic_quarter.sieve
# Single Roundcube/Managesieve rule for dynamic invoice quarter routing.
# Import this as a standalone filter set or copy the rule into an existing set.
require ["fileinto", "date", "variables", "regex"];
# rule:[Financieel / Facturen / Dynamisch kwartaal]
if allof (
header :contains "Subject" [
"factuur",
"invoice",
"rekening",
"nota",
"betaalverzoek",
"receipt",
"orderbevestiging",
"order confirmation",
"betaling ontvangen",
"payment received",
"uw factuur",
"your invoice",
"je factuur"
],
date :matches "Date" "year" "*"
) {
set "jaar" "${1}";
if date :regex "Date" "month" "^(0?[123])$" {
set "kwartaal" "Q1";
} elsif date :regex "Date" "month" "^(0?[456])$" {
set "kwartaal" "Q2";
} elsif date :regex "Date" "month" "^(0?[789])$" {
set "kwartaal" "Q3";
} else {
set "kwartaal" "Q4";
}
fileinto "INBOX.Financieel.Facturen.${jaar}.${kwartaal}";
stop;
}
+1
View File
@@ -70,6 +70,7 @@ Logs/state kept:
Roundcube/Sieve: Roundcube/Sieve:
- `mailcat_roundcube.sieve` is the generated Roundcube/Managesieve Sieve file for the current routing setup. - `mailcat_roundcube.sieve` is the generated Roundcube/Managesieve Sieve file for the current routing setup.
- `invoice_dynamic_quarter.sieve` is a standalone Roundcube/Managesieve Sieve file containing only the dynamic invoice-quarter rule. It uses the message `Date` header to set `jaar`, regex month tests to set `kwartaal`, then files into `INBOX.Financieel.Facturen.${jaar}.${kwartaal}`.
- It uses `INBOX.`-prefixed mailbox names because the user's Roundcube export used `fileinto :copy "INBOX.Notes";`. - It uses `INBOX.`-prefixed mailbox names because the user's Roundcube export used `fileinto :copy "INBOX.Notes";`.
- It includes `Afmelden.*` routes and uses `fileinto` without `:copy`, so matching incoming messages are sorted instead of duplicated. - It includes `Afmelden.*` routes and uses `fileinto` without `:copy`, so matching incoming messages are sorted instead of duplicated.
- Rules have Roundcube-compatible `# rule:[...]` names. - Rules have Roundcube-compatible `# rule:[...]` names.