Re: [exim] trying to use 'pipe' in an exim filter, but not w…

Top Page
Delete this message
Reply to this message
Author: Jeffrey 'jf' Lim
Date:  
To: exim-users
Subject: Re: [exim] trying to use 'pipe' in an exim filter, but not working
On Mon, Sep 14, 2009 at 3:27 AM, Heiko Schlittermann <hs@???>wrote:

> Jeffrey 'jf' Lim <jfs.world@???> (So 13 Sep 2009 19:27:48 CEST):
> > I've got a system_filter file, which I've verified that exim does indeed
> > refer to, but somehow the 'pipe' just does not seem to work. Can anybody
> > debug why?
> >
> > == system_filter ==
> > # Exim filter
> > if $sender_address does not end "@gmail.com" and $h_to contains "
> > test@???" then
> >         fail "sending not allowed."
> > endif
> > if $h_to contains "test@???" then
> >         unseen pipe "/usr/local/mailserver/process.sh"
> > endif
> > ========

> >
> > I've tried at various times playing with the first "if", and yes, I do
> get
> > the fail message when the conditions match (so I know exim is loading the
> > filter). But whenever I get pass the first "if" (like in this case,
> sending
> > from "@gmail.com" to "test@???", the pipe just does not seem to
> be
> > triggered.
> >
> > ==== process.sh ========
> > #!/bin/sh
> > tmp=`mktemp`
> > cat > $tmp
> > echo "sometext" >/tmp/foo
> > ===============
> >
> > The message gets sent to the inbox of the test account, but process.sh
> does
> > not run? (There is nothing in /tmp)
>
> o As mentioned in some other mail: process.sh is executable by the
> exim user?
>
>

yes. It's executable by all.


> o You are sure, /tmp/foo is writable for the exim user?
>
>

yes. /tmp/foo does not exist. /tmp is world writable.



> o You've set system_filter_pipe_transport?
>
>

I dont even have any idea what that is!
http://exim.org/exim-html-current/doc/html/filter.html#SECTpipe doesn't
mention this. But fine - I tried googling for a couple of examples, and
found 2 setting 'system_filter_pipe_transport = address_pipe' (eg.
http://www.freesoftwaremagazine.com/articles/exim_and_anti_spam_spamassassin?page=0%2C2).
Looked up 'address_pipe' in the documentation, but still not any the wiser.

Here's a compilation of what I've read:
http://exim.org/exim-html-current/doc/html/filter.html#SECTpipe
http://exim.org/exim-html-current/doc/html/spec_html/ch29.html
http://exim.org/exim-html-current/doc/html/spec_html/ch11.html#SECTexpvar

From the last link, it seems that I should only bother with $address_pipe if
a message is redirected to a pipe due to "aliasing or forwarding"? In which
case, I shouldnt bother, since I'm expecting to run the pipe at the
beginning using system_filter? OTOH, the 2nd link mentions '$address_pipe
contains the text of the pipe command', as if this were not a special case?
These docs have been chasing round in circles.

I've also set system_filter_user, and system_filter_group to the exim user,
to try and see if this helps. It doesnt.

-jf



>    Best regards from Dresden/Germany
>    Viele Grüße aus Dresden
>    Heiko Schlittermann
> --
>  SCHLITTERMANN.de ---------------------------- internet & unix support -
>  Heiko Schlittermann HS12-RIPE -----------------------------------------
>  gnupg encrypted messages are welcome - key ID: 48D0359B ---------------
>  gnupg fingerprint: 3061 CFBF 2D88 F034 E8D2  7E92 EE4E AC98 48D0 359B -

>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iEYEARECAAYFAkqtR4kACgkQ7k6smEjQNZuCQACg65rwIJkdHXOxMSmuXA8lq9Uc
> BBsAoJIhKtwWGcSMmgReKI3S7QzrXvll
> =q6T0
> -----END PGP SIGNATURE-----
>
> --
> ## List details at http://lists.exim.org/mailman/listinfo/exim-users
> ## Exim details at http://www.exim.org/
> ## Please use the Wiki with this list - http://wiki.exim.org/
>