procmail
[Top] [All Lists]

help with conditionals in recipe

2010-12-29 08:27:08
I have a short recipe below that seems to work except for that the last line
in curly braces is not executing causing the perl subroutine rip_attachment
to not get called.
I was wondering if someone might me able to tell me what I am doing wrong?

Thanks,

Richard

:0 W # send to test_subject.pl to check for PO no.
* ? /usr/bin/perl -e 'require "/home/richard/.pmdir/test_subject.pl";
test_subject($ENV{SUBJECT});'
    # failed subject test
|( formail -rI"From: Replys automatically discarded 
<gatorreina(_at_)gmail(_dot_)com>";
\
   echo "Your mail has been returned."; \
   echo "It was NOT received because it does not contain a valid PO in the
subject"; \
   echo "Please resubmit with a valid PO number in the subject line."; \
 ) | /usr/sbin/ssmtp -oi -t

:0:  #2nd colon means use locking so we don't get 2 files at once in friends
{ # passed subject tes. It has a valid PO no
  :0 c     # copy to freinds and invoices
  friends

  :0
  invoices

  :0 W #rip the attachments
  * ? /usr/bin/perl -e 'require "/home/richard/.pmdir/test_subject.pl";
rip_attachments($ENV{SUBJECT});'

}


This is what my log file says:

procmail: Assigning "INCLUDERC=/home/richard/.pmdir/recipes"
procmail: Assigning "SUBJECT="
procmail: Match on "^FROM:.*"
procmail: Assigning "MATCH="
procmail: Matched "load 24011"
procmail: Match on "^Subject:[    ]*\/[^  ].*"
procmail: Assigning "SUBJECT=load 24011"
procmail: Executing " /usr/bin/perl -e 'require "/home/richard/.pmdir/
test_subject.pl"; test_subject($ENV{SUBJECT});'"
procmail: Non-zero exitcode (1) from " /usr/bin/perl -e 'require
"/home/richard/.pmdir/test_subject.pl"; test_subject($ENV{SUBJECT});'"
procmail: No match on " /usr/bin/perl -e 'require "/home/richard/.pmdir/
test_subject.pl"; test_subject($ENV{SUBJECT});'"
procmail: Extraneous locallockfile ignored
procmail: Locking ".lock"
procmail: Unlocking ".lock"
procmail: Assigning "LASTFOLDER=friends"
procmail: Opening "friends"
procmail: Acquiring kernel-lock
procmail: Assigning "LASTFOLDER=invoices"
procmail: Opening "invoices"
procmail: Acquiring kernel-lock
procmail: Notified comsat: "richard(_at_)252707
:/home/richard/mail/.inboxes/invoices"
 Subject: load 24011
  Folder: invoices                              50541
____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail
<Prev in Thread] Current Thread [Next in Thread>