Re: [exim] filters: delivering to multiple recipients define…

Góra strony
Delete this message
Reply to this message
Autor: Mike Brudenell
Data:  
Dla: Nick
CC: Exim
Temat: Re: [exim] filters: delivering to multiple recipients defined in a single string
Hi, Nick -

I've not done much with filters for a long time so am afraid I can't help
with whether there's some clever/sneaky way of persuading a filter to
deliver to an arbitrary number of recipients obtained from a lookup.

However I think you're onto a non-starter trying to find different
delimiters that might work with deliver in a filter; the *Exim Filter* document
describes the format of the deliver directive as taking a single email
address, not a list.

As for how to do it in the main configuration, a good starting point would
be to look at the description of the *system_aliases r*outer (eg, in
section 7.3 of the *Exim 4.86 Specification* document)…

The example there uses a simple *lsearch* linear lookup to retrieve a data
item containing one or more target addresses from the /etc/aliases file
keyed by an alias name. The *redirect* driver then deals with interpreting
this comma-separated list and routing copies of the message to each address
given in the lookup.

Instead of using *lsearch* you could of course use a different type of
lookup such as *sqlite*; from your filter example you seem to know how to
construct these (which is more than I do! :-)

Cheers,
Mike B-)

On 21 December 2015 at 19:37, Nick <oinksocket@???> wrote:

> An incoming email's address may be mapped into several recipients.
> Currently
> these are concatenated into a comma-delimited list, for example:
>
> "recipient1,recipient2"
>
> And this is fed to the deliver command via a (regex capture) variable,
> effectively resulting in this:
>
> deliver "recipient1,recipient2"
>
> I had thought this string would be processed by the "deliver" command in
> the
> same way lists in the /etc/aliases file are. But it is rejected with an
> error:
>
>     error in filter file: malformed address "recipient1,recipient2" in
>     filter file: missing or malformed local part (expected word or "<")

>
> So apparently this doesn't work like I thought. However I cannot easily
> just
> split this into two 'deliver' commands as the filter docs say: the
> variable may
> contain an arbitrary number of recipients.
>
> Does anyone know a way to persuade 'deliver' to send to multiple
> recipients?
> I've tried various delimiters (notably commas, spaces, newlines). Or
> alternatively, a way to map a variable containing several recipients into
> several invocations of the deliver command?
>


--
Systems Administrator & Change Manager
IT Services, University of York, Heslington, York YO10 5DD, UK
Tel: +44-(0)1904-323811

Web: www.york.ac.uk/it-services
Disclaimer: www.york.ac.uk/docs/disclaimer/email.htm