procmail
[Top] [All Lists]

Re: procmail+sendmail quota warning system?

2001-10-18 07:21:24
At 02:46 AM 10/18/2001, Evren Yurtesen wrote:
Hello,
Is it possible to make procmail work like so that
when the user is low in quota he/she will receive a
quota warning? (not the sender of the email also the receiver)
Evren

If you tie it to mail delivery, yes.  You could check before (easiest)
or after each mail delivery.

My choice would be to put all the logic in an external script to
avoid cluttering up the .procmailrc.  Doing that before each mail
delivery, something like:
        :0chi:
        | quota-checking-script

To do it after the delivery, I think you'd use the TRAP variable
in your .procmailrc, but since I never have used it I would
undoubtedly mess up the example, so I won't give one.

Then the logic of the "quota-checking-script" (details I'll leave to
you) would go something like:
        1.  If (warning message was already sent recently) then exit
        2.  Parse "quota -v" command
        3.  If (too close to quota) then send message to the user

"Already sent recently" can be an easy or difficult test depending
how fussy you are.  If once per calendar day is OK, then just write
Month, Day, Year from the "From " header into a file, and compare
those with those on each message to see if they've changed.  Or,
you could just use a file semaphore--create it when you send the
message, don't send the message when it exists, and then manually
delete the semaphore when you clean up the disk space... that gets
you just one message until you act on the problem.

Cheers,
Stan

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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