procmail
[Top] [All Lists]

Re: quotas and procmail..

1999-06-30 12:10:38
Christopher Neill asked,

| anyone know a way to get procmail to spool something off to your home
| directory if you are over your quota? also, can you have procmail
| spool off files that are larger than your quota (eg, can procmail
| check the size of a message?).

The last question is easy to answer: yes.  That's how "<" and ">" conditions
work.  Someone who has actually dealt with email administration can probably
post a better solution, and I don't like the overhead of a shell and wc for
each message in this, but here's a start:

 QUOTA=some_number

 :0HB
 * $ -$QUOTA^0
 * $ `wc -c < ${DEFAULT:-$ORGMAIL}`^0
 * 1^1 > 1
 { DEFAULT=$HOME/bigmail }

Yes, wc can read a filename as a positional parameter, but then it repeats
the filename in its output.  That's why the input redirector (and thus a
shell) are needed in the second condition.

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