Different realm for different listeners?

Chris Adams cma at cmadams.net
Tue Mar 10 17:49:45 UTC 2015


Once upon a time, Tom Hendrikx <tom at whyscream.net> said:
> You could drop the default realm completely, and create a second
> passdb lookup which uses only the username part to lookup credentials.
> This means that, as long as you have no conflicts as usernames
> 'john at foo.com' vs 'john at bar.com', you'd be able to support username
> 'john'.

The domains I need to handle are separate telephone company ISPs, so
they all want common things like "sales", so that won't work.

All my users are in MySQL.  Reading the docs, I see that "%l" expands to
the local IP address "almost everywhere".  If that's available in the
userdb SQL expansion, I could write a (somewhat convoluted) SQL
statement that adds a domain based on the local IP.  Does that sound
like it'll work?  Not quite as "elegant" as just setting
auth_default_realm in separate listeners, but should work I guess.

-- 
Chris Adams <cma at cmadams.net>


More information about the dovecot mailing list