procmail
[Top] [All Lists]

Re: RCF last entry in rcfile.

1995-10-24 14:02:06
Louis LaBash wrote,

Recently, I implemented the following recipe as the last rcfile entry:

:0:
* ^From.*
| formail -k -X From -X Date: -X From: -X Subject:>>mbox

Anyone see any pitfall in doing this?  Is this inelegant, or unwise?
My goal is to reduce the size of mbox, keeping only header felt to
be needed.

One big problem and four little ones:

FIRST, you really should keep the Reply-To: header if there is one.  If the
sender wanted replies directed to a different address than that in the From:
header, you are losing that information and, when you respond, writing to the
wrong place.

Second, you ought to keep To: and Cc: so that you can tell when you read
your mail who else was sent it.  If your mail user agent has a groupreply
or replyall function, keeping To: and Cc: will allow that feature to continue
working.  This way you are cheating yourself out of it.

Third, -X From is enough to keep both the From_ line and the From: header.
You don't need to specify -X From: again after it.  (To keep From_ without
From:, you need to say -X 'From ' or something similar, with a quoted space.)

Fourth, all mail is going to have a line (usually two) beginning 'From', so
your condition line is just a waste.  

So far, this summarizes my recommendations:

  :0: # preserves both From_ and From:
  | formail -k -XFrom -XTo: -XCc: -XReply-To: -XDate: -XSubject: >> mbox

Last thing: to make the process more efficient, we can avoid forking a shell
and let formail read only the head without taking the trouble to pass the
body:

  :0fhW
  | formail -XFrom -XTo: -Cc: -XReply-To: -XDate: -XSubject:
   :0 # the usual `A' is not needed
   mbox

Procmail bear[s] the hallmark of a master craftsman: Thanks Stephen.

Indeed.  (Unless Stephen would rather be called an artist.)

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