On 4.3.2012, at 16.48, Terry Carmen wrote:
pass_attrs = ...,
msExchHomeServerName=userdb_imapc_host=%49.100$.example.comIf the prefix differs, but all of the exchange server names have the same length, for example 10, you can also do:
pass_attrs = ...,
msExchHomeServerName=userdb_imapc_host=%-10$.example.com There's no otherwise nice way to parse this string.If by prefix, you mean the "/O=example/OU=INT/cn=Configuration/cn=Servers/" part, then, yes, they're different.
OK, so if the prefix or suffix isn't always the same length you can't do the above.
I could export the data to a text file as username:homeexchangeserver (or whatever other format is needed).
homeservers.txt: user1:exch1.example.com user2:exch1.example.com user3:exch1.example.com user4:exch2.example.com
Is it possible to do a lookup in a text file to get this?
If you can use userdb passwd-file and export the data to that file, it'll work. http://wiki2.dovecot.org/AuthDatabase/PasswdFile
Example line:
user1::1000:1000::/home/user::userdb_imapc_host=exch1.example.com
Note that you can't then return any userdb fields from passdb ldap lookup.