Browse Source

Cronmails: Fix rejected mails b/c of non FQDNs in sender

master
Jannik Beyerstedt 2 months ago
parent
commit
d6fee609e4
  1. 1
      README.md
  2. 2
      defaults/main.yml
  3. 10
      tasks/cronmails-Debian.yml
  4. 7
      tasks/cronmails.yml
  5. 2
      templates/update-exim4.conf.conf

1
README.md

@ -36,6 +36,7 @@ Mandatory variable:
### Cronmails
Mandatory variable:
- `cron_email`: Sender email address used by cron
- `exim_etc_mailname`: Exim4 /etc/mailname (default: inventory_hostname)
### Docker
Optional variable:

2
defaults/main.yml

@ -11,3 +11,5 @@ telegraf_unifi_file: "telegraf-UniFi.conf.j2"
telegraf_airmax_file: "telegraf-AirMAX.conf.j2"
dockercompose_use_pip: false
exim_etc_mailname: "{{ inventory_hostname }}"

10
tasks/cronmails-Debian.yml

@ -30,13 +30,19 @@
src: "{{ role_path }}/templates/update-exim4.conf.conf"
dest: /etc/exim4/update-exim4.conf.conf
register: cronmails_conffile_update
- name: cronmails - Set /etc/mailname
become: yes
ansible.builtin.copy:
dest: /etc/mailname
content: "{{ exim_etc_mailname }}"
register: cronmails_mailname_update
- name: cronmails - Run update-exim4.conf
become: yes
ansible.builtin.shell: "update-exim4.conf"
when: cronmails_conftmp_update.changed or cronmails_conffile_update.changed
when: cronmails_conftmp_update.changed or cronmails_conffile_update.changed or cronmails_mailname_update.changed
- name: cronmails - Enable and start exim4
become: yes
ansible.builtin.service:
name: exim4
state: started
state: restarted
enabled: yes

7
tasks/cronmails.yml

@ -23,3 +23,10 @@
name: MAILTO
env: yes
value: "{{ cron_email }}"
- name: cronmails - Add monthly test mail
become: yes
ansible.builtin.cron:
name: "Monthly Test Mail"
minute: "0"
day: "1"
job: echo "Monthly cron test mail"

2
templates/update-exim4.conf.conf

@ -17,7 +17,7 @@
# This is a Debian specific file
dc_eximconfig_configtype='internet'
dc_other_hostnames='{{ ansible_hostname }}, localhost.localdomain, localhost'
dc_other_hostnames='{{ inventory_hostname }}, localhost.localdomain, localhost'
dc_local_interfaces='127.0.0.1 ; ::1'
dc_readhost=''
dc_relay_domains=''

Loading…
Cancel
Save