thunderbird: add message filters option (#6652)

* thunderbird: add message filters option

Add option to declare account-specific message filters.

* tests/thunderbird: add second filter for sort

Make sure they are generated in correct order.

* thunderbird: use profilePath for messageFilters

In testing on darwin and NixOS, they use this path. 

---------

Co-authored-by: 347Online | Katie Janzen <katiejanzen@347online.me>
This commit is contained in:
Austin Horstman 2025-03-17 16:14:41 -05:00 committed by GitHub
parent b870fb2d62
commit c657142e24
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 138 additions and 4 deletions

View file

@ -0,0 +1,12 @@
version="9"
logging="no"
name="Should be first"
enabled="yes"
type="128"
action="Cry"
condition="ALL"
name="Mark as Read on Archive"
enabled="yes"
type="128"
action="Mark read"
condition="ALL"

View file

@ -6,6 +6,22 @@
thunderbird = {
enable = true;
profiles = [ "first" ];
messageFilters = [
{
name = "Should be first";
enabled = true;
type = "128";
action = "Cry";
condition = "ALL";
}
{
name = "Mark as Read on Archive";
enabled = true;
type = "128";
action = "Mark read";
condition = "ALL";
}
];
};
aliases = [ "home-manager@example.com" ];
@ -99,5 +115,13 @@
assertFileExists home-files/${profilesDir}/first/chrome/userContent.css
assertFileContent home-files/${profilesDir}/first/chrome/userContent.css \
<(echo "* { color: red !important; }")
assertFileExists home-files/${profilesDir}/first/ImapMail/${
builtins.hashString "sha256" "hm@example.com"
}/msgFilterRules.dat
assertFileContent home-files/${profilesDir}/first/ImapMail/${
builtins.hashString "sha256" "hm@example.com"
}/msgFilterRules.dat \
${./thunderbird-expected-msgFilterRules.dat}
'';
}