procmail
[Top] [All Lists]

Re: Email Counting!

1998-10-16 08:24:55
From: Kenny Nguyen <kenn(_at_)xuviet(_dot_)org>

 I'm wondering if anyone can help me with a recipe that counts how
many email msges in a mailbox and how much diskspace that mailbox has
taken up already.  Basically I"m trying to limit a pop account from
receiving lots of emails.  So if the diskspace has reached or the
number of emails exceeded the preset value then just dump the email or
bounce back.

People have published ways to do this inside procmail in the past.  One
easy way outside of procmail (using a process you call from within
procmail) is to rely on "messages", which is part of the elm package.

  8:03am /netcom10:~> messages
  There are 10 messages in your incoming mailbox.

"frm" also can count:

  8:08am /netcom10:~> frm -n -q -S
  You have 1 new message, 7 unread messages, 2 read messages.

You can also tell it to report only on one or the other of those
categories.

For size you could use df or ls, though there may be a method internal
to procmail that I don't know about.

--
    \     .-.     .-.     .-.     .-.     .-.     .-.     .-.     /
     \-d-/-m-\-a-/-n-\-(_at_)-/-n-\-e-/-t-\-c-/-o-\-m-/-.-\-c-/-o-\-m-/
      '-'     '-'     '-'     '-'     '-'     '-'     '-'     '-'

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