procmail
[Top] [All Lists]

RE: Action Line Confusion

1998-12-07 10:04:31

  
    * To: Joi Ellis <Joi(_dot_)Ellis(_at_)cdc(_dot_)com>
    * Subject: Re: Action line confusion
    * From: Fabrice Noilhan <Fabrice(_dot_)Noilhan(_at_)ens(_dot_)fr>
    * Date: Sat, 5 Dec 1998 16:24:58 +0100
    * Cc: procmail(_at_)informatik(_dot_)rwth-aachen(_dot_)de
    _________________________________________________________________
  
On Fri, Dec 04, 1998 at 05:28:52PM -0600, Joi Ellis wrote:
What I really want it to do is:

:0 H
* Content-Type.*multipart/report
{
  :0 wi
  * >4096
  | head -$TRUNCATELINES | gzip -fc >>$DEFAULT

  :0 w
  | gzip -fc >>$DEFAULT
}

But, no matter what I try to do, the damn thing appends the gzip program
binarh into the mailbox, not the gzipped message content.

The following works well for me:

:0
* ^From:.*noilhan
* ^Subject: *pm-gzip
{
 :0 wi
 * >4096
 |head |gzip -fc >> blah.gz


 :0 w
 |gzip -fc >> blah.gz
}

Could you tell us more about it? (verbose, which gzip...)

       Fabrice
--
The version of procmail I'm testing with is:

procmail v3.10 1994/10/31 written and created by Stephen R. van den Berg
  berg(_at_)pool(_dot_)informatik(_dot_)rwth-aachen(_dot_)de

This is the version that's installed with Red Hat 5.0.

The machine I intend to install this .procmailrc file on is actually
running:

procmail v3.11pre4 1995/10/29 written and created by Stephen R. van den Berg
  <srb(_at_)cuci(_dot_)nl>

I tried the exact lines you specified in your example, and it WORKED!
I then tried my original lines, which were identical except for spacing,
and they FAILED.   I experimented a bit and found that:

| head -75 | gzip -fc >>$DEFAULT.gz    <<--- FAILS
| head -75 |gzip -fc >>$DEFAULT.gz     <<--- WORKS

Why is this space a problem?  I understand the documentation to say
that the mere presense of the second | in the command requires
procmail to pass the whole line to a shell!  I don't understand this
behavior at all.   Is there a particular spot in the FAQ I overlooked? 

(When this fails, the $DEFAULT.gz file is given the gzip binary itself,
not the message being piped in through the head command.)

(And yes, I realize envoking a shell for every message is a performance
hit.  But It's more critical our mail spool not run out of space every
10 hours, which is what it's doing right now...  cpu isn't the problem,
disk space is.)

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