<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>TL;DR: </div><div><br></div><div>Can director_username_hash use %{userdb:...} or %{passdb:...} ?</div><div dir="ltr"><br></div><div dir="ltr">====================================</div><div dir="ltr"><br></div><div>This is on Ubuntu Precise, running dovecot 2.2.36. It's a fully production, director-ized env, so assume everything is working correctly. Happy to post doveconf if it's relevant but wanted to ask a general question first.</div><div dir="ltr"><br></div><div dir="ltr">I was curious if there's a way to get userdb/passdb data into director_username_hash. Currently, we've got default hashing (on %u). I'm returning a SQL field called 'real_username' (the owner of the mailbox, so almost never the same as %u). I'd like (for mdbox reasons) to hash on that rather than %u.</div><div dir="ltr"><br></div><div>My test SQL is returning (this is just a chunk -- it's duplicated for testing):</div><div dir="ltr">UserName AS userdb_real_username, UserName AS real_username<br></div><div dir="ltr"><br></div><div>I can see in my director boxes that it's at least picking up the latter:</div><div><br></div><div>passdb out: PASS<span class="gmail-Apple-tab-span" style="white-space:pre">   </span>1<span class="gmail-Apple-tab-span" style="white-space:pre">     </span>user=<a href="mailto:tesbox@mailbox.com">tesbox@mailbox.com</a><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>proxy=y<span class="gmail-Apple-tab-span" style="white-space:pre">       </span>real_username=testuser<br></div><div><br></div><div>Is it possible to inject 'real_username' into director_username_hash? That is, I'd rather hash on 'testuser' instead of 'testbed'.</div><div><br></div><div>I've been trying different permutations on my director boxes with no luck. </div><div><br></div><div>director_username_hash = %{userdb:real_username}<br></div><div>director_username_hash = %{passdb:real_username}<br></div><div>director_username_hash = %{userdb:userdb_real_username}<br></div><div>director_username_hash = %{passdb:userdb_real_username}<br></div><div><br></div><div>With any of those settings, every mailbox gets hashed to the same backend, so I'm guessing it's not getting anything useful (i.e. probably resolving to the same empty string and hashing on that -- or perhaps is just hashing on the literal string, e.g. "%{userdb:real_username}" ).</div><div><br></div><div>And I'm not even sure if director_username_hash has access to any passdb/userdb data. Is there a debug setting that would show what string director is using to do the hashing?</div><div><br></div><div>Current debug settings are:</div><div><br></div><div><div>auth_debug = yes</div><div>auth_debug_passwords = yes</div><div>mail_debug = yes<br></div></div><div><br></div><div>but not a peep as to the string that director is hashing on.</div></div></div></div></div></div></div></div></div></div></div></div></div>