On Wed, Feb 25, 2015 at 5:26 PM, Jeremy Harris <jgh@???> wrote:
> On 25/02/15 15:19, Jim Trigg wrote:
> > While the idea of a monolithic configuration file is fine in general,
> > this is a specific case where a separate file is indicated.
> > I'd have to do separate routers for each domain in which jtrigg is
> > a valid recipient. (The server hosts multiple domains; for some my mail
> > username is jtrigg and for others it's blaise. Similarly, I have other
> > PCRE expressions for other users who are in more than one domain but not
> > all domains.)
>
> Without full details of the baroque mess you're trying to duplicate,
> we can't design a solution. And if it's that complicated, you may
> need to pay someone to.
>
>
I'm not sure that I've ever seen a paid Exim consultant. :)
To the OP:
I'm thinking that this could be solved by file or database lookups.
One way of doing it, then, would be store the localparts as keys and the
rewrite/redirect rule as a value, and have Exim perform the lookups, maybe
through a Perl script.
The idea isn't fully formed in _my_ head, but try starting with a Perl
script loaded at startup, running from start, here from the top of my
config file:
perl_startup = do '/etc/exim4/scripts/scripts.pl'
perl_at_start
See also here about using Exim variables in Perl:
http://www.exim.org/exim-html-current/doc/html/spec_html/ch-embedded_perl.html
The great thing about farming decisions out to Perl, is that this is where
PCRE came from. ;)
On a more serious note, Perl offers some familiar programming constructs
which make handling data structures a breeze.
--
Jan