mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2024-01-19 02:48:50 +00:00
Remove quotes to meet style guidelines (#2330)
Co-authored-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
This commit is contained in:
parent
bdb770a0aa
commit
d46e094280
|
@ -33,7 +33,7 @@ function _update_versions_json
|
||||||
local VERSION_EXISTS
|
local VERSION_EXISTS
|
||||||
VERSION_EXISTS=$(jq --arg version "${MAJOR_MINOR}" '[.[].version == $version] | any' "${VERSIONS_JSON}")
|
VERSION_EXISTS=$(jq --arg version "${MAJOR_MINOR}" '[.[].version == $version] | any' "${VERSIONS_JSON}")
|
||||||
|
|
||||||
if [[ "${VERSION_EXISTS}" == "true" ]]
|
if [[ ${VERSION_EXISTS} == "true" ]]
|
||||||
then
|
then
|
||||||
echo "${MAJOR_MINOR} docs are already supported. Nothing to change, exiting.."
|
echo "${MAJOR_MINOR} docs are already supported. Nothing to change, exiting.."
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
@ -139,7 +139,7 @@ function _setup_postfix_aliases
|
||||||
DOMAIN=$(echo "${FROM}" | cut -d @ -f2)
|
DOMAIN=$(echo "${FROM}" | cut -d @ -f2)
|
||||||
|
|
||||||
# if they are equal it means the line looks like: "user1 other@example.com"
|
# if they are equal it means the line looks like: "user1 other@example.com"
|
||||||
[[ "${UNAME}" != "${DOMAIN}" ]] && echo "${DOMAIN}" >> /tmp/vhost.tmp
|
[[ ${UNAME} != "${DOMAIN}" ]] && echo "${DOMAIN}" >> /tmp/vhost.tmp
|
||||||
done < <(grep -v "^\s*$\|^\s*\#" /tmp/docker-mailserver/postfix-virtual.cf || true)
|
done < <(grep -v "^\s*$\|^\s*\#" /tmp/docker-mailserver/postfix-virtual.cf || true)
|
||||||
else
|
else
|
||||||
_notify 'inf' "Warning '/tmp/docker-mailserver/postfix-virtual.cf' is not provided. No mail alias/forward created."
|
_notify 'inf' "Warning '/tmp/docker-mailserver/postfix-virtual.cf' is not provided. No mail alias/forward created."
|
||||||
|
|
|
@ -40,7 +40,7 @@ shift
|
||||||
PASSWD="${*}"
|
PASSWD="${*}"
|
||||||
|
|
||||||
[[ -z ${FULL_EMAIL} ]] && { __usage ; errex 'No username specified' ; }
|
[[ -z ${FULL_EMAIL} ]] && { __usage ; errex 'No username specified' ; }
|
||||||
[[ "${FULL_EMAIL}" =~ .*\@.* ]] || { __usage ; errex 'Username must include the domain' ; }
|
[[ ${FULL_EMAIL} =~ .*\@.* ]] || { __usage ; errex 'Username must include the domain' ; }
|
||||||
|
|
||||||
touch "${DATABASE}"
|
touch "${DATABASE}"
|
||||||
create_lock # Protect config file with lock to avoid race conditions
|
create_lock # Protect config file with lock to avoid race conditions
|
||||||
|
|
|
@ -13,7 +13,7 @@ function __usage { echo "Usage: delquota <username@domain>" ; }
|
||||||
USER="${1}"
|
USER="${1}"
|
||||||
|
|
||||||
[[ -z ${USER} ]] && { __usage ; errex "No username specified" ; }
|
[[ -z ${USER} ]] && { __usage ; errex "No username specified" ; }
|
||||||
[[ "${USER}" =~ .*\@.* ]] || { __usage ; errex "Username must include the domain"; }
|
[[ ${USER} =~ .*\@.* ]] || { __usage ; errex "Username must include the domain"; }
|
||||||
|
|
||||||
if ! grep -qE "^${USER}\|" "${USER_DATABASE}"
|
if ! grep -qE "^${USER}\|" "${USER_DATABASE}"
|
||||||
then
|
then
|
||||||
|
|
|
@ -64,7 +64,7 @@ else
|
||||||
do
|
do
|
||||||
RESULT="$(fail2ban-client set "${JAIL}" unbanip "${@}" 2>&1)"
|
RESULT="$(fail2ban-client set "${JAIL}" unbanip "${@}" 2>&1)"
|
||||||
|
|
||||||
[[ "${RESULT}" != *"is not banned"* ]] && [[ "${RESULT}" != *"NOK"* ]] && echo -e "Unbanned IP from ${JAIL}: ${RESULT}"
|
[[ ${RESULT} != *"is not banned"* ]] && [[ ${RESULT} != *"NOK"* ]] && echo -e "Unbanned IP from ${JAIL}: ${RESULT}"
|
||||||
done
|
done
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
|
@ -26,7 +26,7 @@ while read -r LINE
|
||||||
do
|
do
|
||||||
USER=$(echo "${LINE}" | cut -d'|' -f1)
|
USER=$(echo "${LINE}" | cut -d'|' -f1)
|
||||||
|
|
||||||
if [[ "${ENABLE_QUOTAS}" -eq 1 ]]
|
if [[ ${ENABLE_QUOTAS} -eq 1 ]]
|
||||||
then
|
then
|
||||||
# ${QUOTA[0]} => current size
|
# ${QUOTA[0]} => current size
|
||||||
# ${QUOTA[1]} => configured size limit
|
# ${QUOTA[1]} => configured size limit
|
||||||
|
|
|
@ -18,7 +18,7 @@ QUOTA="${*}"
|
||||||
function usage { echo "Usage: setquota <user@domain> [<quota>]" ; }
|
function usage { echo "Usage: setquota <user@domain> [<quota>]" ; }
|
||||||
|
|
||||||
[[ -z ${USER} ]] && { usage ; errex "no username specified" ; }
|
[[ -z ${USER} ]] && { usage ; errex "no username specified" ; }
|
||||||
[[ "${USER}" =~ .*\@.* ]] || { usage ; errex "username must include the domain" ; }
|
[[ ${USER} =~ .*\@.* ]] || { usage ; errex "username must include the domain" ; }
|
||||||
|
|
||||||
if ! grep -qE "^${USER}\|" "${USER_DATABASE}"
|
if ! grep -qE "^${USER}\|" "${USER_DATABASE}"
|
||||||
then
|
then
|
||||||
|
|
|
@ -189,7 +189,7 @@ export -f _extract_certs_from_acme
|
||||||
|
|
||||||
# Remove the `*.` prefix if it exists, else returns the input value
|
# Remove the `*.` prefix if it exists, else returns the input value
|
||||||
function _strip_wildcard_prefix {
|
function _strip_wildcard_prefix {
|
||||||
[[ "${1}" == "*."* ]] && echo "${1:2}" || echo "${1}"
|
[[ ${1} == "*."* ]] && echo "${1:2}" || echo "${1}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# ? --------------------------------------------- Notifications
|
# ? --------------------------------------------- Notifications
|
||||||
|
|
|
@ -383,7 +383,7 @@ function _setup_ldap
|
||||||
|
|
||||||
# Add protocol to DOVECOT_URIS so that we can use dovecot's "uris" option:
|
# Add protocol to DOVECOT_URIS so that we can use dovecot's "uris" option:
|
||||||
# https://doc.dovecot.org/configuration_manual/authentication/ldap/
|
# https://doc.dovecot.org/configuration_manual/authentication/ldap/
|
||||||
if [[ "${DOVECOT_LDAP_MAPPING["DOVECOT_URIS"]}" != *'://'* ]]
|
if [[ ${DOVECOT_LDAP_MAPPING["DOVECOT_URIS"]} != *'://'* ]]
|
||||||
then
|
then
|
||||||
DOVECOT_LDAP_MAPPING["DOVECOT_URIS"]="ldap://${DOVECOT_LDAP_MAPPING["DOVECOT_URIS"]}"
|
DOVECOT_LDAP_MAPPING["DOVECOT_URIS"]="ldap://${DOVECOT_LDAP_MAPPING["DOVECOT_URIS"]}"
|
||||||
fi
|
fi
|
||||||
|
@ -562,7 +562,7 @@ function _setup_saslauthd
|
||||||
[[ -z ${SASLAUTHD_LDAP_PASSWORD} ]] && SASLAUTHD_LDAP_PASSWORD="${LDAP_BIND_PW}"
|
[[ -z ${SASLAUTHD_LDAP_PASSWORD} ]] && SASLAUTHD_LDAP_PASSWORD="${LDAP_BIND_PW}"
|
||||||
[[ -z ${SASLAUTHD_LDAP_SEARCH_BASE} ]] && SASLAUTHD_LDAP_SEARCH_BASE="${LDAP_SEARCH_BASE}"
|
[[ -z ${SASLAUTHD_LDAP_SEARCH_BASE} ]] && SASLAUTHD_LDAP_SEARCH_BASE="${LDAP_SEARCH_BASE}"
|
||||||
|
|
||||||
if [[ "${SASLAUTHD_LDAP_SERVER}" != *'://'* ]]
|
if [[ ${SASLAUTHD_LDAP_SERVER} != *'://'* ]]
|
||||||
then
|
then
|
||||||
SASLAUTHD_LDAP_SERVER="ldap://${SASLAUTHD_LDAP_SERVER}"
|
SASLAUTHD_LDAP_SERVER="ldap://${SASLAUTHD_LDAP_SERVER}"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -96,7 +96,7 @@ function teardown_file() {
|
||||||
'exec 3<>/dev/tcp/${MAIL_FAIL2BAN_IP}/25 && \
|
'exec 3<>/dev/tcp/${MAIL_FAIL2BAN_IP}/25 && \
|
||||||
while IFS= read -r cmd; do \
|
while IFS= read -r cmd; do \
|
||||||
head -1 <&3; \
|
head -1 <&3; \
|
||||||
[[ "${cmd}" == "EHLO"* ]] && sleep 6; \
|
[[ ${cmd} == "EHLO"* ]] && sleep 6; \
|
||||||
echo ${cmd} >&3; \
|
echo ${cmd} >&3; \
|
||||||
done < "/tmp/docker-mailserver-test/auth/smtp-auth-login-wrong.txt"'
|
done < "/tmp/docker-mailserver-test/auth/smtp-auth-login-wrong.txt"'
|
||||||
done
|
done
|
||||||
|
|
|
@ -51,7 +51,7 @@ teardown_file() {
|
||||||
'exec 3<>/dev/tcp/'"${MAIL_POSTSCREEN_IP}"'/25 && \
|
'exec 3<>/dev/tcp/'"${MAIL_POSTSCREEN_IP}"'/25 && \
|
||||||
while IFS= read -r cmd; do \
|
while IFS= read -r cmd; do \
|
||||||
head -1 <&3; \
|
head -1 <&3; \
|
||||||
[[ "${cmd}" == "EHLO"* ]] && sleep 6; \
|
[[ ${cmd} == "EHLO"* ]] && sleep 6; \
|
||||||
echo ${cmd} >&3; \
|
echo ${cmd} >&3; \
|
||||||
done < "/tmp/docker-mailserver-test/auth/smtp-auth-login.txt"'
|
done < "/tmp/docker-mailserver-test/auth/smtp-auth-login.txt"'
|
||||||
done
|
done
|
||||||
|
|
|
@ -171,7 +171,7 @@ function check_cipherlists() {
|
||||||
local p25=$2 # optional suffix
|
local p25=$2 # optional suffix
|
||||||
|
|
||||||
# TLS_LEVEL `modern` doesn't have TLS v1.0 or v1.1 cipher suites. Sets TLS v1.2 as minimum.
|
# TLS_LEVEL `modern` doesn't have TLS v1.0 or v1.1 cipher suites. Sets TLS v1.2 as minimum.
|
||||||
if [[ "${TLS_LEVEL}" == "intermediate" ]]
|
if [[ ${TLS_LEVEL} == "intermediate" ]]
|
||||||
then
|
then
|
||||||
compare_cipherlist "cipherorder_TLSv1" "${RESULTS_FILE}" "$(get_cipherlist "TLSv1${p25}")"
|
compare_cipherlist "cipherorder_TLSv1" "${RESULTS_FILE}" "$(get_cipherlist "TLSv1${p25}")"
|
||||||
compare_cipherlist "cipherorder_TLSv1_1" "${RESULTS_FILE}" "$(get_cipherlist "TLSv1_1${p25}")"
|
compare_cipherlist "cipherorder_TLSv1_1" "${RESULTS_FILE}" "$(get_cipherlist "TLSv1_1${p25}")"
|
||||||
|
@ -187,7 +187,7 @@ function check_cipherlists() {
|
||||||
function get_cipherlist() {
|
function get_cipherlist() {
|
||||||
local TLS_VERSION=$1
|
local TLS_VERSION=$1
|
||||||
|
|
||||||
if [[ "${TLS_VERSION}" == "TLSv1_3" ]]
|
if [[ ${TLS_VERSION} == "TLSv1_3" ]]
|
||||||
then
|
then
|
||||||
# TLS v1.3 cipher suites are not user defineable and not unique to the available certificate(s).
|
# TLS v1.3 cipher suites are not user defineable and not unique to the available certificate(s).
|
||||||
# They do not support server enforced order either.
|
# They do not support server enforced order either.
|
||||||
|
|
Loading…
Reference in a new issue