Re: [Exim] Moving virtualhosting from qmail to exim

Pàgina inicial
Delete this message
Reply to this message
Autor: Steve Haslam
Data:  
A: exim-users
Assumpte: Re: [Exim] Moving virtualhosting from qmail to exim
On Fri, Aug 16, 2002 at 03:42:14PM +0200, Søren Hansen wrote:
> Qmail has this cool configurationfile called "virtualdomains". For each
> domain I'm hosting, I add a line like this:
>
> warma.dk:sh-warma-dk
>
> This means that mail for "foo@???" will be forwarded to
> sh-warma-dk-foo on the local machine.


If that's /etc/mail/virtualdomains, then add
"lsearch;/etc/mail/virtualdomains" to the "local_domains" setting, and write
a director like this:

qmail_virtualdomains:
driver = smartuser
domains = lsearch;/etc/mail/virtualdomains
new_address = ${lookup{$domain}lsearch{/etc/mail/virtualdomains}{$value-${local_part}}fail}

All done.

> With qmail each user has all the e-mail-addresses he wants. If a user is
> called bar, he has bar@localhost, bar-baz@localhost,
> bar-whatever@localhost.. All he has to do is create a file called
> ".qmail-whatever" containing:
> 1. Another e-mail address.
> 2. A program to pipe the mail to.
> 3. A local mailbox.
> 4. A combination (just add more lines to the file).
>
> And all mail to bar-whatever will be treated according to this file.


In the archives I think there's a description of how to set this up. It's
sth like:

userforward:
driver = forwardfile
file_transport = address_file
pipe_transport = address_pipe
reply_transport = address_reply
directory_transport = address_directory
check_ancestor
file = .forward${if exists {${home}/.forward${local_part_suffix}}{${local_part_suffix}} {-default}}
modemask = 002
filter
suffix = -*
suffix_optional

And so, for example, by putting "steve" in .forward-foo, I have mail to
steve-foo@??? coming into my mailbox. (Although the forward
file could pipe it to a process etc., or be a filter file).

> Scalability
> Qmail: I'm not sure how well it scales. Currently I have no trouble
> running my 10 domains, but how will it handle 10.000 using the same
> virtualhosting scheme?
> Exim: It can do stuff with a MySQL database, right? How?


Well, if you want to use the setup above but with lots more domains, the
first stage would be to compile the flat file to a dbm file and just replace
"lsearch" with "dbm".

I've used LDAP before now to manage address routing. Using SQL looks a bit
like this:

qmail_virtualdomains:
driver=smartuser
domains=mysql;SELECT user FROM virtualdomains WHERE domain = '$domain'
new_address = ${lookup mysql{SELECT user FROM virtualdomains \
WHERE domain = '$domain'}{$value-${local_part}}fail}

which would work with a MySQL containing columns "domain", "user".

I haven't actually tested these config framgents though 8) (Except the
userforward director is straight out of my exim.conf)

HTH

SRH
--
Steve Haslam      Reading, UK                           araqnid@???
Debian GNU/Linux Maintainer                               araqnid@???
Your heart has been ruptured and it will never heal
To get another heart you'll have to steal                    [leæther strip]