Re: Wildcard in aliasfile?

Top Page
Delete this message
Reply to this message
Author: Philip Hazel
Date:  
To: Daniel Ryde
CC: Exim Users
Subject: Re: Wildcard in aliasfile?
On Mon, 27 Oct 1997, I wrote:

> I had a bit of thought about this over the weekend, but haven't really
> got any proposal yet. I'll let you know if/when I come up with something.


I've been thinking some more about this problem. The more I think about
it, the more I become convinced that aliasing is not the right way to go
if you want to preserve multiple copies for multiple recipients.
Consider a case where your alias file contains

*: user@???

Even if Exim were clever enough to treat that as a special case and
retain two or more (identical) recipients, it might then send off the
message over SMTP using multiple RCPT TO commands, and the far end might
well notice the duplication and remove all but one copy.

OK, this is rather far-fetched, but it's all part of my general unease
at messing with the de-duplication that currently happens, and is wanted
in the general case.

However, all is not totally lost. I have come up with a special-case
configuration that could be used if your wildcard points to an address
that you know how to deliver. Consider these configuration fragments:

#### Transport #####

  special_delivery:
    driver = appendfile;        
    file = /home/${local_part}/inbox,
    user = ${local_part} 


#### Directors #####

  test_aliases:
    domains = testing,
    driver = aliasfile;
    file = /test/aliases,
    search_type = lsearch


  default_aliases:
    domains = testing,
    transport = special_delivery, 
    driver = smartuser;   
    new_address = "${lookup{*}lsearch{/test/aliases}{$value}}"


If an address (in the "testing" domain) is not matched by the normal
alias lookup, then it gets picked up by the smartuser and passed to the
transport, with a new address that is looked up from a special key ("*")
in the same alias file. If there is more than one address that passes
through this mechanism, multiple copies get delivered, each with an
appropriate Envelope-To: header. The "*" key in the alias file must
supply an address with a domain, since smartuser requires that (or you
can screw on a fixed domain in the expansion). Come to think of it, you
could even supply a default default in the expansion for the case when
the lookup fails.

This assumes that you can set up the ultimate destination as a
transport, without having to resort to directors or routers. That is,
you can in effect do the directing/routing once and for all because it
won't ever change.

Obviously some other transport such as a pipe could be used instead,
which would give more flexibility.

Dunno if this helps...

Philip

-- 
Philip Hazel                   University Computing Service,
ph10@???             New Museums Site, Cambridge CB2 3QG,
P.Hazel@???          England.  Phone: +44 1223 334714



--
* This is sent by the exim-users mailing list.  To unsubscribe send a
    mail with subject "unsubscribe" to exim-users-request@???
* Exim information can be found at http://www.exim.org/