mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2024-01-19 02:48:50 +00:00
minor adjustments before release 8.0.0
This commit is contained in:
parent
18544e6453
commit
cc7138e28f
4
setup.sh
4
setup.sh
|
@ -44,7 +44,7 @@ _get_current_directory
|
||||||
CRI=
|
CRI=
|
||||||
INFO=
|
INFO=
|
||||||
IMAGE_NAME=
|
IMAGE_NAME=
|
||||||
CONTAINER_NAME='mail'
|
CONTAINER_NAME=
|
||||||
DEFAULT_CONFIG_PATH="${CDIR}/config"
|
DEFAULT_CONFIG_PATH="${CDIR}/config"
|
||||||
USE_CONTAINER=false
|
USE_CONTAINER=false
|
||||||
WISHED_CONFIG_PATH=
|
WISHED_CONFIG_PATH=
|
||||||
|
@ -105,7 +105,7 @@ OPTIONS:
|
||||||
|
|
||||||
-i IMAGE_NAME The name of the docker-mailserver image
|
-i IMAGE_NAME The name of the docker-mailserver image
|
||||||
The default value is
|
The default value is
|
||||||
'docker.io/mailserver/docker-maiserver:latest'
|
'docker.io/mailserver/docker-mailserver:latest'
|
||||||
|
|
||||||
-c CONTAINER_NAME The name of the running container.
|
-c CONTAINER_NAME The name of the running container.
|
||||||
|
|
||||||
|
|
|
@ -2,38 +2,38 @@
|
||||||
|
|
||||||
touch /tmp/vhost.tmp
|
touch /tmp/vhost.tmp
|
||||||
|
|
||||||
# if no keysize is provided, 2048 is default.
|
# if no keysize is provided, default to 4096
|
||||||
KEYSIZE=${1:-4096}
|
KEYSIZE=${1:-4096}
|
||||||
# optional domain names
|
# optional domain names
|
||||||
DOMAINS=${2:-}
|
DOMAINS=${2:-}
|
||||||
|
|
||||||
if [[ -z ${DOMAINS} ]]
|
if [[ -z ${DOMAINS} ]]
|
||||||
then
|
then
|
||||||
# getting domains FROM mail accounts
|
# getting domains FROM mail accounts
|
||||||
if [[ -f /tmp/docker-mailserver/postfix-accounts.cf ]]
|
if [[ -f /tmp/docker-mailserver/postfix-accounts.cf ]]
|
||||||
then
|
then
|
||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
while IFS=$'|' read -r LOGIN PASS
|
while IFS=$'|' read -r LOGIN PASS
|
||||||
do
|
do
|
||||||
DOMAIN=$(echo "${LOGIN}" | cut -d @ -f2)
|
DOMAIN=$(echo "${LOGIN}" | cut -d @ -f2)
|
||||||
echo "${DOMAIN}" >>/tmp/vhost.tmp
|
echo "${DOMAIN}" >>/tmp/vhost.tmp
|
||||||
done < <(grep -v "^\s*$\|^\s*\#" /tmp/docker-mailserver/postfix-accounts.cf || true)
|
done < <(grep -v "^\s*$\|^\s*\#" /tmp/docker-mailserver/postfix-accounts.cf || true)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Getting domains FROM mail aliases
|
# getting domains FROM mail aliases
|
||||||
if [[ -f /tmp/docker-mailserver/postfix-virtual.cf ]]
|
if [[ -f /tmp/docker-mailserver/postfix-virtual.cf ]]
|
||||||
then
|
then
|
||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
while read -r FROM TO
|
while read -r FROM TO
|
||||||
do
|
do
|
||||||
UNAME=$(echo "${FROM}" | cut -d @ -f1)
|
UNAME=$(echo "${FROM}" | cut -d @ -f1)
|
||||||
DOMAIN=$(echo "${FROM}" | cut -d @ -f2)
|
DOMAIN=$(echo "${FROM}" | cut -d @ -f2)
|
||||||
|
|
||||||
test "${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)
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
tr ',' '\n' <<<"${DOMAINS}" > /tmp/vhost.tmp
|
tr ',' '\n' <<< "${DOMAINS}" > /tmp/vhost.tmp
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# keeping unique entries
|
# keeping unique entries
|
||||||
|
|
|
@ -1184,7 +1184,6 @@ EOF
|
||||||
assert_success
|
assert_success
|
||||||
run docker exec mail /bin/sh -c "nc 0.0.0.0 25 < /tmp/docker-mailserver-test/email-templates/quota-exceeded.txt"
|
run docker exec mail /bin/sh -c "nc 0.0.0.0 25 < /tmp/docker-mailserver-test/email-templates/quota-exceeded.txt"
|
||||||
assert_success
|
assert_success
|
||||||
|
|
||||||
# check for quota warn message existence
|
# check for quota warn message existence
|
||||||
run repeat_until_success_or_timeout 20 sh -c "docker exec mail sh -c 'grep \"Subject: quota warning\" /var/mail/otherdomain.tld/quotauser/new/ -R'"
|
run repeat_until_success_or_timeout 20 sh -c "docker exec mail sh -c 'grep \"Subject: quota warning\" /var/mail/otherdomain.tld/quotauser/new/ -R'"
|
||||||
assert_success
|
assert_success
|
||||||
|
@ -1192,7 +1191,6 @@ EOF
|
||||||
run repeat_until_success_or_timeout 20 sh -c "docker logs mail | grep 'Quota exceeded (mailbox for user is full)'"
|
run repeat_until_success_or_timeout 20 sh -c "docker logs mail | grep 'Quota exceeded (mailbox for user is full)'"
|
||||||
assert_success
|
assert_success
|
||||||
|
|
||||||
docker exec mail ls -l '/var/mail/otherdomain.tld/quotauser/new/'
|
|
||||||
# ensure only the first big message and the warn message are present (other messages are rejected: mailbox is full)
|
# ensure only the first big message and the warn message are present (other messages are rejected: mailbox is full)
|
||||||
run docker exec mail sh -c 'ls /var/mail/otherdomain.tld/quotauser/new/ | wc -l'
|
run docker exec mail sh -c 'ls /var/mail/otherdomain.tld/quotauser/new/ | wc -l'
|
||||||
assert_success
|
assert_success
|
||||||
|
|
Loading…
Reference in a new issue