You've already forked docker-mailserver
mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-08-08 23:06:49 +02:00
Support extra user_attributes in accounts configuration (#1792)
This allows you to add for example |userdb_mail=mbox:~/mail:INBOX=~/inbox to the end of an account to have a different mailbox configuration.
This commit is contained in:
@ -711,13 +711,12 @@ function _setup_dovecot_local_user
|
||||
|
||||
# creating users ; 'pass' is encrypted
|
||||
# comments and empty lines are ignored
|
||||
while IFS=$'|' read -r LOGIN PASS
|
||||
while IFS=$'|' read -r LOGIN PASS USER_ATTRIBUTES
|
||||
do
|
||||
# Setting variables for better readability
|
||||
USER=$(echo "${LOGIN}" | cut -d @ -f1)
|
||||
DOMAIN=$(echo "${LOGIN}" | cut -d @ -f2)
|
||||
|
||||
USER_ATTRIBUTES=""
|
||||
# test if user has a defined quota
|
||||
if [[ -f /tmp/docker-mailserver/dovecot-quotas.cf ]]
|
||||
then
|
||||
@ -725,7 +724,7 @@ function _setup_dovecot_local_user
|
||||
IFS=':' ; read -r -a USER_QUOTA < <(grep "${USER}@${DOMAIN}:" -i /tmp/docker-mailserver/dovecot-quotas.cf)
|
||||
unset IFS
|
||||
|
||||
[[ ${#USER_QUOTA[@]} -eq 2 ]] && USER_ATTRIBUTES="${USER_ATTRIBUTES}userdb_quota_rule=*:bytes=${USER_QUOTA[1]}"
|
||||
[[ ${#USER_QUOTA[@]} -eq 2 ]] && USER_ATTRIBUTES="${USER_ATTRIBUTES} userdb_quota_rule=*:bytes=${USER_QUOTA[1]}"
|
||||
fi
|
||||
|
||||
# Let's go!
|
||||
|
Reference in New Issue
Block a user