# qmail User_over_quota._(#5.1.1)/

## x-router.com

This has been driving me insane for days...

I've fresh installed qmail. Added fast forward. Created a local user called 'richard' added a .maildir chown'ed richard:users chmoded drwxr-xr-x

Mail delivery seems to be going fine but I always get a reject:

```

@4000000040041ab51018819c new msg 1403936

@4000000040041ab510189cf4 info msg 1403936: bytes 184 from <richard@x-router.com> qp 26948 uid 201

@4000000040041ab511c946ac starting delivery 35: msg 1403936 to local richard@businesswebsite.com

@4000000040041ab511c969d4 status: local 1/10 remote 0/20

@4000000040041ab51219cbf4 delivery 35: failure: User_over_quota._(#5.1.1)/

```

I don't have quotas on the file system (although I will want them later on) and as user 'richard' I can create files etc in that dir. If I remove the .maildir then delivery fails with a different error..

All the alias fast forwarding works fine, it's only local deliver that fails

My config files: (I've had to cut a lot of crap out as there are about 1000 domains. I'm trying to convert my sendmail cluster over)

```

uber qmail # cat rc

#!/bin/sh

 

exec env - PATH="/var/qmail/bin:$PATH" \

        qmail-start "`grep -v '^#' /var/qmail/control/defaultdelivery`"

uber control # cat me

uber.whitehorse.co.uk

uber control # cat locals | grep business

businesswebsite.net

businesswebsite.co.uk

businesswebsite.com

businesswebsite.tv

businesswebsite.info

businesswebsite.biz

centralbusinessagency.co.uk

centralbusinessagency.com

uber control # cat rcpthosts | grep business

businesswebsite.net

businesswebsite.co.uk

businesswebsite.com

businesswebsite.tv

businesswebsite.info

businesswebsite.biz

centralbusinessagency.co.uk

centralbusinessagency.com

uber control # cat defaultdelivery

# Uncomment the next line for .forward support

#|dot-forward .forward

./.maildir/

uber alias # cat .qmail-default

|fastforward -d /etc/aliases.cdb

```

Any help will be very welcome.[/code]

----------

## x-router.com

Think I have figured it out.

Because I created the user dir before I installed qmail the /etc/skel qmail files wern't in there. So even tho I created .maildir there was no .qmail.

Why this would cause an over quote message tho is any bodies guess.

If i adduser -m it works fine.

----------

## skunkworx

The .qmail file shouldn't be necessary.  An empty .qmail file tells qmail to use the default delivery instructions, which in this case is supposed to be the same thing as having no .qmail file at all.

My only guess is to check if you have quotas enabled anywhere on your server.  Perhaps user richard has quota restrictions on a file system that qmail uses, and that is making qmail believe richard does not have enough room in his home directory.  I wouldn't bet on this too highly, however, since qmail has a reputation of not making such pratfalls.

If you don't get any further help here, you can try the qmail mailing list.  Links to subscription information and also to the older message archives are available at qmail.org.

----------

## x-router.com

Quotas are not on this sytem atm. It was installed only to be a mail forwarder and all I have put on is qmail so far. I removed and created the user on the same file system.

I googled up this which seems to suggest someone is having the same problem:

http://msgs.securepoint.com/cgi-bin/get/qmail0312/264/1/1.html

One thing i notice is this:

```

uber bin # ls -al /home/richard/.maildir

total 20

drwx------    5 richard  users        4096 Jan 14 10:39 .

drwx------    3 richard  users        4096 Jan 14 10:39 ..

drwx------    2 richard  users        4096 Jan 14 10:39 cur

drwx------    2 richard  users        4096 Jan 14 15:16 new

drwx------    2 richard  users        4096 Jan 14 15:16 tmp

```

I had only created .maildir not these dirs inside. It would appear qmail needs them as well hence the -m.

I will experement a bit to see if this is the case.

----------

## skunkworx

Yes, the .maildir directory definitely needs the cur, new, and tmp directories within it.  That's all part of the maildir format.

Missing those directories shouldn't have given you a quota error, however, I'm inclined to think that with the zillion patches the Gentoo ebuild throws into qmail, something along the way is causing the wrong error message to be displayed under these circumstances.

