procmail
[Top] [All Lists]

Re: Limiting Size of User's Mailbox

1995-11-12 13:14:25
Eric Woodward asked,

| Quick question.  Is there an easy way, without enforcing quotas, to stop
| procmail from delivering mail to a user's inbox if is greater than a
| certain size, and append append the incoming email somewhere else?

Well, in a way that *is* enforcing a quota, isn't it?

The only way I can think to do it requires forking wc; I can't come up with
one solely in procmailrc primitives.

Now here comes the question: do you want to check the size of the inbox
before the current letter is filed there, or do you want to check the size
it would be if the current letter were added?  If the latter, uncomment
the third and fourth lines; if the former and you're in version 3.10 or
earlier, remove the comment lines because those older versions of procmail
can't handle comment lines in the middle of recipes:

   ALT_BOX=/file/to/store/mail/in/if/inbox/is/too/big
   MAX_INBOX_SIZE=fill_in_maximum_inbox_size

   :0
   * $ -$MAX_INBOX_SIZE^0
   * $ `wc -c < $DEFAULT`^0
#  * 1^1 HB ?? .
#  * 1^1 HB ?? ^.*$
   { DEFAULT=$ALT_BOX }

If you're doing this in /etc/procmailrc, you might want to refer to ORGMAIL
instead of DEFAULT on the third line and on the last lne.

<Prev in Thread] Current Thread [Next in Thread>