Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Dec 2000 22:24:53 +0000
From:      Gustavo Vieira Goncalves Coelho Rios <gustavo@ifour.com.br>
To:        Matt Simerson <mpsimerson@hostpro.com>
Cc:        "'freebsd-hackers@freebsd.org'" <freebsd-hackers@freebsd.org>
Subject:   Re: very big mail spool directory
Message-ID:  <3A36A5B5.A5332B83@ifour.com.br>
References:  <8D18712B2604D411A6BB009027F644980DD7D5@0SEA01EXSRV1>

next in thread | previous in thread | raw e-mail | index | archive | help
Matt Simerson wrote:
> 
> I do it a little bit differently for my million user mail server. Rather
> than perform any (more) hackery on my MTA/MDA than necessary, I set up each
> mail domain as it's own UID/GID on the system. This approach has some limits
> but so far it's working great for me. With FreeBSD's pw tool and a bit of
> scripting it's pretty simple to build yourself a
> /usr/home/a/aa/aar/aardvark.com style tree.
> 
> This type of solution has some great advantages. Since DNS (and consequently
> email addresses) is a hierarchy, it makes sense to keep the highest level
> (the domain name) mapping in one database. Qmail does this for us via it's
> users mechanism so we use that. When mail arrives qmail checks the
> /var/qmail/users/assign.cdb file and find's the username and home directory
> of domain owner. Qmail-local then mosies over to that directory
> (/usr/home/a/aa/aar/aardvark.com/) and obeys the contents of that domains
> .qmail processing. From there you can do whatever you'd like with mail for
> that domain.
> 
> I use the vpopmail (http://www.inter7.com/vpopmail) package which includes a
> vdelivermail program that gets called. So, your .qmail-default has a call to
> vdelivermail which checks the username and does a lookup in the vpasswd.cdb
> that's contained in the domains home dir.  There it finds the mail users
> actual mail directory and then drops it in there (subject to quota and other
> configurable limitations).
> 
> The vpopmail package also has some mechanisms built on so that if the number
> of users for a domain exceeds a given limit (I can't remember exactly how
> many) then it builds a hash tree.
> 
> Other than some compile time tuning, I leave the /var/qmail/queue untouched.
> 
> So, you end up with something like this:
> 
>    #grep test  /etc/passwd
>    test:*:1454:88:test.com:/usr/home/t/te/test:/sbin/nologin
> 
>    #grep test.com /var/qmail/users/assign
>    +test.com-:test.com:1454:88:/usr/home/t/te/test/domains/test.com:-::
> 
>    #more /usr/home/t/te/test/domains/test.com/vpasswd
>    test:*:1:0:testing:/usr/home/t/te/test/domains/test.com/test:1000000
>    test2:*:1:0:TEST2:/usr/home/t/te/test/domains/test.com/test2:10000000
> 
> Every mail message ends up with two database lookups (assign.cdb &
> vpasswd.cdb) but the databases are fairly compact and easy to replicate
> across an array of machines. It also means every authentication request
> (POP, IMAP, & webmail) also has two database lookups but again, the lookups
> are from small databases, very fast, and distributed across an array of
> machines. This is a very simplistic overview of how it works but so far it's
> been a good solution.
> 
> Best of luck to you.

Thanks for your response, but i some other questions raised:

How many users your get?

I would not enjoy having any system account for mail system. Qmail let
me use a single UID for everytinhg, since i will only need a pop account
that will allow me to retrieve the user mails. I will not need more than
a single uid/gid.

My ideia is to allow the more users served using the small number of
resources. Would my approach permit me that ?

Thanks again for your time and cooperation.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3A36A5B5.A5332B83>