Subject: Re: Mail and quotas
To: None <current-users@NetBSD.ORG>
From: Christos Zoulas <christos@deshaw.com>
List: current-users
Date: 11/28/1995 00:33:48
In article <199511271436.OAA05968@orchard.medford.ma.us> sommerfeld@orchard.medford.ma.us (Bill Sommerfeld) writes:
>-----BEGIN PGP SIGNED MESSAGE-----
>
>> Kevin Sullivan writes:
>> > On my NetBSD-current machines I have strict quotas in /var/mail.  (The
>> > users tend to leave things in their mail spool, so this encourages them
>> > to clean up often.)  However, people's mailboxes still grow past their
>> > quota.  I believe this is because mail.local runs as root and thus
>> > doesn't care about quotas.
>> > 
>> > I'd call this a bug in mail.local.  Is there a way to fix this besides
>> > hacking mail.local?
>> 
>> No, but wouldn't a simple mail.local hack to check the size of the
>> mailbox and return an appropriate error to sendmail be better than
>> having it die with a quota problem?
>
>What we did at MIT-Athena back in 1985 or so was to have /bin/mail
>(then used as the mail.local equivalent) set it's uid to the
>delivered-to user before opening & writing to the mailbox; that way,
>the quota was enforced.
>
>In the event of a write failure, it would exit with one of the
>well-known exit codes in sysexits.h so sendmail would clean up
>sensibly.  I think we used EX_TEMPFAIL, but it's been a while...
>
>For various reasons, I don't think this actually got deployed before
>Athena switched to using POP exclusively.
>

We deliver to $HOME/.MailBox at work, and this works great. As a side
effect it avoids the problem when the .forward file is not honored when
the home directory is unavailable, since both the .forward file and the
mailbox file are in the same directory. If anyone is interested, I can
post the code to deliver.c, the local mailer delivery program. We have
been using it for more than 3 years, so I think that it has had more than
a fair amount of testing :-)

christos