-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FR] Quota for LDAP account is working #2957
Comments
Waiting for your work, this is the user patches which activates quotas. Big copy/paste from echo 'user-patches.sh starting...'
source /usr/local/bin/helpers/index.sh
_log 'debug' 'Setting up Dovecot quota'
if [[ -f /etc/dovecot/conf.d/90-quota.conf.disab ]]
then
mv /etc/dovecot/conf.d/90-quota.conf.disab /etc/dovecot/conf.d/90-quota.conf
sed -i \
"s|mail_plugins = \$mail_plugins|mail_plugins = \$mail_plugins quota|g" \
/etc/dovecot/conf.d/10-mail.conf
sed -i \
"s|mail_plugins = \$mail_plugins|mail_plugins = \$mail_plugins imap_quota|g" \
/etc/dovecot/conf.d/20-imap.conf
fi
MESSAGE_SIZE_LIMIT_MB=$((POSTFIX_MESSAGE_SIZE_LIMIT / 1000000))
MAILBOX_LIMIT_MB=$((POSTFIX_MAILBOX_SIZE_LIMIT / 1000000))
sed -i \
"s|quota_max_mail_size =.*|quota_max_mail_size = ${MESSAGE_SIZE_LIMIT_MB}$([[ ${MESSAGE_SIZE_LIMIT_MB} -eq 0 ]] && echo "" || echo "M")|g" \
/etc/dovecot/conf.d/90-quota.conf
sed -i \
"s|quota_rule = \*:storage=.*|quota_rule = *:storage=${MAILBOX_LIMIT_MB}$([[ ${MAILBOX_LIMIT_MB} -eq 0 ]] && echo "" || echo "M")|g" \
/etc/dovecot/conf.d/90-quota.conf
if [[ -d /tmp/docker-mailserver ]] && [[ ! -f /tmp/docker-mailserver/dovecot-quotas.cf ]]
then
_log 'trace' "'/tmp/docker-mailserver/dovecot-quotas.cf' is not provided. Using default quotas."
: >/tmp/docker-mailserver/dovecot-quotas.cf
fi
# enable quota policy check in postfix
sed -i \
"s|reject_unknown_recipient_domain, reject_rbl_client zen.spamhaus.org|reject_unknown_recipient_domain, check_policy_service inet:localhost:65265, reject_rbl_client zen.spamhaus.org|g" \
/etc/postfix/main.cf
echo 'user-patches.sh successfully executed' |
Non of the current maintainers is using a LDAP setup. So the chances that someone will pick it up is pretty low. Unless you want to implement this feature yourself, the best solution for now is probably to document it. Feel free to do so, any support is highly appreciated. |
I might be interested to look into this one as I have an LDAP setup running in production |
Hi @Marsu31 |
It does insofar as enabling the policy service of dovecot (see https://github.com/docker-mailserver/docker-mailserver/blob/master/target/dovecot/90-quota.conf#L46) to be used so that postfix does enforce the quota too. Note that I think that removing the check for I also thought about providing a pull request for this but never had time to do so. |
Feature Request
Context
Quota with LDAP configuration.
Is your Feature Request related to a Problem?
Yes. Quota is disabled if LDAP.
Describe the Solution you'd like
Permit quota if LDAP.
Are you going to implement it?
No but ...
What are you going to contribute?? What have you done already?
I tried to configure quota with LDAP and it works :
PostfixBookMailAccount
(for mail attributes)mailQuota
attribute, for example100M
.DOVECOT_USER_ATTRS
:=quota_rule=*:storage=%{ldap:mailQuota}
I tested this configuration sending mail mails which are bigger than quota, they were rejected. Thunderbird detects too the mail box quota.
What you have to do, almost nothing 😉 :
Regards.
The text was updated successfully, but these errors were encountered: