Re: [EXIM] Virtual Domain Wildcards.

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Mark Lowes
Dátum:  
Címzett: exim-users
Tárgy: Re: [EXIM] Virtual Domain Wildcards.
[resend because my email address at home is different :-/ ]

The entity claiming to be Julian wrote...
[...]
> > I am runnign exim with virtual domain aliases. But I need to know if I
> > can use wildcards in the domain dbm file.

[...]
> > *@foo.com      blah@???

> >
> > so everything @foo.com goes to blah@???

[...]
> There are several ways of doing that.
> You can do it with rewrite rules, but a number of different people have
> independantly come up with a scheme such that you have an entry in your
> aliases file for that domain called something like


I think what he's trying to do is integrate it into a virtual domain
database lookup. The easiest way I've found to do this (from an idea
off the list, backed up with some horrible scripts.) is to use two
directors.

The first handles the direct address mappings,

    ie 


    aliases.lspace.org holds things like
    hamster        -> hamster@???
    foobar        -> foobar3@isp



    aliases.wibble.org
    hamster        -> hamster@???


--[ config fragment ]--
virtual:
        driver = aliasfile
        domains = dbm;/usr/exim/virtual/db/domain_list.db
        file = /usr/exim/virtual/db/dom_src.$domain.db
        search_type = dbm
--[ config fragment ]--


The second handles anything that falls through the first (ie anything
where there isn't a default.

In my case I've built it into the db file as

    LibraryDefault@domain -> default address


but the localpart could be anything unique which isn't going to be
used as an address at the domain.


--[ config fragment ]--
virt_default:
        driver = smartuser
        domains = dbm;/usr/exim/virtual/db/domain_list.db
        no_more
        new_address = "${lookup{LibraryDefault@$domain}
        lsearch{/usr/exim/virtual/db/default}{$value}fail}
--[ config fragment ]--


The db files are built using a nasty bit of perl to parse the domain
db files into a alias file for each domain and a entry in the global
domain file. A default entry is only generated if there's a @ or
@subdomain. entry.

Anyway enough of my rambling, a tarball of my config is availible on
request, should anyone be insane enough to want to look at it ;)

    Mark


--
Mark Lowes <hamster@???>
http://hamster.wibble.org/
http://www.wibble.org/

--
*** Exim information can be found at http://www.exim.org/ ***