mirror of
https://github.com/JulienMalka/snowfield.git
synced 2025-03-27 06:10:53 +01:00
Fixed sieve filters
This commit is contained in:
parent
b9209a815c
commit
86837313c2
2 changed files with 49 additions and 11 deletions
|
@ -22,16 +22,8 @@ with lib;
|
|||
loginAccounts = {
|
||||
"julien@malka.sh" = {
|
||||
hashedPasswordFile = "/run/secrets/malkash-pw";
|
||||
catchAll = [ "malka.sh" ];
|
||||
sieveScript = ''
|
||||
require ["variables", "fileinto", "envelope", "subaddress", "mailbox"];
|
||||
|
||||
if envelope :matches :user "to" "*" {
|
||||
# you can prefix with INBOX/ or INBOX. if necessary
|
||||
# remove :create if you want to permit only existing mailboxes
|
||||
fileinto :create "''${1}";
|
||||
}
|
||||
'';
|
||||
aliases = [ "@malka.sh" ];
|
||||
sieveScript = builtins.readFile ./malka-sh.sieve;
|
||||
};
|
||||
"julien.malka@ens.school" = {
|
||||
hashedPasswordFile = "/run/secrets/ensmailmalka-pw";
|
||||
|
@ -49,7 +41,6 @@ with lib;
|
|||
|
||||
services.roundcube = {
|
||||
enable = true;
|
||||
plugins = [ "managesieve" ];
|
||||
hostName = "webmail.julienmalka.me";
|
||||
};
|
||||
|
||||
|
|
47
modules/mailserver/malka-sh.sieve
Normal file
47
modules/mailserver/malka-sh.sieve
Normal file
|
@ -0,0 +1,47 @@
|
|||
require ["variables", "fileinto", "envelope", "subaddress", "mailbox"];
|
||||
|
||||
# rule:[FRnOG]
|
||||
if allof (header :contains "subject" "[FRnOG]")
|
||||
{
|
||||
fileinto "INBOX.FRnOG";
|
||||
}
|
||||
# rule:[dn42]
|
||||
if allof (header :contains "subject" "[dn42]")
|
||||
{
|
||||
fileinto "INBOX.dn42";
|
||||
}
|
||||
# rule:[Lobsters]
|
||||
if allof (header :is "to" "lobsters-hQ3nfqM88Q@lobste.rs")
|
||||
{
|
||||
fileinto "INBOX.Lobsters";
|
||||
}
|
||||
# rule:[Fosdem]
|
||||
if allof (header :contains "subject" "[devroom-managers]")
|
||||
{
|
||||
fileinto "INBOX.FOSDEM";
|
||||
}
|
||||
# rule:[Promox]
|
||||
if allof (header :contains "subject" "[pve-devel]")
|
||||
{
|
||||
fileinto "INBOX.Proxmox";
|
||||
}
|
||||
# rule:[Github]
|
||||
if allof (header :contains "from" "notifications@github.com")
|
||||
{
|
||||
fileinto "INBOX.Github";
|
||||
}
|
||||
# rule:[Netdata]
|
||||
if allof (header :contains "from" "netdata")
|
||||
{
|
||||
fileinto "INBOX.Netdata";
|
||||
}
|
||||
#rule:[Lol]
|
||||
if header :matches "X-Original-To" "*@malka.sh" {
|
||||
set "name" "${1}";
|
||||
}
|
||||
|
||||
if string :is "${name}" "" {
|
||||
fileinto "INBOX";
|
||||
} else {
|
||||
fileinto :create "INBOX.${name}";
|
||||
}
|
Loading…
Add table
Reference in a new issue