RE: [exim] Exim Config and Space characters Question

トップ ページ
このメッセージを削除
このメッセージに返信
著者: Potato Chip
日付:  
To: exim-users
題目: RE: [exim] Exim Config and Space characters Question
Philip... Thanks for the insight. I was not aware that this is how the
parsing worked. I'm surprised there isn't an easier way, but at least
that will work. Thanks again!

Jae

-----Original Message-----
From: Philip Hazel [mailto:ph10@cus.cam.ac.uk]
Sent: Wednesday, February 15, 2006 1:46 AM
To: Potato Chip
Cc: exim-users@???
Subject: Re: [exim] Exim Config and Space characters Question

This is actually quite tricky. You might think you could use this:

   transport_filter = /usr/bin/spamc -x \
     ${lookup{$local_part}lsearch{/etc/passwd}{-u\x20$local_part}}


but it wouldn't work, because the string "-u whatever" would then be
passed as a single argument to the command, whereas you want two
separate arguments. You have to do this:

   transport_filter = /usr/bin/spamc -x \
     ${lookup{$local_part}lsearch{/etc/passwd}{-u}} \
     ${lookup{$local_part}lsearch{/etc/passwd}{$local_part}}


It's not quite as horrendous as it looks, because the lookup will be
cached. An alternative would be

   transport_filter = /bin/sh -c "/usr/bin/spamc -x \
     ${lookup{$local_part}lsearch{/etc/passwd}{-u $local_part}}"


but that costs you an additional shell process.


-- 
Philip Hazel            University of Cambridge Computing Service
Get the Exim 4 book:    http://www.uit.co.uk/exim-book