Re: [Exim] ${pipe_addresses}

Top Page
Delete this message
Reply to this message
Author: Philip Hazel
Date:  
To: Sergei Gerasenko
CC: exim-users
Subject: Re: [Exim] ${pipe_addresses}
On Tue, 30 Jul 2002, Sergei Gerasenko wrote:

> This is about the ${pipe_addresses} variable, which
> applies only to the pipe transport and expands to a list of addresses
> that a message has while going through the pipe transport.


Strictly, $pipe_addresses isn't a variable. It's a bit of magic. :-)

The magic is that when it appears in a command for a pipe transport, the
delivery addresses get inserted into the command's arguments, *one
address per argument*. If it were a regular variable, the complete list
of addresses would be given in a single argument. So if you have

command = /some/thing $pipe_addresses

and the pipe is delivering to a@b, c@d, and e@f, the command is called
with three separate arguments:

arg[0] = /some/thing
arg[1] = a@b
arg[2] = c@d
arg[3] = e@f

If $pipe_addresses were a normal variable, you would have

arg[0] = /some/thing
arg[1] = a@b c@d e@f

But that is not what happens. It is done this way so that the script
does not have to parse a list of addresses.

> quick search on how to configure SpamAssassin with Exim and came across
> this recommended configuration:


<configuration omitted>

> Then, the Perl script (spamcheck.pl) is very simple. It just saves the
> message in different folders depending on whether it's spam or not. It
> doesn't resubmit the message to exim.


I hope it does some interlocking (e.g. using exim_lock).

> Although the script reads both the ${sender_address} and
> ${pipe_addresses}, they are never used in the script. Or so it seems.
> Besides, what use could those addresses be if the "batch" option is not
> even specified in the transport. This, correct me if I'm wrong, will
> result in the transport being run as many times as there are recipients
> and each time all those recipients will be passed to the script.


You are absolutely right. Without any batching, $pipe_addresses is the
same as $local_part. With batching, $pipe_addresses is useful, and
$local_part is not set (because there are several addresses).

> I noticed that an antivirus software that works with Exim also
> recommends a similar configuration.


For maximum efficiency I would recommend batching if you are going to
resubmit messages for delivery. For convenience, I think BSMTP is
probably simpler to use than $pipe_addresses if you are going to
resubmit the message.

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