From owner-freebsd-hackers Tue Dec 12 16:26:15 2000 From owner-freebsd-hackers@FreeBSD.ORG Tue Dec 12 16:26:13 2000 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from ifour.com.br (unknown [200.236.148.68]) by hub.freebsd.org (Postfix) with SMTP id A836D37B400 for ; Tue, 12 Dec 2000 16:26:10 -0800 (PST) Received: (qmail 68948 invoked from network); 12 Dec 2000 21:33:11 -0000 Received: from port89.tdnet.com.br (HELO ifour.com.br) (200.236.148.189) by midas.ifour.com.br with SMTP; 12 Dec 2000 21:33:11 -0000 Sender: grios@FreeBSD.ORG Message-ID: <3A36A5B5.A5332B83@ifour.com.br> Date: Tue, 12 Dec 2000 22:24:53 +0000 From: Gustavo Vieira Goncalves Coelho Rios X-Mailer: Mozilla 4.72 [en] (X11; I; FreeBSD 4.2-STABLE i386) X-Accept-Language: en MIME-Version: 1.0 To: Matt Simerson Cc: "'freebsd-hackers@freebsd.org'" Subject: Re: very big mail spool directory References: <8D18712B2604D411A6BB009027F644980DD7D5@0SEA01EXSRV1> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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