Re: [Exim] Help please

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Philip Hazel
Date:  
À: Boris Kovalenko
CC: exim-users
Sujet: Re: [Exim] Help please
On Wed, 18 Sep 2002, Boris Kovalenko wrote:

>    My external programm gets 2 parameters: $local_part and $message_size.
> It returns 0 on success and writes forwarding address to stdout and 1 on
> fail and writes nothing to stdout. What should I write in filter to make
> it work properly?
> 1. If my_prog returns 0 (success) deliver to address it printed to stdout
> 2. Else there should be no delivery


The problem is 2. There's no facility for a "deliver" command that
doesn't deliver. A simple trick would be

deliver "${run {/your/program $local_part $message_size}{$value}{devnull}}"

where you set up an alias for devnull to /dev/null.

But this is messy, and wasteful. Basically, the filter language wasn't
intended for doing stuff as complicated as this.

If you are a sysadmin, you might find it easier to use a queryprogram
router instead of doing this in a filter.

In any case, if you are trying to do this in a system filter, it won't
work, because $local_part is not set. Remember: "A system filter is no
substitute for a router."

--
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.