diff --git a/files/usr/local/sbin/update_postgrey_whitelist.sh b/files/usr/local/sbin/update_postgrey_whitelist.sh index 739500c..f2ad2d5 100755 --- a/files/usr/local/sbin/update_postgrey_whitelist.sh +++ b/files/usr/local/sbin/update_postgrey_whitelist.sh @@ -1,7 +1,8 @@ #!/bin/bash -wget https://github.com/schweikert/postgrey/raw/master/postgrey_whitelist_clients +curl -L https://github.com/schweikert/postgrey/raw/master/postgrey_whitelist_clients -o /dev/shm/postgrey_whitelist_clients #wget https://github.com/schweikert/postgrey/raw/master/postgrey_whitelist_recipients -sed -e 's|##DATE##|'"$(date +%d/%m/%Y)"'|' -e 's|##VERSION##|master|' -i postgrey_whitelist_clients -cat postgrey_whitelist_clients > /etc/postfix/postgrey_whitelist_clients +sed -e 's|##DATE##|'"$(date +%d/%m/%Y)"'|' -e 's|##VERSION##|master|' -i /dev/shm/postgrey_whitelist_clients +cat /dev/shm/postgrey_whitelist_clients > /etc/postfix/postgrey_whitelist_clients +rm -f /dev/shm/postgrey_whitelist_clients systemctl restart postgrey diff --git a/tasks/postgrey.yml b/tasks/postgrey.yml index 7f40060..7dd7fd8 100644 --- a/tasks/postgrey.yml +++ b/tasks/postgrey.yml @@ -6,8 +6,17 @@ group: root mode: 0755 +- name: Mise à jour des whitelist de postgrey via crontab + cron: + name: update_postgrey_whitelist + minute: "1" + hour: "0" + user: root + job: "/usr/local/sbin/update_postgrey_whitelist.sh" + cron_file: update_postgrey_whitelist + - name: Enable postgrey at boot time service: name: postgrey - enabled: yes + enabled: true state: started