procmail
[Top] [All Lists]

Re: PIPE in a envvar?

1997-04-10 16:24:00
At 05:33 PM 4/10/97 -0500, Philip Guenther elucidated thus:

[snip]
$DEFAULT=| gzip -9fc>>$MAILDIR/mbox.gz

First of all, you only use a dollarsign when expanding variable, never
when assigning.

Oops, typo when entering it in the email.  Thankfully, not that way in my
.procmailrc, or I'd never be getting my mail where I expect it...

When procmail is looking at an action, it determines what type of action
it is (nested block, pipe to program, pipe to sendmail, mailfolder(s))
*before* variable expansion takes place.  This means that:

Okay.  That's the beef of the answer.  Good to know I didn't shoot myself
first...

The correlary of this, is that the implicit DEFAULT and ORGMAIL
processing done by procmail can only deliver to mailfolders, never to
programs.  If you want to do that, you'll need to explicitly put it at
the bottom of your .procmailrc.  Yes, life is hard.

I don't follow - isn't an *implicit* DEFAULT handled at the end of procmail
anyway?  If I'm adding mail processing and making use of the DEFAULT
definition, then aren't I *explicitly* using it?

[snip]
stdout).  Therefore, the line
      DEFAULT = "|"
will work.

Although be of nominal use unless you're sitting in front of the mail
terminal all day... :)


:0 c
* LASTFOLDER ?? ^^^^
! forward_address

:0 Ac: $TEMP/Default$LOCKEXT
$DEFAULT

Just expand $DEFAULT by hand here and it'll work.  I don't think you
meant to put the 'c' flag on the second recipe either.

Uhm, no I didn't mean to there - otherwise I'd be getting two copies of
everything that gets that far.  Fingers go into autopilot sometimes - I
should import from my recipe file next time.

Unfortunatley, I was using the DEFAULT variable expansion at various
locations in my recipes for when they needed to do something and terminate
filtering there.  Most likely not the way to do it, but it is the way I'm
accustomed to doing it.  So if I decide to change this, I guess I have to
go tweaking it in various locations.  Bummer, but liveable.

Thanks for the answer.

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