[Dovecot] Per IP virtual domain
Hello,
My dovecot server (2.0.18 on FreeBSD 9) has multiple interface. I would like to configure the authentication (pop and imap) to append different domain according to the local IP address.
I've tested this:
local 10.0.0.1 { auth_default_realm = domain1.com }
local 10.0.0.2 { auth_default_realm = domain2.com }
But it doesn't work. I get this error message:
doveconf: Fatal: Error in configuration file /usr/local/etc/dovecot/dovecot.conf line 58: Auth settings not supported inside local/remote blocks: auth_default_realm
-- Stephane Locatelli
On 10.4.2012, at 18.29, Stéphane Locatelli wrote:
My dovecot server (2.0.18 on FreeBSD 9) has multiple interface. I would like to configure the authentication (pop and imap) to append different domain according to the local IP address.
I've tested this:
local 10.0.0.1 { auth_default_realm = domain1.com }
local 10.0.0.2 { auth_default_realm = domain2.com }
But it doesn't work. I get this error message:
doveconf: Fatal: Error in configuration file /usr/local/etc/dovecot/dovecot.conf line 58: Auth settings not supported inside local/remote blocks: auth_default_realm
As it says, currently they aren't supported. It would need some extra code. Depending on your passdb you may be able to do this in your passdb configuration.
2012/4/10 Timo Sirainen tss@iki.fi
As it says, currently they aren't supported. It would need some extra code. Depending on your passdb you may be able to do this in your passdb configuration.
Currently I'm using dovecot 1.x on my production server with mysql passdb. I have ugly SQL queries to do this and my idea was to upgrade to dovecot 2.x to avoid this.
password_query = SELECT mbox AS user , passwd as password FROM mbox WHERE mbox=IF('%s' = 'smtp', '%u', IF('%u' like '%%@%%', '%u', concat('%u', case '%l' WHEN '10.0.0.1' THEN '@domain1.com' WHEN '10.0.0.2' THEN '@domain2.com' WHEN '10.0.0.3' THEN '@domain3.com' END ) ) ) AND passwd IS NOT NULL AND (status='active' OR status ='inactive');
-- Stephane Locatelli
participants (2)
-
Stéphane Locatelli
-
Timo Sirainen