Re: [exim] ${run ...} string expansion and input

Góra strony
Delete this message
Reply to this message
Autor: Kirill Miazine
Data:  
Dla: Marten Lehmann
CC: exim-users
Temat: Re: [exim] ${run ...} string expansion and input
* Marten Lehmann [2005-02-22 11:52]:
> Hello,
>
> ${run} is a usefull string expansion, but how can I send something (e.g.
> a message body) to STDIN of the command? If I can't send something to
> STDIN, does a temporary file with the current message content exist
> which I can use as command argument?


A ${pipe} operator would be useful. Until it's added, I use the
following approach:

    * Create a daemon that reads Exim spool and executes the program and
      pipes the message to stdin.


Exim speaks with the daemon using ${readsocket}.

    ${readsocket{/tmp/pipehack.sock}{$message_id\n\
                                     $local_part\n\
                                     $local_part_suffix\n\
                                     $domain\n}{10s}{}{1}}


The above will return the exit code of executed program.

I copied the source to http://km.krot.org/code/pipehack.pl.

Note: I have split_spool_directory unset. If you have it set, you'll
have to modify the spool_message function a bit.

Warning: if the format of the spool files ever changes, you'll have to
modify the spool_message function yet again. :-)

Bye!

-- 
    -- Kirill Miazine <km@???>