Subject: Quota on imapd

From: "Marco Antonio V. Assad" <[email-masked]>
Date: Tue, 1 Aug 2000 18:10:19 -0300

Hi,

I'm new in this list and tried to find something in the c-client archive
before sending this question to the list, but as I could not contact the ftp
server, here we go.

I'm trying to set quotas in the filesystem where my imap mailboxes are
located. My /var/spool/mail and user's home directories are in the same
filesystem. If I just use unix format mailboxes, everything runs fine, even
procmail are denied to append a message to a mailbox where the user quota
are gone. I use red hat 6.2 (kernel 2.2.14)and imapd 4.7.

My problem begins when I use mbx format mailboxes, that are faster and
recommneded by UW. I think I have found a kind of 'deadlock' in the
following situation: A user have, for example a 10MB quota, and his existing
mailboxes use 8MB. If he receives a message that's 1.5MB in size, procmail
can deliver it to his unix mailbox (/var/spool/mail/$user), in a total of
9.5MB. Everything is still fine. But when the user tries to contact the imap
server, the imap tries to transfer this new message to his mbx INBOX that is
under his home directory, but it can't, I think because it runs in user
space and tries to delete the message from /var/spool/mail just after
copying it to INBOX, so in the meanwhile the quota expires. As a
consequence, the transfer is not done and the user can't even access his
existing INBOX to try to delete some messages, and the root intervention is
needed to solve the situation, maybe increasing temporarily the quota.

Any suggestions?

Thanks in advance.

-- 
------------------------------------------------------------------
 For information about this mailing list, and its archives, see: 
 http://www.washington.edu/imap/c-client-list.html
------------------------------------------------------------------

---

From: Mike Trank <[email-masked]>
Date: Tue, 1 Aug 2000 15:38:18 -0600 (CST)

Are you sure that your mailboxes are really mbx format? Procmail does
"unix" type delivery to /var/spool/mail/<username>, unless you fixed up
something special with the "/etc/procmailrc".

If you are using mbx format, you will want the mail to be directly
delivered to the INBOX file in the user's home directory, instead of
having procmail copy it to /var/spool/mail/<username>.

The way that you do the mbx delivery is with the "tmail" program, which is
a separate download from the imap-2000 archive. It also has some stuff for
converting mailboxes from unix format to mbx. tmail doesnt do anything to
/var/spool/mail/<username>, and you should get rid of those files so that
imapd, ipop3d and any other c-client program that you write go straight to
the $HOME/INBOX file. 

That means that you will want "/home" to be a really big filesystem,
because all the mail will be stored there.

---

From: "Marco Antonio V. Assad" <[email-masked]>
Date: Wed, 2 Aug 2000 10:20:36 -0300

> something special with the "/etc/procmailrc".

Yes, they are. I have downloaded imap-tools from UW and know about the
utilities, and have created the mbx mailboxes using mbxcreat. Here, mail are
delivered in unix stile mailboxes by procmail and imapd transfers mail to
the mbx mailbox.

> imapd, ipop3d and any other c-client program that you write go straight to

Well, I know about tmail and thought that delivering directly to the mbx
mailbox would be the solution. I understand that I would have to use the "-I
#driver.mbx/INBOX". But as the man page for tmail states, if I use -I, tmail
has to be set up suid root, and if I do that, I think it won't honor my
quota when delivering mail, that's why I'm trying to avoid it and continue
using procmail.

---

From: Ricardo Stella <[email-masked]>
Date: Wed, 02 Aug 2000 12:54:45 -0400

Sounds like you are using the MBOX driver to pull mail from /var/mail
into the users's home directory...

Then you would have a mail quota and a home directory quote...

procmail is delivering to /var/mail and then the IMAP server moves it
into the user's directory in mbx format... What about using tmail to
deliver directly into the user's home directory, in mbx format ?  You
would have to deal with one quota only...

My .02...

-- 
------------------------------------------------------------------
 Ricardo Stella                                  O.I.T.
 (609)896-5000 x7436           _suAve_           Rider University
  *** Remove 'no-spam' from e-mail address before replying.  ***

---

From: Mark Crispin <[email-masked]>
Date: Wed, 2 Aug 2000 13:23:32 -0700 (PDT)

On Wed, 2 Aug 2000 10:20:36 -0300, Marco Antonio V. Assad wrote:
> But as the man page for tmail states, if I use -I, tmail

tmail has to be setuid root, since it needs to be able to setuid to the user
that it delivers mail to.  But before doing any file I/O, tmail is setuid to
the user and no longer to root, and as such it honors quotas.

You should not need -I.  If tmail is built with a c-client that has
CREATEPROTO set to mbx, tmail will use the mbx format.