procmail
[Top] [All Lists]

Recurring email filter - part II

1999-01-08 11:40:10

I've worked on my recurring email filter.  To sum up, I get a 
report via email that doesnt change very often, so I want to 
store off a copy of it one day - then the next day, if the body
is the same as the previous day, I want to file it in /dev/null,
otherwise forward it to my POP account.

Here is my recipe:

:0 
* ^Subject:[     ]toddltest
{
  :0bc:
  /home/toddl/.toddlcompare

  :0B
  * ? diff /home/toddl/Mail/toddltest-old /home/toddl/.toddlcompare ;
  | cat > /dev/null; rsh mysun playit -v30 doorbell.au
  
  {
    :0 BC
    ! mypop(_at_)ti(_dot_)com
  
    :0 b:                                  <==== NOT WORKING HERE
    /home/toddl/Mail/toddltest-old
  }  
}


In this test, I send a message with the subject toddltest.  
The first thing I want to  do is copy the body to ~/.toddlcompare
Then I want to do a diff between that file and /home/toddl/Mail/toddltest-old

Here is the spec on the return value for diff:
DIFF(1)                  USER COMMANDS                    DIFF(1)
DIAGNOSTICS
     Exit status is 0 for no differences, 1 for some differences,
     2 for trouble.


So if diff returns a 0 there are no differences, so I want to send it to 
/dev/null
(and for my test it plays a little sound to know it works)

If diff returns non zero, then I want it to forward to my pop account.

Then finally as a last step, I want to copy the body to toddltest-old

===========================

The problem is that the last command where it puts the body into toddltest-old
is not executing.  The log file says that it "Skipped C"

procmail: Skipped "C"
procmail: Executing "/usr/lib/sendmail,-oi,mypop(_at_)ti(_dot_)com"
procmail: Assigning "LASTFOLDER=/usr/lib/sendmail -oi mypop(_at_)ti(_dot_)com"


How can I get that last step to work?


toddl

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