Jason --

...and then [EMAIL PROTECTED] said...
% A call for personal help setting up Gzip compression on mailboxes.
% Utterly confused by the lack of documentation on it....

Hokay; I've seen that a few people have pointed you to the docs at
spinnaker, so I won't go there.

At the risk of belaboring the point, I'll tell you what I know about
compressed folders.  I haven't gotten around to using them because I'm
too lazy :-)

Once you've patched in compressed-folder support (and that's something of
a bad name for it, since it's really "any-encapsulation-method" folder
support 'cuz you could use tar on a maildir or pgp on an mbox and even,
I'll bet a twinkie, pgp on a tarred maildir), you simply need to tell
mutt how to

- open the mailbox
- append to the mailbox
- close the mailbox

That's it, and that's what open-hook, append-hook, and close-hook are
for.  So let's figure that you're using this patch for compression with
gzip and you want to be able to get to your folders.  The important
things to know are that the %f and %t expandos mean "folder" and "temp",
respectively, and how to actually do what it is you're about to try to
tell mutt how to do.

Straight from the docs, we have

  open-hook \\.gz$ "gzip -cd %f > %t"
  close-hook \\.gz$ "gzip -c %t > %f"
  append-hook \\.gz$ "gzip -c %t >> %f"

These are fairly straightforward, just like other hooks: you have the
hook type, a regular expression, and a command to run.  The regular
expression specifies the mail folder file name; in the cases above it's
anything that's *.gz (in shell terms).  The command is simply what you do
to one version to make it into another.

To open a compressed mailbox, you have to decompress it, right?  So the
open-hook command tells mutt to unzip (gzip -d) to stdout (-c) from %f
(the actual folder file) to %t (the temp file); mutt is smart enough to
then look at the temp file.

To close a folder that should be compressed, you just compress it.  So
the close-hook command tells mutt to zip (gzip) to stdout (-c) from the
temp (%t) file (remember, we're working with the temp copy of a compressed
folder; to initially compress a folder, just compress it) to the actual
folder (%f) file.

So far, that's all easy.  You don't really have to do anything else; you
can now open and browse your compressed folder, make any changes you
want, and then close it back up again.  [AFAIU, if you make no changes,
mutt will simply wipe the temp file and leave the compressed file alone;
note that the use of stdout leaves the original in place each time.]

What if you want to save some mail to a compressed folder, though?  It
sure would be a pain to unzip that 27MB folder just to add two messages
that came in today; it would be nice if you could just tack them on the
back.  Well, gzip allows that (though many other programs, like pgp and
almost certainly tar, do NOT), so there's an append-hook capability as
well.

To append to a compressed folder, we merely compress our new stuff and
then append it right onto the end of the compressed folder; while it's
not quite as efficient as compressing the whole thing in one swell foop,
you probably don't care about that with a large folder.  So we tell mutt
to zip (gzip) to stdout (-c) the temp (%f) file and *append* (>>) the
results to the folder (%f) file.  Piece of cake.


% 
% Please help.

Hope this does it :-)  I'd just sit down and try it out if I were you;
copy one of your big mailboxes to a temp version and play like crazy
with it.


% -- 
% /helfman
% 
% "At any given moment, you may find the ticket to the circus that has always
% been in your possession."
%   Fingerprint: 2F76 2856 776A 3E07 9F3E  452A 17D9 9B28 D75E 0A36
%       GnuPG http://www.gnupg.org  Get Private!  1024D/D75E0A36


:-D
-- 
David T-G                       * It's easier to fight for one's principles
(play) [EMAIL PROTECTED]      * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.bigfoot.com/~davidtg/        Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
The "new millennium" starts at the beginning of 2001.  There was no year 0.
Note: If bigfoot.com gives you fits, try sector13.org in its place. *sigh*

PGP signature

Reply via email to