procmail
[Top] [All Lists]

Re: Extraneous filter-flag ignored

1996-06-14 09:36:43
Bill Jenuwine <wjenuwin(_at_)ford(_dot_)com> writes:
I have the following recipe

:0 fhbW
* ^From.*MyProfsAddress
{

 PROFSTO="`/bin/nawk -f /u/wjenuwin/bin/profsTo`"
 PROFSFROM="`/bin/nawk -f /u/wjenuwin/bin/profsFrom`"

 :0 afW
 | /u/wjenuwin/bin/formail -i "To: $PROFSTO"

 :0 afW
 | /u/wjenuwin/bin/formail -i "From: $PROFSFROM"

}

that generates the error "procmail: Extraneous filter-flag ignored".

This recipe accepts email I forward from my mainframe account to my
unix account and extracts the correct "From:" and "To:" address
information from the body of the message and inserts these CORRECT
headers into the email.  Now from UNIX I can reply to an email that
originated from someone on the mainframe (since forwarding it to my
UNIX account changes who the mail is from)

Other than the message "procmail: Extraneous filter-flag ignored", it
works fine.  If I eliminate the 'f' flag in the first line of the
recipe, the error message stops, but the email's headers are not
corrected as I wish them to be.

Can anyone explain to me how to eliminate the error message and still
accomplish what I want?


I'm not sure what you think all those flags on the nesting block do.

Consider the 'f' flag.  How can a nesting block action act as a
filter?  Wouldn't that just mean putting the 'f'ilter flag on each of
the nested recipes?  Rather than assume so procmail makes you put the
'f' flag on each recipe as needed.  Thus the 'f' flag has *no*
*meaning* when placed on a nesting block, and procmail emits the
warning.

You than include both the 'h' and 'b' flags.  You can remove them both
as that's the default action of procmail: to save/pipe the entire message,
both head and body.  Besides, like the 'f' flag, they have no effect on
nesting block recipes.

The 'W' flag _would_ do something useful if this was a cloned nesting
block (with the 'c' flag).  Since it isn't (and shouldn't be), it does
nothing.

I would also suggest removing the 'a' flag from the first of the nested
recipes.  Indeed, they may be the problem.  The "preceding recipe" is
whatever one preceded the entire nesting block.  Since you don't show
it I'm assuming that it really has nothing to do with this, and this
would then be a bug.


Since the formail commands only need to munge the header, you should
put the 'h' flag on those (nested) recipes.

Do the formail commands actually fail often enough that you want to
suppress the "Program failure" messages?  I recommend using the 'w'
flag over the 'W' flag for almost all cases.

Finally, I suggest that you should *never* hardcode your own home
directory into your .procmailrc.  Procmail already knows what your
home directory is: $HOME.  Let the system do the work for you.  Besides,
you never know when your account will be moved, and even if you did,
would you remember to update your .procmailrc?

In total:

:0
* ^From.*MyProfsAddress
{

  PROFSTO="`/bin/nawk -f $HOME/bin/profsTo`"
  PROFSFROM="`/bin/nawk -f $HOME/bin/profsFrom`"

  :0 fwh
  | $HOME/bin/formail -i "To: $PROFSTO"

  :0 afwh
  | $HOME/bin/formail -i "From: $PROFSFROM"

}

Philip Guenther

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