[vox-tech] help with script

Peter Jay Salzman vox-tech@lists.lugod.org
Fri, 4 Oct 2002 10:23:44 -0700


begin msimons@moria.simons-clan.com <msimons@moria.simons-clan.com> 
> On Thu, Oct 03, 2002 at 02:24:04PM -0700, Peter Jay Salzman wrote:
> > excellent, mike!  thanks.
> > 
> > question -- is it possible to automatically apply a perl script to the
> > body within mutt?
> > 
> > or perhaps using procmail:
> 
>   Absolutely with procmail but I don't have a rule handy for that right 
> now.  You might have to de-mime the files before the script can work on 
> them.

ya, i looked into that last night.  the procmial faq has a link to a
procmail package that deals with mime stuff, but the link was broken.

however, i found munpack.  so right now, i have a procmail recipe that
sends acknowledgement that the homework was received and saves it to a
folder:

   :0H:
   * !^FROM_DAEMON
   * !^X-Loop: beentheredonethat@dirac.org
   * ^Subject:.*105AL.*HW.*
   {
      :0c:
      | (formail -r -A"Precedence: junk" \
      -A"X-Loop: beentheredonethat@dirac.org" ; \
      cat ../academia/TA/phys105AL/105.response) | $SENDMAIL -t
   
      :0:
      105
   }

i then have a list of codes for grading:

0. Perfect.  Congrats on a job well done!
1. main() needs an argument type, like "main(void)".
2. main() needs a return type, like "int main()".
3. main() should always end with a return statement.
4. No parenthesis with return.  Use "return 0;" rather than "return(0);"
5. Always use -W -Wall when compiling a C program.
6. The C compiler is called gcc, not cc.
7. You didn't show the program compilation.
8. You didn't show the program output.
9. Please don't run vi with script.  The output is ... interesting.  :)
... (etc)

4. High pass (good job!)
3. Pass
2. Low pass
1. Please resubmit with corrections.
0. No pass


i'm going to write a perl script that takes each mail from the folder,
shows me the attachments, let's me input codes and sends an email back
to the students indicating the comments and final grade.  it'll also use
your perl script to strip the output of their script session.


> Also, I would advise against changing the original email... at 
> least save a copy of the incoming mail in raw form, then apply the filter
> to a separate mail box...

absolutely!

thanks!
pete