Re: [Exim] lookup in perdition popmap-db

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Peter Radcliffe
Date:  
À: exim-users
Sujet: Re: [Exim] lookup in perdition popmap-db
Jochen Knuth <jok2@???> probably said:
> cyrus:
> driver = localuser
> transport = local_delivery_cyrus
> condition = ${if eq{${extract{2}{:}{${lookup {$local_part} lsearch
> {/usr/local/etc/popmap} {$value}}}}}{305}{yes}}
>
> But how can i compare pophost _and_ popport? i tried several conditions
> but failed to find a working one.
>
> From reading the fine manual i thought the follwing condition should work:
>
> condition = ${if and{if eq{${extract{1}{:}{${lookup {$local_part} lsearch
> {/usr/local/etc/popmap} {$value}}}}}{localhost}{yes}}{if eq{${extract{2}
> {:} {${lookup {$local_part} lsearch {/usr/local/etc/popmap} $value}}}}}
> {305}{yes}}{yes}}
>
> This is the condition from above combined with a lookup for the pophost.
>
> But this gives the following error in a exim -d9 test:
> LOG: 0 MAIN PANIC


I tend to lay out complicated expansions so they are easier to follow and
debug;

condition = "${if and{   \
                      {if eq{${extract{1}{:}{${lookup {$local_part} lsearch  \
                           {/usr/local/etc/popmap} {$value}}}}}  \
                           {localhost} {yes}}  \
                      {if eq{${extract{2} {:} {${lookup {$local_part} lsearch \
                           {/usr/local/etc/popmap} {$value}}}}}  \
                           {305} {yes}}  \
                     }   \
              {yes}}"


I got lost somewhere in the middle not knowing which conditions are supposed
to go inside or outside the and { }, but that would be my best guess.

You're actually missing several brackets in several places. I also
think you didn't read the spec for "and { }" properly - conditions need
to be wrapped in {} as well as the outside {}.

Lay it out properly and use the bracket matching abilities of your choice of
editor (I tend to use emacs for this kind of thing).

P.

-- 
pir                  pir@???                    pir@???