diff --git a/README.md b/README.md index b93e58c..50205f9 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,14 @@ Defaults: # - foobar spamassassin_spamtraining_users: [] + # Set custom spamassasssin rules + # spamassassin_custom_rules: + # - | + # header SPF_FAIL eval:check_for_spf_fail() + # describe SPF_FAIL SPF: sender does not match SPF record (fail) + # tflags SPF_FAIL net + # reuse SPF_FAIL + # Set custom spamassassin scores # spamassassin_custom_scores: # - name: SPF_FAIL diff --git a/defaults/main.yml b/defaults/main.yml index 5694013..f3c08f4 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -137,6 +137,15 @@ spamassassin_razor_config_dir: /etc/spamassassin/.razor # - foobar spamassassin_spamtraining_users: [] +# Set custom spamassasssin rules +# spamassassin_custom_rules: +# - | +# header SPF_FAIL eval:check_for_spf_fail() +# describe SPF_FAIL SPF: sender does not match SPF record (fail +# tflags SPF_FAIL net +# reuse SPF_FAIL +spamassassin_custom_rules: [] + # Set custom spamassassin scores # spamassassin_custom_scores: # - name: SPF_FAIL diff --git a/templates/spamassassin/local.cf.j2 b/templates/spamassassin/local.cf.j2 index 519c74d..d15e5f8 100644 --- a/templates/spamassassin/local.cf.j2 +++ b/templates/spamassassin/local.cf.j2 @@ -182,6 +182,13 @@ use_razor2 0 {% endif %} razor_config {{ spamassassin_razor_config_dir }} +{% if spamassassin_custom_rules %} +# custom rules +{% for rule in spamassassin_custom_rules %} +{{ rule }} +{% endfor %} +{% endif -%} + {% if spamassassin_custom_scores %} # custom scores {% for score in spamassassin_custom_scores %}