Merge pull request #2950 from friedPotat0/postwhite

update postscreen whitelist by using postwhite
master
André Peters 2019-10-04 08:41:29 +02:00 committed by GitHub
commit 37f6ddac2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1983 additions and 653 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,34 @@
#!/usr/bin/env bash
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
WORKING_DIR=${SCRIPT_DIR}/postwhite_tmp
SPFTOOLS_DIR=${WORKING_DIR}/spf-tools
POSTWHITE_DIR=${WORKING_DIR}/postwhite
POSTWHITE_CONF=${POSTWHITE_DIR}/postwhite.conf
COSTOM_HOSTS="web.de gmx.net mail.de freenet.de arcor.de unity-mail.de"
STATIC_HOSTS=(
"194.25.134.0/24 permit # t-online.de"
)
mkdir ${SCRIPT_DIR}/postwhite_tmp
git clone https://github.com/spf-tools/spf-tools.git ${SPFTOOLS_DIR}
git clone https://github.com/stevejenkins/postwhite.git ${POSTWHITE_DIR}
function set_config() {
sudo sed -i "s@^\($1\s*=\s*\).*\$@\1$2@" ${POSTWHITE_CONF}
}
set_config custom_hosts ${COSTOM_HOSTS}
set_config reload_postfix no
set_config postfixpath /.
set_config spftoolspath ${WORKING_DIR}/spf-tools
set_config whitelist .${SCRIPT_DIR}/../data/conf/postfix/postscreen_access.cidr
set_config yahoo_static_hosts ${POSTWHITE_DIR}/yahoo_static_hosts.txt
cd ${POSTWHITE_DIR}
./postwhite ${POSTWHITE_CONF}
( IFS=$'\n'; echo "${STATIC_HOSTS[*]}" >> "${SCRIPT_DIR}/../data/conf/postfix/postscreen_access.cidr")
rm -r ${WORKING_DIR}