If you're feeling generous, here's something you can do in your experiments.  Test a system user who doesn't have any .qmail files in his home directory, and see what message you get in the following situations: no .maildir directory at all, a .maildir directory without subdirectories, and then a properly formatted .maildir directory.  If any one of those gives you the quota message, then you can file a bug report in Bugzilla for the maintainers (assuming a bug hasn't been filed already).

I'm assuming you're on the latest stable ebuild, 1.03-r13, but of course be sure you mention which ebuild you're using if you decide to file a bug report.

----------

## ptman

I can confirm this also. Same kind of situation. I installed qmail after creating the user, so the .maildir -directory wasn't complete.

----------

## robbat2

looking at the qmail source, it doesn't catch the special case of a broken Maildir structure (which should _never_ happen). 

The code in question:

```

if (chdir(dir) == -1) { if (error_temp(errno)) _exit(1); _exit(2); }

if (maildir_getquota(dir, quotabuf) == 0) {

  if (user_over_maildirquota(dir,quotabuf)==1) {

   _exit(1);

  }

 }

```

so the chdir() succeeds, but the getquota check fails due to non-existance of the directories. (getquota first checks for a special quota file, if not exists then sum up the directory (cur/new/tmp) manually, which fails).

either use maildirmake to create the maildir directories, or create them properly. I strongly recommend using maildirmake, as then if you install courier-imap, it's maildirmake is pathed before the one from qmail, and you get it's special features (better quota stuff and more).

----------

## jkroon

I suspect the problem is with the maildir++ patch.  I'm still reading but I suspect that somehow the quota doesn't get initialised properly if no quota is specified.

Actually specifying the quota is done by having some kind of maildirsize file (not sure whether this is the actual size used, size limit or size left - the maildir++ spec will probably have more info on that).

Will report back when I have more info.

----------

## jkroon

Yea, backing out the maildir++ patch solved the problem for me.  Well, at least I haven't had any more cases where I received User over quota warnings in a couple of hours now.  This could be luck, but I had them at about 3 or 4 by the hour so I seriously doubt the problem will persist.  I looked at the source for the patch a bit but not in enough depth yet to understand why this happens, will attempt to do so later.

----------

## orange_juice

Hallo! Although I do not use quotas, I seem to be experiencing the same problem. How can I back out the maildir++ patch?

I have also noticed the following: This is the second gentoo-box I am building. The first one is with a kernel tailored strictly to this box. Q-mail works perfectly. 

The second one I am currently building is running on genkernel. This is the one with the quota problem. However, there is nothing that relates to quota enabled in the kernel

```
grep QUOTA /usr/src/linux/.config

# CONFIG_XFS_QUOTA is not set

# CONFIG_QUOTA is not set

```

----------

## orange_juice

I found the solution! 

http://www.courier-mta.org/imap/?README.maildirquota.html

http://nixdoc.net/files/forum/about58233.html

```
maildirmake .maildir -q 10000000S
```

----------

## jkroon

Haven't read those fully but the problem is the fact that FAM works way too damn well.  See https://bugs.gentoo.org/show_bug.cgi?id=56124 for a thorough explanation of why the link-sync (not maildir++, maildir++ negates the need for the deliverquota from what I understand - I don't use quotas) patch caused problems.  It's backed out of -r16 iirc.  I was initially convinced that it was the maildir++ patch, I was, however, wrong.  This is explained from about comment number 10 onwards in that bugreport.  Especially comment 23 describes the problem in detail.

----------

## orange_juice

According to those links, the problem springs from the quotas set while creating the /home/user/.maildir. 

```
maildirmake .maildir -q 10000000S
```

What I did, is that I created the .maildir with the above command (logged as "user" in the /home/user directory, not "root") and everything is set to normal. 

-q: sets the quota

 10000000S = 10MB 

Thank you for your help.

Kind regards

orange_juice

----------

## jkroon

different problem then.  glad you solved it.

----------

## orange_juice

Seems to be so... I wish I could help but I am not so computer litterate...    :Rolling Eyes: 

----------

