Mailing List Archive

Disk Quotas & Qmail = no go??
My goal:

To have disk quotas on my mail server. When someone exceeds their quota I
would like Qmail to bounce new messages back to the sender and say
something like "Sorry, the user doesn't have any space left in their
mailbox. Try again later"


I have qmail .096 running on a Solaris 2.5.1 x86 box. It works great. I
enabled quotas on the file system, and I'm trying some tests. Somehow
qmail is able to deliver mail into a user's Mailbox file even if their
quota is exceeded.

For example:

[root@mail]> quota -v someguy
Disk quotas for someguy (uid 13):
Filesystem usage quota limit timeleft files quota limit
timeleft
/ 12 5 10 EXPIRED 6 500 500

The account "someguy" is over their 10k disk quota by 2k. I now send them
an email message.

Then,

[root@mail]> quota -v someguy
Disk quotas for someguy (uid 13):
Filesystem usage quota limit timeleft files quota limit
timeleft
/ 13 5 10 EXPIRED 6 500 500


qmail was able to deliver the message to the user even though they were
over their disk quota. This is not desirable. The quotas exist for a
reason.


If I "su - someguy" and try to copy files etc, I get error message that
I'm over my quota and I'm prevented from using any more disk blocks.


What am I doing wrong?

Dax Kelson
Internet Connect, Inc.
Re: Disk Quotas & Qmail = no go?? [ In reply to ]
On Fri, 21 Feb 1997, Dax Kelson wrote:

> Date: Fri, 21 Feb 1997 19:22:10 -0700 (MST)
> From: Dax Kelson <dkelson@inconnect.com>
> To: djb-qmail@koobera.math.uic.edu
> Subject: Disk Quotas & Qmail = no go??
>
>
> My goal:
>
> To have disk quotas on my mail server. When someone exceeds their quota I
> would like Qmail to bounce new messages back to the sender and say
> something like "Sorry, the user doesn't have any space left in their
> mailbox. Try again later"
>
>
> I have qmail .096 running on a Solaris 2.5.1 x86 box. It works great. I
> enabled quotas on the file system, and I'm trying some tests. Somehow
> qmail is able to deliver mail into a user's Mailbox file even if their
> quota is exceeded.
>
> For example:
>
> [root@mail]> quota -v someguy
> Disk quotas for someguy (uid 13):
> Filesystem usage quota limit timeleft files quota limit
> timeleft
> / 12 5 10 EXPIRED 6 500 500
>
> The account "someguy" is over their 10k disk quota by 2k. I now send them
> an email message.
>
> Then,
>
> [root@mail]> quota -v someguy
> Disk quotas for someguy (uid 13):
> Filesystem usage quota limit timeleft files quota limit
> timeleft
> / 13 5 10 EXPIRED 6 500 500
>
>
> qmail was able to deliver the message to the user even though they were
> over their disk quota. This is not desirable. The quotas exist for a
> reason.
>
>
> If I "su - someguy" and try to copy files etc, I get error message that
> I'm over my quota and I'm prevented from using any more disk blocks.
>
>
> What am I doing wrong?
>
> Dax Kelson
> Internet Connect, Inc.
>
>
>

Have you applied patches to this system? I have never seen this happen.

All my over-quota mail gets stuck in the queue for a week....

David Wayne Summers "Linux: The choice of a GNU generation."
david@summersoft.fay.ar.us PGP Public Key available on request.
PGP Key fingerprint = C0 E0 4F 50 DD A9 B6 2B 60 A1 31 7E D2 28 6D A8
Re: Disk Quotas & Qmail = no go?? [ In reply to ]
-----BEGIN PGP SIGNED MESSAGE-----

On Fri, 21 Feb 1997, Dax Kelson wrote:

>
> My goal:
>
> To have disk quotas on my mail server. When someone exceeds their quota I
> would like Qmail to bounce new messages back to the sender and say
> something like "Sorry, the user doesn't have any space left in their
> mailbox. Try again later"

speaking personally this really bugs me. if your system cannot cope
with mail your users are receiving then your postmaster should recevie your
messages as your postmaster is probably the only person who can do something
about it, like buy some more disk space.

