procmail
[Top] [All Lists]

Re: diskquota auto-responder?

2001-05-14 17:23:17
Thanks for the great recipe.

I slightly modified the recipe written by wadem(_at_)suwanneevalley(_dot_)net
because I want to put this recipe in /etc/procmailrc so that it works 
for any user on a system.  To get the "best" from address,
I used Alan Stebbins' get-from.rc from his procmail-lib.

What I don't like about the recipe is that I get the original email
in my mailbox.  I want it to just being deleted
and only the 'quota -v' results getting sent to the user.

e.g. I get:
 N146 Dave Robbins       Mon May 14 16:37   11/400   show diskquota
 N147 Dave Robbins       Mon May 14 16:37   21/874   Re: show diskquota

I only want the reply.

If this is no longer the "best" from address, I'd appreciate
knowing a better method of obtaining it because
FROM=`formail -xFrom:` doesn't work.

Dave

--
SHELL=/bin/sh                # whatever shell you want it to use
SENDMAIL=/usr/lib/sendmail   # where to look for the MTA

# get-from.rc from Alan Stebbins
:0
* ! ^Reply-to: *\/[^ ].*
* ! ^From: *\/[^ ].*
* ! ^Sender: *\/[^ ].*
* ! ^From +\/[^ ]+
* ! ^X-Envelope: *\/[^ ].*
{ FROM=nobody }
:0E
{ FROM=$MATCH }

# diskquota autoresponder from Mr. Wade <wadem(_at_)suwanneevalley(_dot_)net>
SELF=$FROM       # the sender's email address
:0 iW
* $ !^x-loop: $SELF
* $ ^from:.*\<$SELF
* ^subject:.*\<show diskquota
| ( formail -r -X "" -A "X-Loop: $SELF"; \
    echo "Below, 'limit' indicates your diskquota in kilobytes"; \
    echo ""; echo "quota -v" | $SHELL ) \
  | $SENDMAIL -oi -f $SELF -- $SELF
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail