Moved whitelist ahead of policyd-spf check

This commit is contained in:
myve 2025-03-18 00:16:45 +00:00
commit d3377b860a
5 changed files with 22 additions and 60 deletions

View file

@ -1,14 +1,24 @@
#!/usr/bin/env bash
# Fill in the following variables
appname= #google
proxyurl= #http://webapps.kvm
proxyport= #4000
domain= #www.google.com
mailver= #latest/stable
# Exit on any error
set -e
# Fill in the following variables
appname=${appname} # google
proxyurl=${proxyurl} # http://webapps.kvm
proxyport=${proxyport} # 4000
domain=${domain} # www.google.com
mailver=${mailver} # latest/stable
# Abort if variables are missing
for var in appname proxyurl proxyport domain
do
if [ -z ${!var} ]
then
echo "Variable ${var} does not exist, aborting..."
exit 1
fi
done
# Check for subdomain
if [ $(echo ${domain} | awk -F . '{print $3}') ]
then
@ -19,13 +29,6 @@ else
exit 1
fi
# Variable check
if [ -z ${appname} ] || [ -z ${proxyurl} ] || [ -z ${proxyport} ] || [ -z ${domain} ]
then
echo "Missing variable, exiting..."
exit 1
fi
# Figure out nginx conf directory
if grep -q 'include.*conf.d' /etc/nginx/nginx.conf
then
@ -133,7 +136,7 @@ MYVEMAIL_PORT=${proxyport}
# Optional
# Version: latest or stable (defaults to latest)
MYVEMAIL_VERSION=${mailver}
MYVEMAIL_VERSION=${mailver:-latest}
# Additional mail domains separated by commas
MYVEMAIL_ADDMX=