[exim] saving substr result?

トップ ページ
このメッセージを削除
このメッセージに返信
著者: Don Walker
日付:  
To: exim-users@exim.org
題目: [exim] saving substr result?
Is there any way to set a variable to preserve the result of substr in a
router acl? My need is to extract two substrings from $local_part and
use them in a condition and mysql query. The code below works, but it
would be cleaner if the two substr uses could be coded once and the
results saved for use in the rest of the code. I have scoured all the
docs I can find and tried to set acl_mX.


maillist:
  driver = redirect
  condition = ${lookup{${substr{0}{5}{$local_part}}} \
     lsearch{/etc/exim/maillists}{yes}{no}}
  data = ${lookup mysql{select email from \
     ${lookup{${substr{0}{5}{$local_part}}}lsearch{/etc/exim/maillists}} \
     where class1 = 
${substr{5}{${eval10:${strlen:$local_part}-5}}{$local_part}} \
     or class2 = 
${substr{5}{${eval10:${strlen:$local_part}-5}}{$local_part}} \
     or class3 = 
${substr{5}{${eval10:${strlen:$local_part}-5}}{$local_part}}}}