First of all thanks to all who responded.
And forgive me for responding to you all via this mail.
dattier(_at_)wwa(_dot_)com (David W. Tamkin) wrote:
<SNIP>
d> First, that would not delete lines but rather it would leave empty lines
d> where Received: headers began; second, many Received: headers (more so than
d> any other) are continued onto additional lines, so the continuation lines
d> would still be there.
d>
d> Second, `h' would help there but `H' has no effect.
d>
d> The filtering recipe you need is this:
d>
d> :0fh
d> | formail -IReceived: -A"X-Received: Deleted all the Received headers"
Whmmmmm. Thanks.
I somewhat feel ashamed for not coming up with a recipe simple as this;-)
d>
d> but last, I'm not sure you really should delete them anyway; they carry
d> tracing information that could be invaluable. (Having said that, I'll
d> confess to deleting Received: headers some of the time, but only in
d> reprocessing mail that I have already read, never from incoming mail
d> before I see it.)
That's almost close to what I am thinking.
I am planning to create a recipe to minimize mail size
before forwarding to mobile computing mailbox
while leaving mails intact at full size for desktop mailbox.
What do you think?
d>
d> | BTW, I have a feeling that the flag H has more significance than
d> | just "Egrep the header".
d> | That is because if I use h flag, header and body are fed as body
d> | and if I use H flag, header and body are fed as header in mailbox.
d> | Am I wrong?
d>
d> I'm not sure what you're saying, Mitsuru, so I'll try to explain the
d> difference in my own words:
d>
d> `H' and `B' tell procmail which part of the message to use in the condition
d> lines (usually, which part to search for the regexps). The default is `H';
d> to search the entire message, you need to specify `HB' or `BH'. Also, they
d> can be overridden for single conditions by using the VAR ?? syntax.
d>
d> `h' and `b' tell procmail which part to use in the action line. If the
d> action is a filter, and you use only `h' or `b', the other part will be
d> reattached unchanged. If the action is a save to a folder or a pipe to a
d> command and there is no `c' flag, and you use only `h' or `b', the other
d> part will be dropped silently. The default is `hb' if you don't specify.
Sorry. I'm also not much sure what I'm saying and thinking.
So let me simplify my question till I come up with robust one.
Is following H flag meaningful?
Or is it working coincidentally because default is hb?
:0fH # Filter original header, leave only Subject and From
| egrep '^(Subject|From):'
TIA
_/_/_/ Mitsuru FURUKAWA _/_/_/
_/_/_/ Tokyo, Japan _/_/_/
_/_/_/ mailto:furu(_at_)009(_dot_)com _/_/_/
_/_/_/ http://www.009.com/furu/ _/_/_/