Re: [exim] combining string expansion items (lookup, extract…

Páxina inicial
Borrar esta mensaxe
Responder a esta mensaxe
Autor: Chris Knadle
Data:  
Para: Exim
Asunto: Re: [exim] combining string expansion items (lookup, extract)
On Friday, June 27, 2014 17:10:06 Chris Knadle wrote:
> I'm trying to do a custom DNS lookup checking for $sender_address_domain
> DMARC rules, and I seem to be missing some fundamental understanding of how
> to combine string expansion items. I've been reading manual sections 9.10
> and Chapter 11.
>
> Right now I have the following:
>
> acl_check_data:
>    [...]
>   warn
>     set acl_m_dm1 = ${lookup dnsdb{>\n,; txt=_dmarc.$sender_address_domain}\
> {$value} fail}
>     set acl_m_dm2 = ${extract {p}{$acl_m_dm1}}
>     #condition = ${if def:acl_m_dm1}
>     condition = ${if and{ {def:acl_m_dm2} {!eq {$acl_m_dm2} {none;}} }}
>     logwrite = $sender_address_domain DMARC lookup = $acl_m_dm1 ::
> $acl_m_dm2

>
>
> And instead I'd like to be able to combine these operations and store the
> result in a single variable, such as:
>
>     set acl_m_dm1 = ${extract { \
>          ${lookup \dnsdb{>\n,; txt=_dmarc.$sender_address_domain} \
>            {$value} fail}
>        }{p}{$acl_m_dm1} }

>
> ... but this always seems to lead to an error "missing or misplaced { or }"
> even when the {'s match the }'s, so I think I'm missing something else
> concerning how to combine these.


The default configuration for Exim that comes with Debian has an example
cram_md5 authentication driver that gave me the needed hint -- what was needed
was outside {}'s, i.e. {${<operation>}}.

    set acl_m_dm1 = ${extract {p} \
         {${lookup dnsdb{>\n,; txt=_dmarc.$sender_address_domain} \
            {$value} fail}} }


-- Chris

--

Chris Knadle
Chris.Knadle@???