[Dovecot] Dovecot 1.2, problem with SQL quota and mail aliases
Hello,
I have a small server running dovecot 1.2 (still not balsy enough to switch to 2.0 - virtual sql accounts, managesieve etc.). There are no local users - only ones defined in the SQL database, and everything else (including quota) is defined in SQL db too. Dovecot is used as IMAP daemon, and dovecot-lda is responsible for delivery (in order to make use of sieve and managesieve). I know that my configuration might be a bit ancient, but this is not referring to any bug (at least I think so) and rather to errors I've made in configuration.
Several users have reported, that they are running out of quota even though their mailboxes are empty. I thought these were some single cases, but recently I discovered that this situation occurs when:
- user john@domain.com has a mail alias, eg. john.smith@domain.com
- he logs in to the imap account (using MUA or webmail) using his alias (john.smith@domain.com).
In effect, all incoming emails for john@domain.com are increasing the counters (both "bytes" and "messages"), but since user logs in using john.smith@domain.com - anything he deletes from the mailbox decreases the records for john.smith@domain.com. Finally, John has two records:
+---------------------------+-----------+----------+ | username | bytes | messages | +---------------------------+-----------+----------+ | john.smith@domain.com | -5488133 | -13 | | john@domain.com | 341411029 | 1111 | +---------------------------+-----------+----------+
The record for john@domain.com finaly reaches the quota limit - and even removing all emails does not help.
My /etc/dovecot/dovecot-dict-quota.conf looks like this:
map { pattern = priv/quota/storage table = quota username_field = username value_field = bytes } map { pattern = priv/quota/messages table = quota username_field = username value_field = messages }
And my question is: what is used as "username"? Always the username given wher user logs in? Is there a way to provide some dictionary to translate all aliases to the real username?
Best regards,
Jacek Osiecki joshua@ceti.pl GG:3828944 I don't want something I need. I want something I want.
On Thu, 2011-02-17 at 14:10 +0100, Jacek Osiecki wrote:
And my question is: what is used as "username"? Always the username given wher user logs in? Is there a way to provide some dictionary to translate all aliases to the real username?
Username should uniquely identify the user's mailbox. Since the mails for john@ and john.smith@ are being delivered to the same directory, I guess you already have some kind of a mapping telling this to Dovecot..
Basically you just need to standardize the username to either one of them and have password_query and user_query return "user" field for that username.
On Tue, 22 Feb 2011, Timo Sirainen wrote:
On Thu, 2011-02-17 at 14:10 +0100, Jacek Osiecki wrote:
And my question is: what is used as "username"? Always the username given wher user logs in? Is there a way to provide some dictionary to translate all aliases to the real username? Username should uniquely identify the user's mailbox. Since the mails for john@ and john.smith@ are being delivered to the same directory, I guess you already have some kind of a mapping telling this to Dovecot..
Yes, user_query returns mail, uid, gid, system_user, quota_rule, home - always the same for any kind of alias (user alias, domain alias).
Basically you just need to standardize the username to either one of them and have password_query and user_query return "user" field for that username.
OK, I've added "user" to both queries. I've checked - and yes, it works perfectly now :) Thank you!
By the way:
Best regards,
Jacek Osiecki joshua@ceti.pl GG:3828944 I don't want something I need. I want something I want.
I have the same problem but with LDAP, how to fix this on LDAP backed?
scope = subtree deref = never pass_attrs = userPassword=password base = ou=accounts,dc=globalnet,dc=hr user_filter = (&(|(objectClass=qmailUser)(objectClass=mailUser))(accountService=mail)(accountService=%Ls%Lc)(|(mail=%u)(mailAlternateAddress=%u))) pass_filter = (&(|(objectClass=qmailUser)(objectClass=mailUser))(accountService=mail)(accountService=%Ls%Lc)(|(mail=%u)(mailAlternateAddress=%u))) pass_attrs = userPassword=password default_pass_scheme = MD5 user_attrs = homeDirectory=home,mailQuotaSize=quota_rule=*:bytes=%$
Jacek Osiecki wrote:
Hello,
I have a small server running dovecot 1.2 (still not balsy enough to switch to 2.0 - virtual sql accounts, managesieve etc.). There are no local users - only ones defined in the SQL database, and everything else (including quota) is defined in SQL db too. Dovecot is used as IMAP daemon, and dovecot-lda is responsible for delivery (in order to make use of sieve and managesieve). I know that my configuration might be a bit ancient, but this is not referring to any bug (at least I think so) and rather to errors I've made in configuration.
Several users have reported, that they are running out of quota even though their mailboxes are empty. I thought these were some single cases, but recently I discovered that this situation occurs when:
- user john@domain.com has a mail alias, eg. john.smith@domain.com
- he logs in to the imap account (using MUA or webmail) using his alias (john.smith@domain.com).
In effect, all incoming emails for john@domain.com are increasing the counters (both "bytes" and "messages"), but since user logs in using john.smith@domain.com - anything he deletes from the mailbox decreases the records for john.smith@domain.com. Finally, John has two records:
+---------------------------+-----------+----------+ | username | bytes | messages | +---------------------------+-----------+----------+ | john.smith@domain.com | -5488133 | -13 | | john@domain.com | 341411029 | 1111 | +---------------------------+-----------+----------+
The record for john@domain.com finaly reaches the quota limit - and even removing all emails does not help.
My /etc/dovecot/dovecot-dict-quota.conf looks like this:
map { pattern = priv/quota/storage table = quota username_field = username value_field = bytes } map { pattern = priv/quota/messages table = quota username_field = username value_field = messages }
And my question is: what is used as "username"? Always the username given wher user logs in? Is there a way to provide some dictionary to translate all aliases to the real username?
Best regards,
Jacek Osiecki joshua@ceti.pl GG:3828944 I don't want something I need. I want something I want.
-- View this message in context: http://old.nabble.com/Dovecot-1.2%2C-problem-with-SQL-quota-and-mail-aliases... Sent from the Dovecot mailing list archive at Nabble.com.
SOLVED add mail=user in user_attrs
user_attrs = mail=user,homeDirectory=home,mailQuotaSize=quota_rule=*:bytes=%$
Tomislav Mihalicek wrote:
I have the same problem but with LDAP, how to fix this on LDAP backed?
scope = subtree deref = never pass_attrs = userPassword=password base = ou=accounts,dc=globalnet,dc=hr user_filter = (&(|(objectClass=qmailUser)(objectClass=mailUser))(accountService=mail)(accountService=%Ls%Lc)(|(mail=%u)(mailAlternateAddress=%u))) pass_filter = (&(|(objectClass=qmailUser)(objectClass=mailUser))(accountService=mail)(accountService=%Ls%Lc)(|(mail=%u)(mailAlternateAddress=%u))) pass_attrs = userPassword=password default_pass_scheme = MD5 user_attrs = homeDirectory=home,mailQuotaSize=quota_rule=*:bytes=%$
Jacek Osiecki wrote:
Hello,
I have a small server running dovecot 1.2 (still not balsy enough to switch to 2.0 - virtual sql accounts, managesieve etc.). There are no local users - only ones defined in the SQL database, and everything else (including quota) is defined in SQL db too. Dovecot is used as IMAP daemon, and dovecot-lda is responsible for delivery (in order to make use of sieve and managesieve). I know that my configuration might be a bit ancient, but this is not referring to any bug (at least I think so) and rather to errors I've made in configuration.
Several users have reported, that they are running out of quota even though their mailboxes are empty. I thought these were some single cases, but recently I discovered that this situation occurs when:
- user john@domain.com has a mail alias, eg. john.smith@domain.com
- he logs in to the imap account (using MUA or webmail) using his alias (john.smith@domain.com).
In effect, all incoming emails for john@domain.com are increasing the counters (both "bytes" and "messages"), but since user logs in using john.smith@domain.com - anything he deletes from the mailbox decreases the records for john.smith@domain.com. Finally, John has two records:
+---------------------------+-----------+----------+ | username | bytes | messages | +---------------------------+-----------+----------+ | john.smith@domain.com | -5488133 | -13 | | john@domain.com | 341411029 | 1111 | +---------------------------+-----------+----------+
The record for john@domain.com finaly reaches the quota limit - and even removing all emails does not help.
My /etc/dovecot/dovecot-dict-quota.conf looks like this:
map { pattern = priv/quota/storage table = quota username_field = username value_field = bytes } map { pattern = priv/quota/messages table = quota username_field = username value_field = messages }
And my question is: what is used as "username"? Always the username given wher user logs in? Is there a way to provide some dictionary to translate all aliases to the real username?
Best regards,
Jacek Osiecki joshua@ceti.pl GG:3828944 I don't want something I need. I want something I want.
-- View this message in context: http://old.nabble.com/Dovecot-1.2%2C-problem-with-SQL-quota-and-mail-aliases... Sent from the Dovecot mailing list archive at Nabble.com.
participants (3)
-
Jacek Osiecki
-
Timo Sirainen
-
Tomislav Mihalicek