---
- name: install Amavis
  ansible.builtin.apt:
    name:
      - postgrey
      - amavisd-new
    state: present
  tags:
    - amavis

- name: configure Amavis
  ansible.builtin.template:
    src: amavis.conf.j2
    dest: /etc/amavis/conf.d/49-evolinux-defaults
    mode: "0644"
  notify: restart amavis
  tags:
    - amavis

- name: Install purge custom cron
  ansible.builtin.copy:
    src: amavis_purge_virusmails
    dest: /etc/cron.daily/amavis_purge_virusmails
    mode: "0755"
  tags:
    - amavis
    - amavis_purge_cron
