From nobody  Sun Nov  2 22:07:26 1997
Received: (from nobody@localhost)
          by hub.freebsd.org (8.8.7/8.8.7) id WAA09558;
          Sun, 2 Nov 1997 22:07:26 -0800 (PST)
          (envelope-from nobody)
Message-Id: <199711030607.WAA09558@hub.freebsd.org>
Date: Sun, 2 Nov 1997 22:07:26 -0800 (PST)
From: toasty@dragondata.com
To: freebsd-gnats-submit@freebsd.org
Subject: sendmail ignores user quotas
X-Send-Pr-Version: www-1.0

>Number:         4925
>Category:       bin
>Synopsis:       sendmail ignores user quotas
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Nov  2 22:10:01 PST 1997
>Closed-Date:    Sat Apr 25 23:50:22 PDT 1998
>Last-Modified:  Sat Apr 25 23:50:42 PDT 1998
>Originator:     Kevin Day
>Release:        2.2.1-RELEASE
>Organization:
DragonData
>Environment:
FreeBSD home.dragondata.com 2.2.1-RELEASE FreeBSD 2.2.1-RELEASE #0: Thu Sep 25 0
0:27:55 CDT 1997     toasty@home.dragondata.com:/usr/src/sys/compile/HOME  i386
>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.

>How-To-Repeat:
Enable quotas, and send a ton of mail to a user with very little space left.
>Fix:

>Release-Note:
>Audit-Trail:

From: Vasim Valejev <vasim@diaspro.com>
To: toasty@dragondata.com
Cc: freebsd-gnats-submit@FreeBSD.ORG, GNATS Management <gnats@FreeBSD.ORG>,
        freebsd-bugs@hub.freebsd.org
Subject: Re: bin/4925: sendmail ignores user quotas
Date: Mon, 3 Nov 1997 13:53:28 +0500 (ES)

 Hi !
 
 On Sun, 2 Nov 1997 toasty@dragondata.com wrote:
 
 > >Number:         4925
 > >Category:       bin
 > >Synopsis:       sendmail ignores user quotas
 > >Confidential:   no
 > >Severity:       non-critical
 > >Priority:       low
 > >Responsible:    freebsd-bugs
 > >State:          open
 > >Class:          sw-bug
 > >Submitter-Id:   current-users
 > >Arrival-Date:   Sun Nov  2 22:10:01 PST 1997
 > >Last-Modified:
 > >Originator:     Kevin Day
 > >Organization:
 > DragonData
 > >Release:        2.2.1-RELEASE
 > >Environment:
 > FreeBSD home.dragondata.com 2.2.1-RELEASE FreeBSD 2.2.1-RELEASE #0: Thu Sep 25 0
 > 0:27:55 CDT 1997     toasty@home.dragondata.com:/usr/src/sys/compile/HOME  i386
 
 2.2-STABLE and 3.0-CURRENT too :( .
 
 > >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 t oo 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));
 
 > 
 > >Audit-Trail:
 > >Unformatted:
 > 
 
 Vasim V. (2:5011/27 http://members.tripod.com/~Vasim VV86-RIPE)
 

From: Kevin Day <toasty@home.dragondata.com>
To: vasim@diaspro.com (Vasim Valejev)
Cc: toasty@dragondata.com, freebsd-gnats-submit@FreeBSD.ORG, gnats@FreeBSD.ORG,
        freebsd-bugs@hub.freebsd.org
Subject: Re: bin/4925: sendmail ignores user quotas
Date: Sun, 9 Nov 1997 13:23:37 -0600 (CST)

 > 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

From: Kevin Day <toasty@home.dragondata.com>
To: freebsd-gnats-submit@freebsd.org
Cc:  Subject: Re: bin/4925: sendmail ignores user quotas
Date: Sun, 26 Apr 1998 01:30:29 -0500 (CDT)

 This PR can be closed - it's fixed in 2.2 and -current
 
 
 Kevin
State-Changed-From-To: open->closed 
State-Changed-By: phk 
State-Changed-When: Sat Apr 25 23:50:22 PDT 1998 
State-Changed-Why:  
Kevin told us to :-) 
>Unformatted:
