procmail
[Top] [All Lists]

Re: filtering headers

1997-11-05 16:16:53
wwgrol(_at_)sparc01(_dot_)fw(_dot_)hac(_dot_)com (W. Wesley Groleau x4923) 
writes:
I keep fiddling with this, but I can't seem to get it.  I am grateful to
those that pointed me in the right direction, even though there were minor
syntax errors (which I've probably made worse by my fiddling).

So what's wrong with my latest try (below)?

# Discard some useless headers
:0fhw
| formail -Y -IResent-Date:               \ 
...
# discard our internal routing
:0 fhw
|perl  -ne 'if(/^\s/) {'                   \
...

If it isn't obvious, here's that resulting log:

Usage: formail [-bczfrktqY] [-D nnn idcache] [-p prefix] [-l folder]
      [-xXaAiIuU field] [-R ofield nfield]
  Or: formail [+nnn] [-nnn] [-bczfrktedqBY] [-D nnn idcache] [-p prefix]
      [-n [nnn]] [-m nnn] [-l folder] [-xXaAiIuU field] [-R ofield nfield]
      -s [prg [arg ...]]
procmail: Program failure (64) of "formail"
procmail: Rescue of unfiltered data succeeded
procmail: Skipped "-IIn-Reply-To:               \ "
procmail: Skipped "-IResent-Me...[snip]...sion:      \ "
procmail: Skipped "-IX-Mailing-List:   "

There are spaces after the backslashes.  Remove the spaces so that the
backslashes are the last character on each line.


Unmatched right bracket at -e line 12, at end of line
syntax error at -e line 12, near ";}"
Execution of -e aborted due to compilation errors.
procmail: Program failure (2) of "perl  -ne 'if(/^\s/) {'                   \
       -e '    $h .= $_;'                 \
       -e '} else {'                      \
       -e '    if($h =~ /^Received:/) {'  \
       -e '        print $h unless $saw;' \
       -e '        $saw=1 if $h =~ /gw1.hughes-defense-comm.com/;' \
       -e '    } else {'                  \
       -e '        print $h;'             \
       -e '    }'                         \
       -e '    $h = $_;'                  \
       -e '  }'                           \
       -e '}'"
procmail: Rescue of unfiltered data succeeded

Remove the entire recipe, and instead us the new version I just mailed
out.  (The problem with this one can be fixed by removing the next to
last line.)


Philip Guenther

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