diff --git a/defaults/main.yml b/defaults/main.yml index c5bdb88..9f73a81 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -113,4 +113,17 @@ directadmin_ns2: ns2.somehost.com directadmin_custom_conf: - name: Don't allow "+" in email account option: allow_email_plus - value: 0 \ No newline at end of file + value: 0 + +directadmin_esf_easy_limit: "55" # The Easy Spam Fighter Limit +directadmin_esf_easy_is_spam: "20" # This is the threshold to be considered SPAM +directadmin_esf_easy_high_score_drop: "100" # Hit this threshold and ESF/Exim will drop the mail +directadmin_esf_easy_spf_pass: "-30" # This is the score to apply if SPF Passes +directadmin_esf_easy_spf_soft_fail: "30" # Add this if SPF fails soft +directadmin_esf_easy_spf_fail: "100" # Add this to Spam score on Hard Fail SPF +directadmin_esf_easy_dkim_pass: "-20" +directadmin_esf_easy_dkim_fail: "100" +directadmin_esf_easy_no_reverse_ip: "100" +directadmin_esf_easy_forward_confirmed_rdns: "-10" +directadmin_esf_easy_dns_blacklist: "50" +directadmin_esf_easy_spamassassin_max_size: "512K" diff --git a/tasks/config/mail.yml b/tasks/config/mail.yml index a8c0d91..1caeee6 100644 --- a/tasks/config/mail.yml +++ b/tasks/config/mail.yml @@ -8,6 +8,9 @@ - name: Import Exim configuration import_tasks: mail/exim.yml +- name: Import ESF configuration + import_tasks: mail/esf.yml + - name: Ensure DirectAdmin Custom Templates exists file: path: /usr/local/directadmin/data/templates/custom diff --git a/tasks/config/mail/esf.yml b/tasks/config/mail/esf.yml new file mode 100644 index 0000000..556dc88 --- /dev/null +++ b/tasks/config/mail/esf.yml @@ -0,0 +1,13 @@ + +- name: Ensure custom ESF directory exists + file: + path: /etc/exim.easy_spam_fighter + state: directory + +- name: Apply ESF Configurations + template: + src: templates/exim/exim.easy_spam_fighter/variables.conf.custom.j2 + dest: /etc/exim.easy_spam_fighter/variables.conf.custom + mode: 0600 + notify: + - "directadmin : Restart Exim" \ No newline at end of file diff --git a/templates/exim/exim.easy_spam_fighter/variables.conf.custom.j2 b/templates/exim/exim.easy_spam_fighter/variables.conf.custom.j2 new file mode 100644 index 0000000..620d13e --- /dev/null +++ b/templates/exim/exim.easy_spam_fighter/variables.conf.custom.j2 @@ -0,0 +1,12 @@ +EASY_LIMIT={{ directadmin_esf_easy_limit }} +EASY_IS_SPAM = {{ directadmin_esf_easy_is_spam }} +EASY_HIGH_SCORE_DROP = {{ directadmin_esf_easy_high_score_drop }} +EASY_SPF_PASS = {{ directadmin_esf_easy_spf_pass }} +EASY_SPF_SOFT_FAIL = {{ directadmin_esf_easy_spf_soft_fail }} +EASY_SPF_FAIL = {{ directadmin_esf_easy_spf_fail }} +EASY_DKIM_PASS = {{ directadmin_esf_easy_dkim_pass }} +EASY_DKIM_FAIL = {{ directadmin_esf_easy_dkim_fail }} +EASY_NO_REVERSE_IP = {{ directadmin_esf_easy_no_reverse_ip }} +EASY_FORWARD_CONFIRMED_RDNS = {{ directadmin_esf_easy_forward_confirmed_rdns }} +EASY_DNS_BLACKLIST = {{ directadmin_esf_easy_dns_blacklist }} +EASY_SPAMASSASSIN_MAX_SIZE = {{ directadmin_esf_easy_spamassassin_max_size }} \ No newline at end of file