[Dovecot] Quota with dict backend - sql does not get registered
David Jonas
djonas at vitalwerks.com
Wed Aug 2 03:23:13 EEST 2006
On Mon, 2006-07-31 at 16:17 -0700, David Jonas wrote:
> On Mon, 2006-07-31 at 22:43 +0300, Timo Sirainen wrote:
[snip]
> Cool, thanks Tim. I tried the proxy before but was getting funny
> results. So now I've focused my efforts on working those out. I've come
> across some interesting stuff.
Sorry I wrote your name wrong, Timo. Won't happen again.
[snip]
> Also, as a side note, I changed my mail_log_prefix to "%Us(%u@%d): " yet
> I don't ever see the domain portion. This also happens in the quota
> plugin. The user gets set to just the part before the @.
Just wanted to say that this was a configuration problem and I wanted to
state how and why so others don't have the same problem.
Dovecot sets the username to what it exactly is in the database, or
password file, etc. This probably isn't a problem with most lookups, but
with the versatility of the SQL backend you can get yourself into
trouble like I did. My query was like this:
SELECT user, password, target AS userdb_home, 89 AS userdb_uid, 89 AS
userdb_gid FROM accounts WHERE class='pop' AND domain='%d' AND user='%n'
As you can see domain and user are two different fields. So I was
getting just the user part of the username set by dovecot. The query
should have been:
SELECT CONCAT(user,'@',domain) AS user, password, target AS userdb_home,
89 AS userdb_uid, 89 AS userdb_gid FROM accounts WHERE class='pop' AND
domain='%d' AND user='%n'
Then things like the quota plugin will have the full username to work
with and variable expansion will work were it's needed.
[snip]
More information about the dovecot
mailing list