--- # Outbound mail for system notifications (backup failures, cron output). # # msmtp rather than the esmtp already on the box: the OpenSRS relay uses port # 465, which is IMPLICIT TLS, and libesmtp/esmtp only speaks STARTTLS. msmtp # handles implicit TLS via `tls_starttls off` and mirrors the settings the # TrueNAS box already uses. # On Fedora the single `msmtp` package already ships /usr/bin/sendmail and # /usr/lib/sendmail; there is no separate msmtp-sendmail package (Debian split). - name: install msmtp become: true ansible.builtin.package: name: msmtp state: present tags: mail - name: configure msmtp become: true ansible.builtin.template: src: msmtp/msmtprc.j2 dest: /etc/msmtprc owner: root group: root mode: 0600 no_log: true tags: mail - name: point the mta alternative at msmtp become: true community.general.alternatives: name: mta path: /usr/bin/msmtp-sendmail failed_when: false tags: mail