asn {
}
spf {}
redis {
  servers = "${REDIS_ADDR}:${REDIS_PORT}";
  expand_keys = true;
}
multimap {
  DNSBL_MAP {
    type = "dnsbl";
    map = "rspamd.com";
  }
  IP_MAP {
    type = "ip";
    map = "${TESTDIR}/configs/maps/ip.list";
  }
  FROM_MAP {
    type = "from";
    filter = "email:domain";
    map = "${TESTDIR}/configs/maps/domains.list";
  }
  FREEMAIL_CC {
    type = "header";
    header = "Cc";
    filter = "email:domain";
    map = "${TESTDIR}/configs/maps/domains.list.2";
  }
  REGEXP_MAP {
    type = "from";
    filter = "email:addr";
    regexp = true;
    map = "${TESTDIR}/configs/maps/regexp.list";
  }
  DEPS_MAP {
    type = "from";
    filter = "email:addr";
    regexp = true;
    map = "${TESTDIR}/configs/maps/regexp.list";
    require_symbols = "(R_SPF_ALLOW|R_SPF_DNSFAIL) & REGEXP_MAP & !FROM_MAP";
  }
  RCPT_DOMAIN {
    type = "rcpt";
    filter = "email:domain";
    map = "${TESTDIR}/configs/maps/domains.list";
  }
  RCPT_USER {
    type = "rcpt";
    filter = "email:user";
    map = "${TESTDIR}/configs/maps/users.list";
  }
  RCPT_MAP {
    type = "rcpt";
    filter = "email:addr";
    symbols = ["SYM1"];
    map = "${TESTDIR}/configs/maps/multiple.list";
  }
  HEADER_MAP {
    type = "header";
    header = "To";
    filter = "email:name";
    map = "${TESTDIR}/configs/maps/utf.list";
    regexp = true;
  }
  HOSTNAME_MAP {
    type = "hostname";
    map = "${TESTDIR}/configs/maps/domains.list";
  }
  HOSTNAME_TOP_MAP {
    type = "hostname";
    filter = "top";
    map = "${TESTDIR}/configs/maps/top.list";
  }
  CDB_HOSTNAME {
    type = "hostname";
    map = "cdb://${TESTDIR}/configs/maps/domains.cdb";
  }
  REDIS_HOSTNAME {
    type = "hostname";
    map = "redis://hostname";
  }
  REDIS_HOSTNAME_EXPANSION {
    type = "hostname";
    map = "redis://\${ip}.\${principal_recipient_domain}";
  }
  REDIS_IPADDR {
    type = "ip";
    map = "redis://ipaddr";
  }
  REDIS_FROMADDR {
    type = "from";
    filter = "email:addr";
    map = "redis://emailaddr";
  }
  REDIS_URL_TLD {
    type = "url";
    map = "redis://hostname";
    filter = "tld";
  }
  REDIS_URL_RE_FULL {
    type = "url";
    map = "redis://fullurlre";
    filter = "full:regexp:/(html)$/";
  }
  REDIS_URL_FULL {
    type = "url";
    map = "redis://fullurl";
    filter = "full";
  }
  REDIS_URL_PHISHED {
    type = "url";
    map = "redis://phishedurl";
    filter = "is_phished";
  }
  REDIS_URL_RE_TLD {
    type = "url";
    map = "redis://tldre";
    filter = "tld:regexp:/(net)$/";
  }
  REDIS_URL_RE_PLAIN {
    type = "url";
    map = "redis://urlre";
    filter = "regexp:/^(www)/";
  }
  REDIS_URL_NOFILTER {
    type = "url";
    map = "redis://urlnofilter";
  }
  REDIS_COUNTRY {
    type = "country";
    map = "redis://cc";
  }
  REDIS_ASN {
    type = "asn";
    map = "redis://asn";
  }
  REDIS_ASN_FILTERED {
    type = "mempool";
    variable = "asn";
    map = "redis://asn";
    filter = "regexp:/^([0-9]).*/";
  }
  RCVD_TEST_01 {
    type = "received";
    max_pos = 1;
    map = "${TESTDIR}/configs/maps/rcvd.list";
  }
  RCVD_TEST_02 {
    type = "received";
    min_pos = -1;
    map = "${TESTDIR}/configs/maps/rcvd.list";
  }
  RCVD_TEST_REDIS_01 {
    type = "received";
    map = "redis://RCVD_TEST";
  }
  RCVD_AUTHED_ONE {
    type = "received";
    map = "${TESTDIR}/configs/maps/rcvd2.list";
    flags = ["authenticated"];
    nflags = ["ssl"];
  }
  RCVD_AUTHED_TWO {
    type = "received";
    map = "${TESTDIR}/configs/maps/rcvd2.list";
    flags = ["authenticated", "ssl"];
  }
  COMBINED_MAP_AND {
    type = "combined";
    rules {
      ip = {
        type = "radix";
        map = "${TESTDIR}/configs/maps/ip.list";
        selector = "ip";
      }
      from {
        map = "${TESTDIR}/configs/maps/domains.list";
        selector = "from:domain";
      }
    }
    expression = "from & ip"
  }
  COMBINED_MAP_OR {
    type = "combined";
    rules {
      ip = {
        type = "radix";
        map = "${TESTDIR}/configs/maps/ip.list";
        selector = "ip";
      }
      from {
        map = "${TESTDIR}/configs/maps/domains.list";
        selector = "from:domain";
      }
    }
    expression = "from || ip"
  }
}
