procmail
[Top] [All Lists]

Re: Can't get action | to work

2006-03-28 06:55:29
On Tue, 28 Mar 2006, Dallman Ross wrote:

On Tue, Mar 28, 2006 at 12:30:41AM +0200, Dallman Ross wrote:

Whoops, I forgot your other condition.

Aaah.  I guess I should have provided a tad more info.

The file "spam.log" should contain lines like:
   060327:1341 (description of recipe) subject of message

Removing the "errant backtick" at least gives me a spam.log file;
but I still get the bad LASTFOLDER business.

I don't need the "\n" - and should have known that. Re the -e
with echo: the echo man page says: -e enable interpretation of
the backslash-escaped characters listed below (one of which is
\n).

Here's my entire test recipe:


      :0
      * ^Return-Path:(_dot_)*(_at_)hotmail
         {
            :0
            * $ ^Subject:$WS\/.*$
            | (echo -e $TIME "bounce address" $MATCH "\n" >> 
spamtest/spam.log)

            :0
            spamtest/gotcha
         }

      :0
      spamtest/spamlast

"gotcha" is the file where the matching message should wind up.
"spamlast" contains all the messages that don't match. (I occasionally use
this to replace the "spam" file minus the messages that match some test
recipe so I can continue to work the file without seeing already
identified messages.)

I'm still getting this in the spamtest.log (not the spam.log)

procmail: Match on "^Return-Path:(_dot_)*(_at_)hotmail"
procmail: Assigning "MATCH="
procmail: Matched "60% off Generíc Víagra
"
procmail: Match on "^Subject:[  ]\/.*$"
procmail: Assigning "LASTFOLDER= (echo -e $TIME "bounce address"
$MATCH "\n" >> spamtest/spam.log)"From fleet(_at_)teachout(_dot_)org Sat 
Mar 25 23:27:06 2006 -0500
 Subject: 60% off Generíc Víagra
  Folder:  (echo -e $TIME "bounce address" $MATCH "\n" >> spamtest/spam 1291

I want LASTFOLDER to be spamtest/gotcha

I answered this part in one of my previous replies.  You are 
DELIVERING your message to the pipe.  There is no message to
shunt to your "gotcha" recipe.  The message was "eaten" by the
echo action of the previous recipe.

You need to make that recipe a non-delivering recipe.  You can
do that in several ways.  Alternatively, you can clone the message
via the c-flag in your echo-recipe.

You also might want to re-read what I wrote about your match statement.
There's no real reason to look for whitespace after the header in
a match like yours, because this line:

   Subject:      Lots of leading whitespace

will match the leading whitespace (except for the first space or
tab).  Well, maybe you want to do that, I don't know.  But your
match then will fail to match on

   Subject:no leading whitespace

which, however, is an RFC-valid Subject line.

Simplest way to tweak your recipe (oh -- and note lockfile,
which you forgot!; and you didn't need the trailing "$" on the
right of the match regex):

 
       :0 c:
       * ^Return-Path:(_dot_)*(_at_)hotmail
       * ^Subject:.*\/[^        ].*
       spamtest/gotcha

       :0 A
       | echo -e $TIME "bounce address" $MATCH "\n" >> spamtest/spam.log
 

       :0
       spamtest/spamlast


Another thing: this whole section is going to "spamtest", so why
not set MAILDIR to spamtest for this part and leave all those
directory- name prefixes off the recipes in this region?  Then you
can reset MAILDIR later in your rcfile.

Dallman

____________________________________________________________
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