<<< Date Index >>>     <<< Thread Index >>>

Re: What's needed for mutt 1.6? (compressed folders)



On 26Feb2007 18:43, Christoph Berg <cb@xxxxxxxx> wrote:
| Re: Rocco Rutte 2007-02-26 
<20070226165143.GA22499@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
[...]
| > I don't really like the implementation because it enforces mbox. It 
| > would be much nicer (and have a much better design) if it could just 
| > uncompress the file and let mutt itself decide what to do with it.
| 
| Some time ago I tried to make it read mboxes given an URL with a
| sh+wget wrapper which failed because
| http://bugs.debian.org/123&mbox=yes is not a local file, but that
| could be fixed.

Suppose there was a generic folder name intercept hook, eg something like:

  folder-name-close-hook shell-command        # takes folder name,
                                        # returns mbox file path
  folder-name-close-hook shell-command       # takes folder name and mbox file 
path

Then you could write an open-hook script (unrealisticly simple):

  #!/bin/sh
  case "$1" in
    some-pattern-for-compressed folders)
      tmpf=/tmp/foo
      folderpath=$MAILDIR/$1.gz
      gunzip < "$folderpath" >"$tmpf" && echo "$tmpf"
      ;;
    *)exit 0
      ;;
  esac

If the exit status is non-zero, fail the folder open.
If the exit status is zero,
  if the output is empty,
    open the folder in the normal builtin fashion
  else
    open the pathname returned by the script output,
      which might be a plain mbox or a maildir or an IMAP URL or ...

and folder-name-close-hook script:

  #!/bin/sh
  folderpath=$MAILDIR/$1.gz
  tmpf=$2
  gzip < "$tmpf" >"$folderpath" && rm "$tmpf"

Obviously real hooks would be more elaborate, but the approach seems
agnostic enough to externt.

| Generally I would prefer the addition of the (working) patch over
| delaying it indefinitely until someone implements something more
| elegant.

Me too. It works well enough provided users understand the limitations.
-- 
Cameron Simpson <cs@xxxxxxxxxx> DoD#743
http://www.cskk.ezoshosting.com/cs/

Deep into the monitor peering, long I sat there wond'ring, fearing,
Doubting, while the disk kept churning, turning yet to churn some more.

"Save!" I said, "You cursed mother! Save my data from before!"
One thing did the phosphors answer, only this and nothing more,
Just, "Abort, Retry, Ignore?"