Re: [Exim] Filtering: piping

トップ ページ
このメッセージを削除
このメッセージに返信
著者: dman
日付:  
To: exim-users
題目: Re: [Exim] Filtering: piping
On Thu, Dec 27, 2001 at 03:18:56PM +0000, Philip Hazel wrote:

| Exim 4 contains a new expansion option ${run which runs an external
| process. If you permit that to be used in a filter, it could do this
| job.


Philip :

I was thinking that it would be really useful (and general) if the
'pipe' command (or perhaps "epipe" to maintain the current "pipe"
semantics) would simply report the exit code of the sub process in a
variable (such as $exitcode) that the filter script can check and
decide what to do with it. For example :


epipe "fgrep -i \"$h_From:\" spammer_blacklist.text"
if $exitcode == 0 then
    # the person was found in the blacklist
    seen finish
elif $exitcode == 1 then
    # I don't know, this is a made-up example :-)
    logwrite "hello world"
endif



I think that this feature would allow exim filters to be infinitely
extensible via external programs. Do you think this would be useful?
Does the new ${run expansion already provide this functionality? If I
made a patch (I haven't looked at the source yet, but I expect it
would be quite simple) would you consider accepting it?

-D

--

He who walks with the wise grows wise,
but a companion of fools suffers harm.
        Proverbs 13:20