From owner-freebsd-bugs Sun Nov 9 11:25:17 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id LAA29625 for bugs-outgoing; Sun, 9 Nov 1997 11:25:17 -0800 (PST) (envelope-from owner-freebsd-bugs) Received: from home.dragondata.com (toasty@home.dragondata.com [204.137.237.2]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id LAA29551; Sun, 9 Nov 1997 11:24:12 -0800 (PST) (envelope-from toasty@home.dragondata.com) Received: (from toasty@localhost) by home.dragondata.com (8.8.5/8.8.5) id NAA00752; Sun, 9 Nov 1997 13:23:37 -0600 (CST) From: Kevin Day Message-Id: <199711091923.NAA00752@home.dragondata.com> Subject: Re: bin/4925: sendmail ignores user quotas In-Reply-To: from Vasim Valejev at "Nov 3, 97 01:53:28 pm" To: vasim@diaspro.com (Vasim Valejev) Date: Sun, 9 Nov 1997 13:23:37 -0600 (CST) Cc: toasty@dragondata.com, freebsd-gnats-submit@FreeBSD.ORG, gnats@FreeBSD.ORG, freebsd-bugs@hub.freebsd.org X-Mailer: ELM [version 2.4ME+ PL31 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > Hi ! > > On Sun, 2 Nov 1997 toasty@dragondata.com wrote: > > >Description: > > Users can receive mail well over their hard space limit. I'd like to be able to stop this from happening. /var/spool/mail is on it's own partition, so I thought I could apply a quota to prevent users from getting mailbombed, and also from just saving too much mail on the server. > > > > repquota shows the correct amount used, and will even show them going over the hard limit, but sendmail still dumps more data in their mail file. > > > > Is this a bug? Probably not, but it's not really consistant behavior, as nearly every other service will stop when their limit is reached. > > > > It's problem in /usr/libexec/mail.local . This program open and write in > user's mailboxes under root . > > > >How-To-Repeat: > > Enable quotas, and send a ton of mail to a user with very little space left. > > >Fix: > > Possible fix (not tested) for /usr/src/libexec/mail.local/mail.local.c : > > *** mail.local.c.orig Sat Oct 25 14:09:39 1997 > --- mail.local.c Mon Nov 3 13:24:53 1997 > *************** > *** 266,271 **** > --- 266,287 ---- > } > } > > + if (mbfd == -1) { > + e_to_sys(errno); > + warn("%s: %s", path, strerror(errno)); > + return; > + } > + > + close(mbfd); > + > + if (setuid(pw->pw_uid) < 0) > + { > + e_to_sys(errno); > + warn("%d: %s", pw->pw_uid, strerror(errno)); > + return; > + } > + > + mbfd = open(path, O_APPEND|O_WRONLY, 0); > if (mbfd == -1) { > e_to_sys(errno); > warn("%s: %s", path, strerror(errno)); > I'm not sure if this is related or not, but when a user over their quota got another message, there suddenly were thousands of 'mail.local' processes running, all trying to send mail to that user... It had otherwise worked perfectly before. Kevin