Re: [Exim] help with pipe

Pàgina inicial
Delete this message
Reply to this message
Autor: Peter Radcliffe
Data:  
A: exim-users
Assumpte: Re: [Exim] help with pipe
"Chad Leigh, Pengar Enterprises, Inc. and Shire.Net LLC" <chad@???> probably said:
> Using exim 2.04 on FreeBSD 3.x . All transports/directors/routers are
> default and enabled for pipe / userforward.


2.04 is very, very old.

> I am trying to set up a simple piping .forward to run messages through gpg
> (GnuPG) and then to mail them on to another address. The commands work in
> a shell but not in the pipe.
>
> here is the .forward
>
> | /usr/local/bin/gpg -o - --armor --quiet --no-secmem-warning --yes
> --always-trust -r chad@??? -e | mail -s "test message"
> chad@???


Thats not a simple pipe. Thats a pipe into another pipe.

> ------ | /usr/local/bin/gpg -o - --armor --quiet --no-secmem-warning --yes
> --always-trust -r chad@??? -e | mail -s "test message"
> chad@??? ------
> usage: gpg [options] --encrypt [filename]


> I plead ignorance. What is special about the pipe. The exim log gives:


It's not just _a_ pipe, it's two pipes.

exim does not pass the command to a shell (it's much safer that way)
so that | mail -s "test message" ... is being passed to gpg as a
command line option.

Either put it all in a script and call the script, turn on shell
handling (not advised and may not even be there in 2.*) or use
procmail or something else designed to handle things like that.

P.

-- 
pir                  pir@???                    pir@???