procmail
[Top] [All Lists]

Re: H and h

1997-08-08 13:47:00
Mitsuru Furukawa wrote,

| 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?

As long as you'll have a place to check the full set of Received: headers,
then it's not a problem, as far as I see, to leave them out of a second copy
of a message.

| 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):'

`H' (which is the default anyway) does nothing there, because it is a flag
for interpreting conditions, and that recipe is unconditional.

You should have `h' there so that only the head will be filtered; right now
it is filtering the entire message.  That recipe should *not* work; even if
every single line in the body began with "From:" or "Subject:" (and that's
highly improbable), it would still remove the blank line at the neck.  (Proc-
mail would restore the blank line at the foot, because you are not using raw
mode.)

Also, egrep and grep are line-oriented and cannot deal with header fields
(shouldn't they be called "header records"?) that are continued onto another
text line.

It should read like this:

   :0fh
   | formail -X Subject: -X From: -k

When you filter the head through formail -X or formail -x, the -k option
keeps the blank line at the neck intact.  Otherwise, if the body began with
an indented line or a line that looked like a valid mail header, that would
get agglutinated to the head.  (Sometimes the very point is to move such
things into the head; then we leave -k off.)

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