[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Virtual Domains Setup



On Mon, Jun 03, 2002 at 06:25:45PM +0000, Godfred Ofori-Som wrote:
> I am trying to setup a virtual domain with exim. I have looked at the 
> configuration but i think what i want is different from the way virtual 
> domains has been described.
> The configuration I want, is to use exim to collect emails for some domains 
> and just drop it to a single mailbox on my mail server.

The same question was raised by someone at the workshop. One solution is to
modify the router slightly: change 'lsearch' to 'lsearch*'

virtual_domains:
  driver = redirect
  domains = lsearch;/usr/exim/vdomains
  data = ${lookup{$local_part}lsearch*{/usr/exim/aliases-$domain}}
                              ^^^^^^^^
  no_more

Then you can put entries in /usr/exim/aliases-example.com of the form:

    sales:   mailbox123
    *:       mailbox456

in which case mail to 'sales at example.com' will get delivered to
'mailbox123', but mail to '<anythingelse> at example.com' will get delivered to
'mailbox456'

(changing 'lsearch' to 'lsearch*' means that if exim fails to find the value
it was looking up, it tries the lookup again for the value '*')

That gives you a lot of flexibility, but it still requires you to create a
separate file for each domain, which may have only one entry in it.

It's very easy to change the router so it just looks up the domain in a
single file:

virtual_domains:
  driver = redirect
  domains = lsearch;/usr/exim/vdomains
  data = ${lookup{$domain}lsearch{/usr/exim/vdomains}}
  no_more

In this case you have only one file, /usr/exim/vdomains, with entries like
this:

example.com:	mailbox123
example.net:	mailbox456

Mail to <anylocalpart> at example.com will be delivered to mailbox123, and mail
to <anylocalpart> at example.net will be delivered to mailbox456.

Notice the difference in the lookup expression:

  ${lookup{ VALUE-TO-LOOKUP } SEARCHTYPE { FILE }}

In the first case we told exim to lookup the local-part (left-hand side of
the address) in a file, whose name depended on the domain (right-hand side
of the address)

In the second case we tell exim to lookup just the domain in a single file.

Is that what you were looking for?

Regards,

Brian.

-----
This is the afnog mailing list, managed by Majordomo 1.94.5

To send a message to this list, e-mail afnog at afnog.org
To send a request to majordomo, e-mail majordomo at afnog.org and put
your request in the body of the message (i.e use "help" for help)

This list is maintained by owner-afnog at afnog.org