Re: [exim] Multiple dynamically-created alias files?

Top Page
Delete this message
Reply to this message
Author: Marc Sherman
Date:  
To: exim-users
Subject: Re: [exim] Multiple dynamically-created alias files?
Bob Johnson wrote:
>
> Essentially, I want to do something like this in my alias router:
>
> data = ${lookup{$local_part}lsearch{/exim/aliases.d/*}}
>
> but of course a wildcard like that doesn't work, and I can't figure out a
> way to do the equivalent for all the files in a specified directory.
>
> Any suggestions? Exim 4.52, by the way.


If you can handle a delayed response to changes, a cron job every N
minutes running

cat /exim/aliases.d/* > /exim/aliases.d.generated

and a redirect router with

data = ${lookup{$local_part}lsearch{/exim/aliases.d.generated}}

should do the trick.

If you set the main config option

bi_command = cat /exim/aliases.d/* > /exim/aliases.d.generated

then you can omit the cron job, as long as you run newaliases after
editing any files within aliases.d.

- Marc