mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2025-04-20 02:52:11 +00:00
mail-postfix.sh: update postgrey_whitelist_clients once, disable cron
This commit is contained in:
parent
a85c429a85
commit
3bc51e4cb4
@ -237,31 +237,17 @@ tools/editconf.py /etc/default/postgrey \
|
|||||||
POSTGREY_OPTS=\"'--inet=127.0.0.1:10023 --delay=180'\"
|
POSTGREY_OPTS=\"'--inet=127.0.0.1:10023 --delay=180'\"
|
||||||
|
|
||||||
|
|
||||||
# We are going to setup a newer whitelist for postgrey, the version included in the distribution is old
|
# The postgrey_whitelist_clients from the maintainer's site is newer than the version in Ubuntu's .deb, but still hasn't
|
||||||
cat > /etc/cron.daily/mailinabox-postgrey-whitelist << EOF;
|
# been updated since 2019. Lets just pull down the latest version once. (see #2072)
|
||||||
#!/bin/bash
|
postgrey_whitelist_clients_hash=f2f27e75249ed30ebf93363e4fd63c6208c23266
|
||||||
|
|
||||||
# Mail-in-a-Box
|
if ! echo "$postgrey_whitelist_clients_hash /etc/postgrey/whitelist_clients" | sha1sum --check --strict > /dev/null; then
|
||||||
|
wget_verify https://postgrey.schweikert.ch/pub/postgrey_whitelist_clients $postgrey_whitelist_clients_hash /tmp/whitelist_clients
|
||||||
# check we have a postgrey_whitelist_clients file and that it is not older than 28 days
|
mv /tmp/whitelist_clients /etc/postgrey/whitelist_clients
|
||||||
if [ ! -f /etc/postgrey/whitelist_clients ] || find /etc/postgrey/whitelist_clients -mtime +28 | grep -q '.' ; then
|
|
||||||
# ok we need to update the file, so lets try to fetch it
|
|
||||||
if curl https://postgrey.schweikert.ch/pub/postgrey_whitelist_clients --output /tmp/postgrey_whitelist_clients -sS --fail > /dev/null 2>&1 ; then
|
|
||||||
# if fetching hasn't failed yet then check it is a plain text file
|
|
||||||
# curl manual states that --fail sometimes still produces output
|
|
||||||
# this final check will at least check the output is not html
|
|
||||||
# before moving it into place
|
|
||||||
if [ "\$(file -b --mime-type /tmp/postgrey_whitelist_clients)" == "text/plain" ]; then
|
|
||||||
mv /tmp/postgrey_whitelist_clients /etc/postgrey/whitelist_clients
|
|
||||||
service postgrey restart
|
|
||||||
else
|
|
||||||
rm /tmp/postgrey_whitelist_clients
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
EOF
|
|
||||||
chmod +x /etc/cron.daily/mailinabox-postgrey-whitelist
|
# Remove old cronjob
|
||||||
/etc/cron.daily/mailinabox-postgrey-whitelist
|
rm -f /etc/cron.daily/mailinabox-postgrey-whitelist
|
||||||
|
|
||||||
# Increase the message size limit from 10MB to 128MB.
|
# Increase the message size limit from 10MB to 128MB.
|
||||||
# The same limit is specified in nginx.conf for mail submitted via webmail and Z-Push.
|
# The same limit is specified in nginx.conf for mail submitted via webmail and Z-Push.
|
||||||
|
Loading…
Reference in New Issue
Block a user