I have a simple recipie I'm trying to write, and for the life of me
I can't figure out how to make it work. I've studied the man pages,
the faq/tips, and all the examples I can get my hands on, and even
the examples don't work. !!
What I want to do is have procmail take one of two actions:
Either pipe the whole message to gzip and append it to a mbox.gz file,
or pipe the first 75 lines of the message to gzip and append it to a
mbox.gz file.
I got it working without the gzip, ie:
:0 H
* Content-Type.*multipart/report
{
:0 wi
* >4096
| head -$TRUNCATELINES >>$DEFAULT
:0 w
$DEFAULT
}
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. I know
procmail does wierd things with action lines, so I tried putting
"$SHELL $SHELLFLAGS ..." at the front, I've tried putting the
commands in quotes, the parameters in quotes, etc etc.
I even tried examples of using gzip directly out of the FAQ/tips
page, but it STILL gives me the gzip binary. I can do the commands
manually, ie "cat message | head -75 | gzip -fc >>crap.gz" works
perfectly from my command line.
I'm frustrated, now. What the hell and I doing wrong? Does the fact
that I'm testing this on linux have anything to do with this? Why
does it work with head, but not with gzip???
--
Joi Ellis joi(_dot_)ellis(_at_)cdc(_dot_)com
Managed Services /G=Joi/S=Ellis/O=CDS/P=CDC/A=ATTMAIL/C=US/
Control Data Systems gyles19(_at_)visi(_dot_)com,
http://www.visi.com/~gyles19/
No matter what we think of Linux versus FreeBSD, etc., the one thing I
really like about Linux is that it has Microsoft worried. Anything
that kicks a monopoly in the pants has got to be good for something.
- Chris Johnson