b_weissm(_at_)kla(_dot_)com (Bob Weissman) writes:
The following recipe gives me "Extraneous filter-flag ignored":
# Some stupid Microsoft email program adds unreadable uuencoded junk.
:0fhw
* ^X-Ms-Attachment: WINMAIL\.DAT
{
:0fbw
|sed '/^begin [0-7][0-7][0-7] WINMAIL\.DAT$/,$d'
}
procmailrc(5) says
On a nesting block,
the flags `H' and `B' only affect the conditions
leading up to the block, the flags `h' and `b' have no
effect whatsoever.
I can't quite decipher the language of the man page. What is procmail
complaining about? The outer 'h'? The inner 'b'? Or the inner 'f'?
"Nesting block" refers to the recipe whose action is a {...} block,
that is, the outer recipe. Here, your nesting block recipe has the
flags "fhw", none of which have any effect here. When you think you
want them on the outer block, you probably really want to place them
on the recipes inside the block. In this case you already have
given the inner recipe the 'f' and 'w' flags. However, I think you
have misinterpreted what the 'h' flag does. The 'h' flag doesn't
effect how conditions are matched, that's the 'H' and 'B' flags,
but rather controls what the action receives as input. I think you
meant to put the 'H' flag on the outer block, not the 'h' flag.
However placing the 'H' flag there is pointless, as it's the default.
I'm not sure why you're using a nesting block in this example anyway.
Is this just part of the actual block in the real .procmailrc? If
not, this can shortened down to:
:0 fbw
* ^X-Ms-Attachment: WINMAIL\.DAT
|sed '/^begin [0-7][0-7][0-7] WINMAIL\.DAT$/,$d'
I would probably to make that sed line read:
sed '/^begin [0-7][0-7][0-7] WINMAIL\.DAT$/,/^end/$d'
Philip Guenther
----------------------------------------------------------------
Philip Guenther UNIX Systems and Network Administrator
Internet: guenther(_at_)gac(_dot_)edu Phonenet: (507) 933-7596
Gustavus Adolphus College St. Peter, MN 56082-1498