Update postgrey deployment

This commit is contained in:
Adrien Reslinger 2022-07-16 12:53:09 +02:00
parent c8ce0a276c
commit 1a47f13713
Signed by: adrien
GPG key ID: DA7B27055C66D6DE
2 changed files with 14 additions and 4 deletions

View file

@ -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

View file

@ -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