Toen wij Volker Kuhlmann kietelden, kwam er dit uit:
David's formail -c | grep -iv would work, but leaves
the remaining headers in a funny state.
What is exactly this 'funny state'?
Look up what -c does :)
I unwraps all headers by removing newlines. Necessary for the grep,
but can't be undone. Run any of your mails through formail -c and
look at the received:.
From the sed-users yahoogroups list:
sed -e '
# skip processing unwanted lines
# spotted a valid header start line
# so now go look for a header-ending line
# managed to put in pattern space one header and also
# the start of the next header/non-header stuff
s/^\(.*\)\n.*$/\1/; # just retain the first header info only
# GOTCH YEAH, the header to be deleted
g; # retrieve the header (to be del. + start of next header)
s/^\(.*\)\(\n.*\)$/\2/; # remove the header to be del.
D; # go back for reading more
# ok, this was a header that needs printing
p; # print the first header info only
g; # retrieve the first header + start of next header
s/^\(.*\)\(\n.*\)$/\2/; # remove the first header as it is printed
D;# go back for more
# we come here when while in the process of filling in the
# pattern space with the current header, we reach the EOF
# but the header end has not gotten yet. Or, could be
# there is nothing after this header
Of course, replace 'Headername' and 'search-string' by your own.
This solution was promptly provided by Gudermez. Often,
other solutions follow shortly.
procmail mailing list Procmail homepage: http://www.procmail.org/