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
|
||||
VERSION_EXISTS=$(jq --arg version "${MAJOR_MINOR}" '[.[].version == $version] | any' "${VERSIONS_JSON}")
|
||||
|
||||
if [[ "${VERSION_EXISTS}" == "true" ]]
|
||||
if [[ ${VERSION_EXISTS} == "true" ]]
|
||||
then
|
||||
echo "${MAJOR_MINOR} docs are already supported. Nothing to change, exiting.."
|
||||
exit 1
|
||||
|
|
|
@ -139,7 +139,7 @@ function _setup_postfix_aliases
|
|||
DOMAIN=$(echo "${FROM}" | cut -d @ -f2)
|
||||
|
||||
# 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)
|
||||
else
|
||||
_notify 'inf' "Warning '/tmp/docker-mailserver/postfix-virtual.cf' is not provided. No mail alias/forward created."
|
||||
|
|
|
@ -40,7 +40,7 @@ shift
|
|||
PASSWD="${*}"
|
||||
|
||||
[[ -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}"
|
||||
create_lock # Protect config file with lock to avoid race conditions
|
||||
|
|
|
@ -13,7 +13,7 @@ function __usage { echo "Usage: delquota <username@domain>" ; }
|
|||
USER="${1}"
|
||||
|
||||
[[ -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}"
|
||||
then
|
||||
|
|
|
@ -64,7 +64,7 @@ else
|
|||
do
|
||||
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
|
||||
|
||||
else
|
||||
|
|
|
@ -26,7 +26,7 @@ while read -r LINE
|
|||
do
|
||||
USER=$(echo "${LINE}" | cut -d'|' -f1)
|
||||
|
||||
if [[ "${ENABLE_QUOTAS}" -eq 1 ]]
|
||||
if [[ ${ENABLE_QUOTAS} -eq 1 ]]
|
||||
then
|
||||
# ${QUOTA[0]} => current size
|
||||
# ${QUOTA[1]} => configured size limit
|
||||
|
|
|
@ -18,7 +18,7 @@ QUOTA="${*}"
|
|||
function usage { echo "Usage: setquota <user@domain> [<quota>]" ; }
|
||||
|
||||
[[ -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}"
|
||||
then
|
||||
|
|
|
@ -189,7 +189,7 @@ export -f _extract_certs_from_acme
|
|||
|
||||
# Remove the `*.` prefix if it exists, else returns the input value
|
||||
function _strip_wildcard_prefix {
|
||||
[[ "${1}" == "*."* ]] && echo "${1:2}" || echo "${1}"
|
||||
[[ ${1} == "*."* ]] && echo "${1:2}" || echo "${1}"
|
||||
}
|
||||
|
||||
# ? --------------------------------------------- Notifications
|
||||
|
|
|
@ -383,7 +383,7 @@ function _setup_ldap
|
|||
|
||||
# Add protocol to DOVECOT_URIS so that we can use dovecot's "uris" option:
|
||||
# https://doc.dovecot.org/configuration_manual/authentication/ldap/
|
||||
if [[ "${DOVECOT_LDAP_MAPPING["DOVECOT_URIS"]}" != *'://'* ]]
|
||||
if [[ ${DOVECOT_LDAP_MAPPING["DOVECOT_URIS"]} != *'://'* ]]
|
||||
then
|
||||
DOVECOT_LDAP_MAPPING["DOVECOT_URIS"]="ldap://${DOVECOT_LDAP_MAPPING["DOVECOT_URIS"]}"
|
||||
fi
|
||||
|
@ -562,7 +562,7 @@ function _setup_saslauthd
|
|||
[[ -z ${SASLAUTHD_LDAP_PASSWORD} ]] && SASLAUTHD_LDAP_PASSWORD="${LDAP_BIND_PW}"
|
||||
[[ -z ${SASLAUTHD_LDAP_SEARCH_BASE} ]] && SASLAUTHD_LDAP_SEARCH_BASE="${LDAP_SEARCH_BASE}"
|
||||
|
||||
if [[ "${SASLAUTHD_LDAP_SERVER}" != *'://'* ]]
|
||||
if [[ ${SASLAUTHD_LDAP_SERVER} != *'://'* ]]
|
||||
then
|
||||
SASLAUTHD_LDAP_SERVER="ldap://${SASLAUTHD_LDAP_SERVER}"
|
||||
fi
|
||||
|
|
|
@ -96,7 +96,7 @@ function teardown_file() {
|
|||
'exec 3<>/dev/tcp/${MAIL_FAIL2BAN_IP}/25 && \
|
||||
while IFS= read -r cmd; do \
|
||||
head -1 <&3; \
|
||||
[[ "${cmd}" == "EHLO"* ]] && sleep 6; \
|
||||
[[ ${cmd} == "EHLO"* ]] && sleep 6; \
|
||||
echo ${cmd} >&3; \
|
||||
done < "/tmp/docker-mailserver-test/auth/smtp-auth-login-wrong.txt"'
|
||||
done
|
||||
|
|
|
@ -51,7 +51,7 @@ teardown_file() {
|
|||
'exec 3<>/dev/tcp/'"${MAIL_POSTSCREEN_IP}"'/25 && \
|
||||
while IFS= read -r cmd; do \
|
||||
head -1 <&3; \
|
||||
[[ "${cmd}" == "EHLO"* ]] && sleep 6; \
|
||||
[[ ${cmd} == "EHLO"* ]] && sleep 6; \
|
||||
echo ${cmd} >&3; \
|
||||
done < "/tmp/docker-mailserver-test/auth/smtp-auth-login.txt"'
|
||||
done
|
||||
|
|
|
@ -171,7 +171,7 @@ function check_cipherlists() {
|
|||
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.
|
||||
if [[ "${TLS_LEVEL}" == "intermediate" ]]
|
||||
if [[ ${TLS_LEVEL} == "intermediate" ]]
|
||||
then
|
||||
compare_cipherlist "cipherorder_TLSv1" "${RESULTS_FILE}" "$(get_cipherlist "TLSv1${p25}")"
|
||||
compare_cipherlist "cipherorder_TLSv1_1" "${RESULTS_FILE}" "$(get_cipherlist "TLSv1_1${p25}")"
|
||||
|
@ -187,7 +187,7 @@ function check_cipherlists() {
|
|||
function get_cipherlist() {
|
||||
local TLS_VERSION=$1
|
||||
|
||||
if [[ "${TLS_VERSION}" == "TLSv1_3" ]]
|
||||
if [[ ${TLS_VERSION} == "TLSv1_3" ]]
|
||||
then
|
||||
# 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.
|
||||
|
|
Loading…
Reference in a new issue