home from SQL

Steffen Kaiser skdovecot at smail.inf.fh-brs.de
Tue Sep 30 14:37:48 UTC 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue, 30 Sep 2014, Ralf Hildebrandt wrote:

> Currently I'm using
> user_query = SELECT 1000 AS uid, 1000 AS gid, '/srv/vmail/%2.256Hu/%Lu' AS home, ...
>
> so I'm hashing based on %u (basically). But in my SQL db I have a
> "unique_identifier" field, which never changes, even when the user is
> changing his/her email address (due to marriage or the like).
>
> What I'd really like to do is to use %u to find the value of the
> unique_identifier field, hash THAT value and use "AS home". But how?

Dovecot cannot help you to hash that value, but if you use a SQL server, 
you can create a function, which tranforms the unique_identifier into any 
string you like. Then use

user_query = SELECT 1000 AS uid, 1000 AS gid, toHomeDir(unique_identifier) 
AS home, ...

- -- 
Steffen Kaiser
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQEVAwUBVCrAPXz1H7kL/d9rAQLcGgf/a9ok9TVEscjoyGhuLEpF1RlyG1EhQO+B
in5mseexWUPdOhcK/BFkc2FasuAaW8kQ7E+tnRY3h76MQn61c//soATMDI+iJx8X
wNVzBRu2YgcISwwfALIQmcVHN3mIbem327Z5nKX+bXYnfoDFvcSAdTohM2YFSw+A
xO/oCucW2Kgtv1rQQ1AL88N86VJLTGhx+uowLGrOPTX8Q1zgzH97ii+Ujki+dtnF
AWYLaH8lH//DE4jiqmBLQW6flhXM0xeOYa10oAhkLA2WS8I9GVbuBE4TpYc0OiLt
IqtmOmRr4ZJkAuKWEIiVOnksAWWK/vLZZeEJGE/E3No/iKE8QA+0DA==
=z4O7
-----END PGP SIGNATURE-----


More information about the dovecot mailing list