Victor Duchovni:
> On Tue, Jan 18, 2011 at 03:36:12PM -0500, Victor Duchovni wrote:
> 
> > On Tue, Jan 18, 2011 at 09:19:50PM +0100, Mark Martinec wrote:
> > 
> > > $ postconf postscreen_dnsbl_sites
> > > postscreen_dnsbl_sites = zen.spamhaus.org=127.0.0.[2,3,4..8,10..11]
> > > 
> > > postfix/postscreen[26161]: fatal: bad DNSBL filter syntax: need "," or 
> > > "]" at "127.0.0.[2><"
> > 
> > There is a parser issue here, since "," is both a valid separator between
> > list elements and a separator in the filter notation.
> 
> This is likely also a problem in smtpd(8) when parsing similar expressions
> with "reject_rbl_client domain=filter".

A bit of context-sensitive parsing wil handle this without breaking
existing configurations.

        Wietse

Something along the lines of:

    /*
     * Workaround. The "," was already in use as dnsbl list separator.
     */
    for (keep = 0, cp = var_psc_dnsbl_sites; *cp; cp++) {
        if (*cp == '[') {
            keep++; 
        } else if (*cp == ']' && keep > 0) {
            keep--;
        } else if (*cp == ',' && keep <= 0) {
            *cp = ' ';
        }
    }
    dnsbl_site = argv_split(var_psc_dnsbl_sites, ", \t\r\n");

Reply via email to