[Dovecot] proxy_maybe regex

Timo Sirainen tss at iki.fi
Mon Feb 1 22:33:39 EET 2010


On 1.2.2010, at 22.17, David Halik wrote:

> Does anyone know if dovecot support regex lookups for proxy/proxy_maybe, rather than mysql/ldap etc?

proxy and proxy_maybe have host name as value, no regex or anything like that.

> username:host
> ^[a-d]: 192.168.xxx.1
> ^[e-k]: 192.168.xxx.2
> 
> and so on...
> 
> I didn't think this was supported in dovecot, but I wanted to check first. I think this is going to end up being what we use to avoid NFS problems. It's lightweight, drops into our current setup, and doesn't require a mysql database which adds another point of failure.

You can use SQLite. You don't even need an actual database. Something like (completely out of my head, no idea how to do it in reality):

password_query = select \
  (if '%u' regexp '^[a-d]' then '192.168.xxx.1' else \
  if '%u' regexp '^[e-k]' then '192.168.xxx.2' else \
  ..) as proxy_maybe

Another possibility would be checkpassword scripts, but that forks for each connection.


More information about the dovecot mailing list