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

Re: qmail-local and maildirs



Hello Christian,

The problem is caused by the quota-calculation: qmail-local searches all
subdirectories of the homedir of the specified user. In the case of the
'alias'-user it needs to scan a _lot_ of homedirs. You can solve this by
assigning another homedir to your alias-user:
 /var/spool/mail/bluemars.de/alias
Of course it shouldn't crash: that's a bug. Until now i didn't spend much 
attention to it: using a separate homedir for 'alias' solves this problem.
There's a new version available now: 0.22pre2, which fixes this problem
It contains a few other changes too:
- quota are now calculated using only 1 file descriptor at once. This
  solves the 'process_cannot_open_more_files' problem but consumes more
  memory. You should avoid having a lot of subdirectories since this makes
  quota-calcuation slow. I tested it with 5800 homedirectories: go drink some
  coffee when delivering mail (or use a faster machine).
- quota are only calculated if necessary: if hardquota isn't '0'. This offers
  a second solution for the 'process_cannot_open_more_files': don't limit
  your alias-user with diskquota.
- spam-protection: qmail-sql will now only accept mails for existant
  users (if the domain is handled locally of course). This is very 
  experimental (although i'm using it now): it won't work well with logins
  containing a '-'. You can solve this however by adding a fake entry in
  the dotqmails-table. This feature should be explicitely activated with
  'allowed_recipients_from_db yes'
- qmail-getpw doesn't segfault anymore when invoked incorrectly. This is
  quite unimporant since qmail-getpw isn't meant to be invoked interactively
  but some people complain: 'it crashed' ... oh well ...
- little code-cleanup: the 'sqlconfig_t' structure is now always passed
  as first argument.

I also updated the rpm: it contains the new tls-patch of frederik vermeulen.

Regards,
Michael.

On Mon, Sep 23, 2002 at 12:16:26PM +0200, Christian Bauer wrote:
> Hi there,
> 
> I'm evaluating qmail-sql for my company and I really like the setup and
> layout of the database. But I run into trouble with one of my tests:
> 
> The database contains only an 'alias' user for the virtual_host
> 'bluemars.de':
> 
>   login   | uid | gid |     virtual_host     | use_dotqmail
> ----------+-----+-----+----------------------+--------------
>  alias    |   8 |  12 | bluemars.de          | f
> 
> The 'home' directory is '/var/spool/mail/bluemars.de' for this user.
> 
> Everything works as expected when only a .qmail-default file in the home
> directory of the alias user exists (a simple forwarding to a real e-mail
> account outside the system used for testing).
> 
> Even with some users in the same domain added, everythings fine (well, I
> suppose not, but it works), the schema is "use the login-id as a
> directory name":
> 
>  cb       |   8 |  12 | bluemars.de          | f
> 
> would have his 'home' directory set to:
> 
> /var/spool/mail/bluemars.de/cb
> 
> Well, I first noticed problems when adding about 20 more users and
> generating a lot of maildirectories in their homes:
> 
> test:/var/spool/mail/bluemars.de$ find . -type d | wc -l
>    3807
> 
> When I'm trying to deliver a mail locally to the domain 'bluemars.de', I
> get the following error in the maillog (no matter if a real or
> non-existant login-id is used):
> 
> Sep 23 12:05:58 newody qmail: 1032775558.276197 starting delivery 34:
> msg 2736249 to local foo@xxxxxxxxxxx
> Sep 23 12:06:39 newody qmail: 1032775599.153531 delivery 34: deferral:
> Unable_to_open_.qmail-foo:_process_cannot_open_more_files._(#4.3.0)/
> 
> An 'lsof' command shows that qmail-local is running wild and tries to
> recursively open every single maildir starting with the 'home' of the
> alias user:
> 
> qmail-loc 21111     root   73r   DIR        8,1    4096    2015234
> /var/spool/mail/bluemars.de/catchall
> qmail-loc 21111     root   74r   DIR        8,1    4096    2031618
> /var/spool/mail/bluemars.de/catchall/Maildir
> qmail-loc 21111     root   75r   DIR        8,1    4096    2080770
> /var/spool/mail/bluemars.de/catchall/Maildir/new
> qmail-loc 21111     root   76r   DIR        8,1    4096    2179074
> /var/spool/mail/bluemars.de/catchall/Maildir/cur
> 
> The OS-limit of open files is hit and the process terminated.
> 
> I'm really lost right now and don't now how and where to fix this.
> Any thoughts?
> 
> -- 
> BLUE MARS - Gesellschaft für digitale Kommunikation mbH                         
>                                                                                 
> Christian Bauer               mailto:christian.bauer@xxxxxxxxxxx 
> Technology Department         http://www.bluemars.de 
> Ebersheimstrasse 5            Tel: +49 (0)69 469973-00 
> 60320 Frankfurt/M.            Fax: +49 (0)69 469973-99
>