r-raymond / nixos-mailserver

A complete and Simple Nixos Mailserver
GNU General Public License v3.0
181 stars 27 forks source link

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

Closed eqyiel closed 6 years ago

eqyiel commented 6 years ago

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

eqyiel commented 6 years ago

The CI error appears to be unrelated

r-raymond commented 6 years ago

awesome, thanks a lot for fixing this! I'll merge if @The-M1k3y confirms it works for him

The-M1k3y commented 6 years ago

Sorry, it took me some time to check. I can confirm that this fixes the issue on my server. (based on release 2.0.4)

eqyiel commented 6 years ago

Rebased!

eqyiel commented 6 years ago

Looks like Travis timed out while writing to the cache, apparently that can be configured though: https://docs.travis-ci.com/user/caching/#Setting-the-timeout

r-raymond commented 6 years ago

It now fails with The job exceeded the maximum time limit for jobs, and has been terminated. But since this is unrelated to the PR, I'll merge.