As someone who manages lists [hey don't we all here?] I hate this sort of
bounce message as the subscriber gets annoyed when they are taken off the
list.

A compromise solution might be to queue the message for delivery for a
week before returning to sender, in that way transient problems don't
cause rejection.

Richard
+----------------------------+
| richard@illuin.demon.co.uk | Aut viam inveniam aut faciam
+----------------------------+

-----BEGIN PGP SIGNATURE-----
Version: 2.6

iQCVAgUBMw7lHJ6bDk8vHTn1AQF9mgP+LpOjnUUGB/71Zcp1oo9MJzxnhVVcJ7lx
OagKwsEL99qvsmuy3ShfcT9XHSNb0wsNUVVqut0dDs9a/AjEMQOJdPs0Hg2ZPj1N
eMwG7HpHSRhUQQDLsrjA7xwrO2AmhyEcspDFZcAgpTFQ/VVdOramn9aJrwl0BtIG
aURCQliuAKw=
=JAlt
-----END PGP SIGNATURE-----
Re: Disk Quotas & Qmail = no go?? [ In reply to ]
Richard Letts writes:
>
> A compromise solution might be to queue the message for delivery for a
> week before returning to sender, in that way transient problems don't
> cause rejection.
>

Exactly. Sounds like Dax wants a .qmail file of the following form.
It presumes the existance of a ``overquota'' program that checks to
see if stdin would cause the user to go overquota if written to the
current filesystem. If this program says yes, then the delivery exits
with a soft error. This will be retried up to a week.

|if overquota; then exit 111; fi
./Mailbox

--
-russ <nelson@crynwr.com> http://www.crynwr.com/~nelson
Crynwr Software sells network driver support | PGP ok
521 Pleasant Valley Rd. | +1 315 268 1925 voice | Peace, Justice, Freedom:
Potsdam, NY 13676-3213 | +1 315 268 9201 FAX | pick two (only mostly true)
Re: Disk Quotas & Qmail = no go?? [ In reply to ]
> > something like "Sorry, the user doesn't have any space left in their
> > mailbox. Try again later"
>
> speaking personally this really bugs me. if your system cannot cope
> with mail your users are receiving then your postmaster should recevie your
> messages as your postmaster is probably the only person who can do something
> about it, like buy some more disk space.

Half the time it's a system with insufficient disk space, but the other
half of the time it's a user who doesn't pick up his mail often enough, or
sets his POP mail client to leave everything on the server "just in case",
or goes away for two weeks without turning off his mailing lists.

Deferring for a day or two seems to me a reasonable compromise for people
who get unexpected peaks in their incoming mail.

Regards,
John Levine, johnl@iecc.com, http://iecc.com/johnl, Trumansburg NY
Primary Perpetrator of "The Internet for Dummies"
and Information Superhighwayman wanna-be
Re: Disk Quotas & Qmail = no go?? [ In reply to ]
Richard Letts writes:

> To have disk quotas on my mail server. When someone exceeds their quota I
> would like Qmail to bounce new messages back to the sender and say
> something like "Sorry, the user doesn't have any space left in their
> mailbox. Try again later"

speaking personally this really bugs me. if your system cannot cope
with mail your users are receiving then your postmaster should recevie your
messages as your postmaster is probably the only person who can do something
about it, like buy some more disk space.

What do you propose that I do for the students who sit down in the
computer lab and mail themselves the entire contents of a CD-ROM ---
10 times? The freshman flame artist who gets mailbombed with a few
hundred megabytes of core files? Or the faculty member who leaves
10,000 messages in his inbox dating back to 1994? There's not enough
disk space to be had to deal with these folks - and these things
happen several times a week during the peak craziness.

I bounce immediately when the recipient is over quota. Anything else
is unsupportable in my environment. My only obligation is to provide
a timely notice of non-delivery if the recipient is exceeding their
quota.

The mods to qmail to do immediate return for a mailbox quota full
condition are pretty simple, as is an environment variable MAXSMTPMSG
limiting the size of incoming SMTP mail for qmail-smtpd. As I
understand the licensing of qmail I can't send anyone diffs but I'd be
happy to describe the changes I made in a previous version when I was
checking this out.

--
Jeff Hayward
Re: Disk Quotas & Qmail = no go?? [ In reply to ]
> qmail was able to deliver the message to the user even though they were
> over their disk quota.

Sounds like a bug in Solaris. qmail-alias, which does the delivery, is
just another process running as the user. If the system returns EDQUOT
for write(), qmail-alias will defer delivery.

> If I "su - someguy" and try to copy files etc, I get error message that
> I'm over my quota and I'm prevented from using any more disk blocks.

Try running qmail-alias manually in that situation to append data to an
existing file. Get a syscall trace.

---Dan
Let your users manage their own mailing lists. http://pobox.com/~djb/qmail.html
Re: Disk Quotas & Qmail = no go?? [ In reply to ]
On Sun, 23 Feb 97 9:46:45 CST, Jeff Hayward wrote:

>limiting the size of incoming SMTP mail for qmail-smtpd. As I
>understand the licensing of qmail I can't send anyone diffs but I'd be
>happy to describe the changes I made in a previous version when I was
>checking this out.

Do you mean to say that providing the context is enough to violate the
copyright? Otherwise, the dist policy only prevents you from distributing
modified versions of qmail, not from distributing patches. You could even make
the patch version and position specific, which wouldn't include anything from
qmail at all.

Surely, there must be a way to disseminate useful patches that each recipient
of the "pristine" distribution can apply, should they wish to do so.

-Sincerely, Fred

(Frederik Lindberg, Infectious Diseases, WashU, St. Louis, MO, USA)
Re: Disk Quotas & Qmail = no go?? [ In reply to ]
On 23 Feb 1997, D. J. Bernstein wrote:

> Date: 23 Feb 1997 18:30:23 -0000
> From: "D. J. Bernstein" <djb@koobera.math.uic.edu>
> To: djb-qmail@koobera.math.uic.edu
> Subject: Re: Disk Quotas & Qmail = no go??
>
> > qmail was able to deliver the message to the user even though they were
> > over their disk quota.
>
> Sounds like a bug in Solaris. qmail-alias, which does the delivery, is
> just another process running as the user. If the system returns EDQUOT
> for write(), qmail-alias will defer delivery.
>
> > If I "su - someguy" and try to copy files etc, I get error message that
> > I'm over my quota and I'm prevented from using any more disk blocks.
>
> Try running qmail-alias manually in that situation to append data to an
> existing file. Get a syscall trace.
>
> ---Dan
> Let your users manage their own mailing lists. http://pobox.com/~djb/qmail.html
>

I'm guessing he hasn't applied any or at least some patches. It defers
the mail for my 2500 users when they are over quota.

David Wayne Summers "Linux: The choice of a GNU generation."
david@summersoft.fay.ar.us PGP Public Key available on request.
PGP Key fingerprint = C0 E0 4F 50 DD A9 B6 2B 60 A1 31 7E D2 28 6D A8
Re: Disk Quotas & Qmail = no go?? [ In reply to ]
Jeff Hayward writes:

> The mods to qmail to do immediate return for a mailbox quota full
> condition are pretty simple, as is an environment variable MAXSMTPMSG
> limiting the size of incoming SMTP mail for qmail-smtpd. As I
> understand the licensing of qmail I can't send anyone diffs but I'd be
> happy to describe the changes I made in a previous version when I was
> checking this out.

If you could explain to a judge how diff -u and patch work in concert,
you could almost certainly get away with claiming fair use. And even
if you couldn't, you could have diff issue an ed script that changes
old into new.

--
-russ <nelson@crynwr.com> http://www.crynwr.com/~nelson
Crynwr Software sells network driver support | PGP ok
521 Pleasant Valley Rd. | +1 315 268 1925 voice | Peace, Justice, Freedom:
Potsdam, NY 13676-3213 | +1 315 268 9201 FAX | pick two (only mostly true)