[Dovecot] v2.0 configuration parsing

Joseph Yee jyee at ca.afilias.info
Mon Aug 10 21:33:31 EEST 2009


Hi Timo,

What's your thought on the 'precedence order' (hope it make sense),   
on protocol, remote_ip, local_ip?

 From your sample 1, it would read equals (to most technical people) to
protocol imap
{
	remote_ip 192.168.0.0/16
	{
		foo = foo
	}
}
protocol ALL
{
	remote_ip 192.168.0.0/24
	{
		foo = bar
	}
}

If follow this syntax, sample 1's answer would be foo = foo, assuming  
specific rules overwrite general rules, and assuming protocol is the  
first order.

Sample 2 is tough, that's why I asked what's your thought on  
precedence order.  Restricting syntax to only remote before local (or  
vice versa) should resolve it.


Joseph

On 10-Aug-09, at 1:57 PM, Timo Sirainen wrote:

> I'm trying to figure out how exactly v2.0 should be parsing
> configuration files. The most annoying part is if it should always  
> just
> "use whatever comes first in config" or try some kind of a "use most
> specific rule". The "most specific" kind of makes more sense  
> initially,
> but then you start wondering how to handle e.g.:
>
> 1) User logs in to imap from 192.168.0.1. What is foo's value?
>
> protocol imap {
>  remote_ip 192.168.0.0/16 {
>    foo = foo
>  }
> }
> remote_ip 192.168.0.0/24 {
>  foo = bar
> }
>
> 2) User logs in from 192.168.0.1 to 10.1.2.3. What is foo's value?
>
> local_ip 192.168.0.1 {
>  remote_ip 10.1.2.0/24 {
>    foo = foo
>  }
> }
> remote_ip 10.1.2.3 {
>  local_ip 192.168.0.0/24 {
>    foo = bar
>  }
> }
>
> Any thoughts?



More information about the dovecot mailing list