tests(refactor): Revise ENV test cases for max mailbox and message sizes
This commit is contained in:
parent
1def2966b6
commit
dcf1d7511b
|
@ -220,9 +220,9 @@ Provide any valid URI. Examples:
|
||||||
- `lmtps:inet:<host>:<port>` (secure lmtp with starttls)
|
- `lmtps:inet:<host>:<port>` (secure lmtp with starttls)
|
||||||
- `lmtp:<kopano-host>:2003` (use kopano as mailstore)
|
- `lmtp:<kopano-host>:2003` (use kopano as mailstore)
|
||||||
|
|
||||||
##### POSTFIX\_MAILBOX\_SIZE\_LIMIT
|
##### POSTFIX_MAILBOX_SIZE_LIMIT
|
||||||
|
|
||||||
Set the mailbox size limit for all users. If set to zero, the size will be unlimited (default).
|
Set the mailbox size limit for all users. If set to zero, the size will be unlimited (default). Size is in bytes.
|
||||||
|
|
||||||
- **empty** => 0 (no limit)
|
- **empty** => 0 (no limit)
|
||||||
|
|
||||||
|
@ -233,9 +233,9 @@ Set the mailbox size limit for all users. If set to zero, the size will be unlim
|
||||||
|
|
||||||
See [mailbox quota][docs-accounts].
|
See [mailbox quota][docs-accounts].
|
||||||
|
|
||||||
##### POSTFIX\_MESSAGE\_SIZE\_LIMIT
|
##### POSTFIX_MESSAGE_SIZE_LIMIT
|
||||||
|
|
||||||
Set the message size limit for all users. If set to zero, the size will be unlimited (not recommended!)
|
Set the message size limit for all users. If set to zero, the size will be unlimited (not recommended!). Size is in bytes.
|
||||||
|
|
||||||
- **empty** => 10240000 (~10 MB)
|
- **empty** => 10240000 (~10 MB)
|
||||||
|
|
||||||
|
|
|
@ -195,7 +195,7 @@ VIRUSMAILS_DELETE_DELAY=
|
||||||
# `lmtp:<kopano-host>:2003` (use kopano as mailstore)
|
# `lmtp:<kopano-host>:2003` (use kopano as mailstore)
|
||||||
POSTFIX_DAGENT=
|
POSTFIX_DAGENT=
|
||||||
|
|
||||||
# Set the mailbox size limit for all users. If set to zero, the size will be unlimited (default).
|
# Set the mailbox size limit for all users. If set to zero, the size will be unlimited (default). Size is in bytes.
|
||||||
#
|
#
|
||||||
# empty => 0
|
# empty => 0
|
||||||
POSTFIX_MAILBOX_SIZE_LIMIT=
|
POSTFIX_MAILBOX_SIZE_LIMIT=
|
||||||
|
@ -205,7 +205,7 @@ POSTFIX_MAILBOX_SIZE_LIMIT=
|
||||||
# 1 => Dovecot quota is enabled
|
# 1 => Dovecot quota is enabled
|
||||||
ENABLE_QUOTAS=1
|
ENABLE_QUOTAS=1
|
||||||
|
|
||||||
# Set the message size limit for all users. If set to zero, the size will be unlimited (not recommended!)
|
# Set the message size limit for all users. If set to zero, the size will be unlimited (not recommended!). Size is in bytes.
|
||||||
#
|
#
|
||||||
# empty => 10240000 (~10 MB)
|
# empty => 10240000 (~10 MB)
|
||||||
POSTFIX_MESSAGE_SIZE_LIMIT=
|
POSTFIX_MESSAGE_SIZE_LIMIT=
|
||||||
|
|
|
@ -114,38 +114,40 @@ function teardown_file() { _default_teardown ; }
|
||||||
assert_output --partial 'check_policy_service inet:localhost:65265'
|
assert_output --partial 'check_policy_service inet:localhost:65265'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test '(ENV POSTFIX_MAILBOX_SIZE_LIMIT) should be configured for both Postfix and Dovecot' {
|
||||||
|
local MAILBOX_SIZE_POSTFIX MAILBOX_SIZE_DOVECOT MAILBOX_SIZE_POSTFIX_MB MAILBOX_SIZE_DOVECOT_MB
|
||||||
|
|
||||||
@test '(mailbox max size) should be equal for both Postfix and Dovecot' {
|
MAILBOX_SIZE_POSTFIX=$(_exec_in_container postconf -h mailbox_size_limit)
|
||||||
postfix_mailbox_size=$(_exec_in_container_bash "postconf | grep -Po '(?<=mailbox_size_limit = )[0-9]+'")
|
run echo "${MAILBOX_SIZE_POSTFIX}"
|
||||||
run echo "${postfix_mailbox_size}"
|
|
||||||
refute_output ""
|
refute_output ""
|
||||||
|
|
||||||
# dovecot relies on virtual_mailbox_size by default
|
# Dovecot mailbox is sized by `virtual_mailbox_size` from Postfix:
|
||||||
postfix_virtual_mailbox_size=$(_exec_in_container_bash "postconf | grep -Po '(?<=virtual_mailbox_limit = )[0-9]+'")
|
MAILBOX_SIZE_DOVECOT=$(_exec_in_container postconf -h virtual_mailbox_limit)
|
||||||
assert_equal "${postfix_virtual_mailbox_size}" "${postfix_mailbox_size}"
|
assert_equal "${MAILBOX_SIZE_DOVECOT}" "${MAILBOX_SIZE_POSTFIX}"
|
||||||
|
|
||||||
postfix_mailbox_size_mb=$(( postfix_mailbox_size / 1000000))
|
# Quota support:
|
||||||
|
MAILBOX_SIZE_POSTFIX_MB=$(( MAILBOX_SIZE_POSTFIX / 1000000))
|
||||||
dovecot_mailbox_size_mb=$(_exec_in_container_bash "doveconf | grep -oP '(?<=quota_rule \= \*\:storage=)[0-9]+'")
|
MAILBOX_SIZE_DOVECOT_MB=$(_exec_in_container_bash 'doveconf -h plugin/quota_rule | grep -oE "[0-9]+"')
|
||||||
run echo "${dovecot_mailbox_size_mb}"
|
run echo "${MAILBOX_SIZE_DOVECOT_MB}"
|
||||||
refute_output ""
|
refute_output ""
|
||||||
|
|
||||||
assert_equal "${postfix_mailbox_size_mb}" "${dovecot_mailbox_size_mb}"
|
assert_equal "${MAILBOX_SIZE_POSTFIX_MB}" "${MAILBOX_SIZE_DOVECOT_MB}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test '(ENV POSTFIX_MESSAGE_SIZE_LIMIT) should be configured for both Postfix and Dovecot' {
|
||||||
|
local MESSAGE_SIZE_POSTFIX MESSAGE_SIZE_POSTFIX_MB MESSAGE_SIZE_DOVECOT_MB
|
||||||
|
|
||||||
@test '(message max size) should be equal for both Postfix and Dovecot' {
|
MESSAGE_SIZE_POSTFIX=$(_exec_in_container postconf -h message_size_limit)
|
||||||
postfix_message_size=$(_exec_in_container_bash "postconf | grep -Po '(?<=message_size_limit = )[0-9]+'")
|
run echo "${MESSAGE_SIZE_POSTFIX}"
|
||||||
run echo "${postfix_message_size}"
|
|
||||||
refute_output ""
|
refute_output ""
|
||||||
|
|
||||||
postfix_message_size_mb=$(( postfix_message_size / 1000000))
|
# Quota support:
|
||||||
|
MESSAGE_SIZE_POSTFIX_MB=$(( MESSAGE_SIZE_POSTFIX / 1000000))
|
||||||
dovecot_message_size_mb=$(_exec_in_container_bash "doveconf | grep -oP '(?<=quota_max_mail_size = )[0-9]+'")
|
MESSAGE_SIZE_DOVECOT_MB=$(_exec_in_container_bash 'doveconf -h plugin/quota_max_mail_size | grep -oE "[0-9]+"')
|
||||||
run echo "${dovecot_message_size_mb}"
|
run echo "${MESSAGE_SIZE_DOVECOT_MB}"
|
||||||
refute_output ""
|
refute_output ""
|
||||||
|
|
||||||
assert_equal "${postfix_message_size_mb}" "${dovecot_message_size_mb}"
|
assert_equal "${MESSAGE_SIZE_POSTFIX_MB}" "${MESSAGE_SIZE_DOVECOT_MB}"
|
||||||
}
|
}
|
||||||
|
|
||||||
@test 'Deleting an mailbox account should also remove that account from dovecot-quotas.cf' {
|
@test 'Deleting an mailbox account should also remove that account from dovecot-quotas.cf' {
|
||||||
|
|
Loading…
Reference in New Issue