Skip to content

mail-server/users.nix: don't expand variables in sieve script

Ruben Maher requested to merge eqyiel:fix-sieve-variables into master

With this change the sieve script

require ["fileinto", "mailbox"];

if address :is "from" "notifications@github.com" {
  fileinto :create "GitHub";
  stop;
}

# This must be the last rule, it will check if list-id is set, and
# file the message into the Lists folder for further investigation
elsif header :matches "list-id" "<?*>" {
  fileinto :create "Lists";
  stop;
}

# Test: ''${1}
# Test: ${builtins.toString 1234};

...gets interpreted like this:

$ cat /var/sieve/ruben@maher.fyi/default.sieve                                                                                                                                                    
require ["fileinto", "mailbox"];

if address :is "from" "notifications@github.com" {
  fileinto :create "GitHub";
  stop;
}

# This must be the last rule, it will check if list-id is set, and
# file the message into the Lists folder for further investigation
elsif header :matches "list-id" "<?*>" {
  fileinto :create "Lists";
  stop;
}

# Test: ${1}
# Test: 1234;

Fixes #71 (closed)

Merge request reports