[exim-dev] [Bug 1524] New: extract inside inlisti, fails

Top Page
Delete this message
Reply to this message
Author: Jeremy Harris
Date:  
To: exim-dev
New-Topics: [exim-dev] [Bug 1524] extract inside inlisti, fails
Subject: [exim-dev] [Bug 1524] New: extract inside inlisti, fails
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=1524
           Summary: extract inside inlisti, fails
           Product: Exim
           Version: 4.84
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: bug
          Priority: medium
         Component: String expansion
        AssignedTo: jgh146exb@???
        ReportedBy: jgh146exb@???
                CC: exim-dev@???



Messing around with an LDAP issue I started trying to
lay out some example coding, and ran into some brainfade.

I'd got to here:

${if forany \
     {mail:EximMailPrimaryAddress:EximMailAlternateAddress} \
     {inlisti {$local_part} \
              {<, ${extract {$item} \
                         {${lookup
ldapm{ldap://localhost/ou=users,dc=example,dc=com?mail,cn?sub?cn=user4}}}\
                }\
              }\
     }\
 }


and, replacing the $local_part for testing, failed like so:

> ${if forany \

     {mail:EximMailPrimaryAddress:EximMailAlternateAddress} \
     {inlisti {user4alternate2@???} \
              {<, ${extract {$item} \
                         {${lookup
ldapm{ldap://localhost/ou=users,dc=example,dc=com?mail,cn?sub?cn=user4}}}\
                }\
              }\
     }\
 }
expanding: mail:EximMailPrimaryAddress:EximMailAlternateAddress
   result: mail:EximMailPrimaryAddress:EximMailAlternateAddress
expanding: user4alternate2@???
   result: user4alternate2@???
skipping: result is not used
expanding: $item
   result:
skipping: result is not used
expanding: ldap://localhost/ou=users,dc=example,dc=com?mail,cn?sub?cn=user4
   result: ldap://localhost/ou=users,dc=example,dc=com?mail,cn?sub?cn=user4
skipping: result is not used
expanding: ${lookup
ldapm{ldap://localhost/ou=users,dc=example,dc=com?mail,cn?sub?cn=user4}}
   result:
skipping: result is not used
failed to expand: <, ${extract {$item} {${lookup
ldapm{ldap://localhost/ou=users,dc=example,dc=com?mail,cn?sub?cn=user4}}}}}}}
   error message: missing or misplaced { or }
failed to expand: ${if forany
{mail:EximMailPrimaryAddress:EximMailAlternateAddress} {inlisti
{user4alternate2@???} {<, ${extract {$item} {${lookup
ldapm{ldap://localhost/ou=users,dc=example,dc=com?mail,cn?sub?cn=user4}}}}}}}
   error message: missing or misplaced { or } inside "forany" condition
Failed: missing or misplaced { or } inside "forany" condition

>


This looks to be a syntax-check initial run through
the arguments for the forany, failing because $item
is empty and ${extract requires nonempty.

Replace the $item with a dummy and it works.

The reason is that the empty result for $item is wrongly interpreted as a
number, and a third substring is insisted upon for the extract.


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email