diff --git a/amavis/tasks/main.yml b/amavis/tasks/main.yml index 880c3a66..810ba505 100644 --- a/amavis/tasks/main.yml +++ b/amavis/tasks/main.yml @@ -17,27 +17,3 @@ notify: restart amavis tags: - amavis - -- name: copy spam.sh script - copy: - src: spam.sh - dest: /usr/share/scripts/spam.sh - mode: "0700" - tags: - - amavis - -- name: enable spam.sh cron - lineinfile: - dest: /etc/cron.d/spam - line: "42 * * * * /usr/share/scripts/spam.sh" - create: yes - state: present - mode: "0640" - tags: - - amavis - -- name: update antispam list - command: /usr/share/scripts/spam.sh - changed_when: false - tags: - - amavis diff --git a/packmail/meta/main.yml b/packmail/meta/main.yml index 9b144692..b86b35e9 100644 --- a/packmail/meta/main.yml +++ b/packmail/meta/main.yml @@ -1,10 +1,10 @@ --- dependencies: - { role: ldap, ldap_schema: 'cn4evolix.ldif' } - - { role: postfix, postfix_packmail: True, postfix_force_main_cf: True, postfix_slow_transport_include: True } - { role: amavis } - { role: spamassasin } - { role: clamav } + - { role: postfix, postfix_packmail: True, postfix_force_main_cf: True, postfix_slow_transport_include: True } - { role: dovecot } - { role: apache } - { role: php, php_apache_enable: True } diff --git a/amavis/files/spam.sh b/postfix/files/spam.sh similarity index 100% rename from amavis/files/spam.sh rename to postfix/files/spam.sh diff --git a/postfix/tasks/main.yml b/postfix/tasks/main.yml index bc4f2240..628e0eab 100644 --- a/postfix/tasks/main.yml +++ b/postfix/tasks/main.yml @@ -120,6 +120,33 @@ tags: - postfix +- name: copy spam.sh script + copy: + src: spam.sh + dest: /usr/share/scripts/spam.sh + mode: "0700" + when: postfix_packmail == True + tags: + - postfix + +- name: enable spam.sh cron + lineinfile: + dest: /etc/cron.d/spam + line: "42 * * * * /usr/share/scripts/spam.sh" + create: yes + state: present + mode: "0640" + when: postfix_packmail == True + tags: + - postfix + +- name: update antispam list + command: /usr/share/scripts/spam.sh + changed_when: false + when: postfix_packmail == True + tags: + - postfix + - include: slow_transport.yml when: postfix_slow_transport_include tags: