# Policies rules scores, includes SPF, DKIM, DMARC and ARC symbols
#
# Please don't modify this file as your changes might be overwritten with
# the next update.
#
# You can modify '$LOCAL_CONFDIR/rspamd.conf.local.override' to redefine
# parameters defined on the top level
#
# You can modify '$LOCAL_CONFDIR/rspamd.conf.local' to add
# parameters defined on the top level
#
# For specific modules or configuration you can also modify
# '$LOCAL_CONFDIR/local.d/file.conf' - to add your options or rewrite defaults
# '$LOCAL_CONFDIR/override.d/file.conf' - to override the defaults
#
# See https://rspamd.com/doc/tutorials/writing_rules.html for details

symbols = {
    # SPF
    "R_SPF_FAIL" {
        weight = 1.0;
        description = "SPF verification failed";
    }
    "R_SPF_SOFTFAIL" {
        weight = 0.0;
        description = "SPF verification soft-failed";
    }
    "R_SPF_NEUTRAL" {
        weight = 0.0;
        description = "SPF policy is neutral";
    }
    "R_SPF_ALLOW" {
        weight = -0.2;
        description = "SPF verification allows sending";
    }
    "R_SPF_DNSFAIL" {
        weight = 0.0;
        description = "SPF DNS failure";
    }

    # DKIM
    "R_DKIM_REJECT" {
        weight = 1.0;
        description = "DKIM verification failed";
        one_shot = true;
    }
    "R_DKIM_TEMPFAIL" {
        weight = 0.0;
        description = "DKIM verification soft-failed";
    }
    "R_DKIM_ALLOW" {
        weight = -0.2;
        description = "DKIM verification succeed";
        one_shot = true;
    }

    # DMARC
    "DMARC_POLICY_ALLOW" {
        weight = -0.5;
        description = "DMARC permit policy";
    }
    "DMARC_POLICY_ALLOW_WITH_FAILURES" {
        weight = -0.5;
        description = "DMARC permit policy with DKIM/SPF failure";
    }
    "DMARC_POLICY_REJECT" {
        weight = 2.0;
        description = "DMARC reject policy";
    }
    "DMARC_POLICY_QUARANTINE" {
        weight = 1.5;
        description = "DMARC quarantine policy";
    }
    "DMARC_POLICY_SOFTFAIL" {
        weight = 0.1;
        description = "DMARC failed";
    }

    # ARC
    "ARC_ALLOW" {
        weight = -1.0;
        description = "ARC checks success"
    }

    "ARC_REJECT" {
        weight = 2.0;
        description = "ARC checks success"
    }

    "ARC_INVALID" {
        weight = 1.0;
        description = "ARC structure invalid"
    }

    "ARC_DNSFAIL" {
        weight = 0.0;
        description = "ARC DNS error"
    }

    "ARC_NA" {
        weight = 0.0;
        description = "ARC signature absent"
    }
}