Re: Exim & ProcMail

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: John Henders
Fecha:  
A: exim-users
Cc: william.craven
Asunto: Re: Exim & ProcMail
On Feb 11, william.craven@??? (William Craven) wrote:

> We have an alias in our main Aliases file which pipes all postmaster
> mail through Procmail - this is so that it filters postmaster mail to
> the appropriate persons. The entry is as follows
>
> postmaster: "|IFS=' ' && exec /local/bin/procmail -f- || exit 75"
>
> Exim balks with a message returned to sender


I ran across the same thing a while back and here's Philip's reply

!
!Well, what exim is doing is to take the first part "IFS='" and treat it as a
!command and treat the rest of the line as arguments. It then does a fork() and
!exec() itself. Sendmail just does a popen() which launches a shell and then
!executes the command within the shell. Now consider what happens if you want to
!pass some header information to your program. Under sendmail you may well have
!just given people who email you the ability to execute commands on your machine
!(possibly as root). I guess exim just follows the principle of least *nasty*
!surprise...
!
!Seriously, if you want to use the procmail commands without thinking about them
!then you can just wrap them in a shell with 'sh -c'.
!

Which essentially means the IFS=' ' is not required because the forward
file is not being passed to a shell, so IFS has no meaning and thus
doesn't have to be protected.


-- 
      Artificial Intelligence stands no chance against Natural Stupidity.
                GAT d- -p+(--) c++++ l++ u++ t- m--- W--- !v
                     b+++ e* s-/+ n-(?) h++ f+g+ w+++ y*