- name: server | utilities | {{ mta_package }}
  block:
    - name: server | utilities | install {{ mta_package }}
      package:
        name: "{{ mta_package }}"
        state: present
    - name: server | utitilies | configure {{ mta_package }}
      lineinfile:
        path: "/etc/ssmtp/ssmtp.conf" # required. The file to modify. Before Ansible 2.3 this option was only usable as I(dest), I(destfile) and I(name).
        regexp: "{{ item.regex }}"
        state: present
        line: "{{ item.line }}"
      loop:
        - { regex: "^root=.*$", line: "root=rene@tantooine.myfirewall.org"}
        - { regex: "^mailhub=.*", line: "mailhub=mail.universe.local"}
        - { regex: "^hostname=.*", line: "hostname={{ ansible_fqdn }}"}
      when: ansible_distribution in ["Debian", "Pop!_OS", "Ubuntu", "Linux Mint"]
    - name: server | utilities | remove postfix
      package:
        name: 
          - postfix
          - postfix-ldap
          - postfix-mysql
          - postfix-sqlite
          - postgrey
        state: absent
  when: postfix is not defined or postfix == false
