Re: [exim] Tainted arg 2 for mailman_transport transport com…

トップ ページ
このメッセージを削除
このメッセージに返信
著者: Andrew C Aitchison
日付:  
To: Jeremy Harris
CC: exim-users
題目: Re: [exim] Tainted arg 2 for mailman_transport transport command
On Thu, 21 Jul 2022, Jeremy Harris via Exim-users wrote:

> On 21/07/2022 07:27, Thomas Krichel via Exim-users wrote:
>> 2022-07-21 06:19:30 1oEPWy-002t7O-0x == nep-test@???
>> R=mailman_router
>> T=mailman_transport defer (0): Expansion of
>> "${sg{sg{$/var/lib/mailman/lists/${lc::$local_part}/config.pck}{\/config.pck$}{}}{.*\/}{}}"
>> from command "/var/lib/mailman/mail/mailman '${if
>> def:local_part_suffix
>> {${sg{$local_part_suffix}{-(\\w+)(\\+.*)?}{\$1}}} {post}}'
>> ${sg{sg{$/var/lib/mailman/lists/${lc::$local_part}/config.pck}{\/config.pck$}{}}{.*\/}{}}"
>> in mailman_transport transport failed: $ not followed by letter,
>> digit, or {
>
> Here's how to get more info on this expansion problem.
>
> I'm using "noutf8" only in case this message messes up UTF8 characters.
> I manually replaced "$local_part" with "nep-test".
>
> # exim -d-all+expand+noutf8 -be


Thanks.

> ${sg{${sg{/var/lib/mailman/lists/${lc:nep-test}/config.pck}{\/config.pck\$}{}}}{.*\/}{}}

  /considering: ${sg{${sg{/var/lib/mailman/lists/${lc:nep-test}/config.pck}{\/config.pck\$}{}}}{.*\/}{}}
   /considering: ${sg{/var/lib/mailman/lists/${lc:nep-test}/config.pck}{\/config.pck\$}{}}}{.*\/}{}}
    /considering: /var/lib/mailman/lists/${lc:nep-test}/config.pck}{\/config.pck\$}{}}}{.*\/}{}}
    !/considering: nep-test}/config.pck}{\/config.pck\$}{}}}{.*\/}{}}
    !|--expanding: nep-test
    !\_____result: nep-test
    |--expanding: /var/lib/mailman/lists/${lc:nep-test}/config.pck
    \_____result: /var/lib/mailman/lists/nep-test/config.pck
    /considering: \/config.pck\$}{}}}{.*\/}{}}
    |--expanding: \/config.pck\$
    \_____result: /config.pck$
    /considering: }}}{.*\/}{}}
    |--expanding:
    \_____result:
   |--expanding: ${sg{/var/lib/mailman/lists/${lc:nep-test}/config.pck}{\/config.pck\$}{}}
   \_____result: /var/lib/mailman/lists/nep-test
   /considering: .*\/}{}}
   |--expanding: .*\/
   \_____result: .*/
   /considering: }}
   |--expanding:
   \_____result:
  |--expanding: ${sg{${sg{/var/lib/mailman/lists/${lc:nep-test}/config.pck}{\/config.pck\$}{}}}{.*\/}{}}
  \_____result: nep-test
nep-test

>



> Needing to use two ${sg} 's on something makes me wonder if the approach was
> right....


I approve of your gut-reaction.
Having slept on it, I don't think this will work and have another idea
which seems simpler.

mailman_router:
   driver            = accept
   domains           = +mm_domains
   local_parts = dsearch,filter=dir;MM_HOME/lists
   require_files     = MM_LISTCHK
   local_part_suffix_optional
   local_part_suffix = -admin     : \
          -bounces   : -bounces+* : \
          -confirm   : -confirm+* : \
          -join      : -leave     : \
          -owner     : -request   : \
          -subscribe : -unsubscribe
   transport         = mailman_transport



mailman_transport:
   driver  = pipe
   command = MM_WRAP \
           '${if def:local_part_suffix \
                 {${sg{$local_part_suffix}{-(\\w+)(\\+.*)?}{\$1}}} \
                 {post}}' \
            ${lc:local_part_data}
   current_directory = MM_HOME
   home_directory    = MM_HOME
   user              = MM_UID
   group             = MM_GID


Thomas and I are going to take this offline for a while.

-- 
Andrew C. Aitchison                      Kendal, UK
                    andrew@???