Skip to content

Commit

Permalink
Support custom rules
Browse files Browse the repository at this point in the history
  • Loading branch information
nevart committed Sep 30, 2024
1 parent d3d1bc7 commit 4e7f102
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions templates/spamassassin/local.cf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand Down

0 comments on commit 4e7f102

Please sign in to comment.