lua = ${LUA_SCRIPT};

settings {
  id_test {
    id = "id_test";
    apply {
      symbols_enabled = ["SIMPLE_TEST"];
    }
  }

  id_pre { # implicit id
    apply {
      symbols_enabled = ["SIMPLE_PRE"];
    }
  }

  id_virtual {
    apply {
      symbols_enabled = ["SIMPLE_VIRTUAL"];
    }
  }

  id_virtual1 {
    apply {
      symbols {
        EXPLICIT_VIRTUAL1 = 10.0
      }
       symbols_enabled = ["DEP_REAL"];
    }
  }

  id_virtual_group {
    user = "test@example.com";
    from = "test2@example.com";
    hostname = "example.com";
    selector = "rcpts:addr.in(test3@example.com)";
    header = {
      "Content-Transfer-Encoding" = "7bit";
      "Custom-Header" = true;
      "Mime-Version" = false;
    }
    request_header = {
      "Test" = "passed";
    }

    expression = 'user || from || hostname || selector:1 || header:mime_version || header:custom_header || header:1 || request_header:test'
    apply {
      symbols_enabled {
        SIMPLE_VIRTUAL = 10.0;
      }
      symbols {
        EXPLICIT_VIRTUAL = 10.0
      }
    }
  }

  id_test_priority {
    priority = high;
    from = "user@test.com";
    apply {
      symbols_enabled {
        PRIORITY = 10.0;
      }
      symbols {
        PRIORITY_2 = 10.0
      }
    }
  }
}

classifier {
  backend = "sqlite3";
  statfile {
    spam = true;
    symbol = BAYES_SPAM;
    path = "/tmp/bayes.spam.sqlite3";
  }
  statfile {
    spam = false;
    symbol = BAYES_HAM;
    path = "/tmp/bayes.ham.sqlite3";
  }
  min_learns = 1;
  min_token_hits = 1;
}