On Sat, 2 Nov 2002, Rejo Zenger wrote:
> >> What I would like to have for some domains I host is a file like the
> >> normal aliases file, but with the added functionality of being able to
> >> use regular expresions to specify addresses. In other words, I would
> >> like to have a file with, for example:
> >>
> >> bounce-.*: rejo
> >>
> >> This file I would like to consult from within the main configuration
> >> file, similar to the lsearch lookups. Is there a way to do this?
> >
> >This can't be done yet (AFAIK).
> >
> >Explain your situation a little bit more, and tell us which version of
> >exim you use, maybe we can find a solution.
>
> I'm using 4.10. The mailserver is running a small site only.
>
> I have a couple of aliasses on a domain. Some of these aliasses are
> fixed and known in advance (just like the <postmaster> alias that should
> be forwarded to a specific account). For these I can use the regular
> aliases file to forward them to the correct account.
>
> Then I have some aliasses that have the same pattern, but which I do not
> know exactly in advance. So some of these have, for example, the pattern
> of "the word 'bounce-' plus some large number", like <bounce-804210412>.
> As I do not know them in advance, I'm unable to maintain a large list of
> possible aliases.
>
> I know I can solve this by maintaining a regular aliases file for the
> first type of addresses and do some regexp'ing from within the main
> configuration file and forwarding them to a catch-all-users. But what I
> intended to do is to keep all the aliases definitions in a single file,
> outside of the main configuration.
>
> I hope this makes clear what I'm aiming at...
If you can just have these problems with aliases with a fixed prefix, your
could try this router.
prefix_aliases:
driver = redirect
local_part_prefix = *-
data = ${lookup {$local_part_prefix} lsearch {/etc/your/alias/file} }
And using
bounce-:someaddress@???
info-:someotheraddress@???
normalalias: xxx@???
as your aliasfile?
This should be used before your usual alias-router.
If this does not fit your needs, you will have to use something external
(${run}) or embedded perl (${perl}).
ciao