2 This is the compressed folders patch by Roland Rosenfeld
5 The home page for this patch is:
7 http://www.spinnaker.de/mutt/compressed/
9 * Patch last synced with upstream:
11 - File: http://www.spinnaker.de/mutt/compressed/patch-1.5.10.rr.compressed.1.gz
15 $(for f in Makefile.in config.h.in configure 'Muttrc*' doc/manual.txt \
16 doc/manual.sgml 'doc/manual*.html' doc/muttrc.man; do echo "-x $f"; done)
19 diff -urN mutt-1.5.10/compress.c mutt-1.5.10-ro/compress.c
20 --- mutt-1.5.10/compress.c 1970-01-01 01:00:00.000000000 +0100
21 +++ mutt-1.5.10-ro/compress.c 2005-08-14 12:10:21.000000000 +0200
24 + * Copyright (C) 1997 Alain Penders <Alain@Finale-Dev.com>
26 + * This program is free software; you can redistribute it and/or modify
27 + * it under the terms of the GNU General Public License as published by
28 + * the Free Software Foundation; either version 2 of the License, or
29 + * (at your option) any later version.
31 + * This program is distributed in the hope that it will be useful,
32 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 + * GNU General Public License for more details.
36 + * You should have received a copy of the GNU General Public License
37 + * along with this program; if not, write to the Free Software
38 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
47 +#ifdef USE_COMPRESSED
51 +#include "mutt_curses.h"
56 +#include <sys/stat.h>
60 + const char *close; /* close-hook command */
61 + const char *open; /* open-hook command */
62 + const char *append; /* append-hook command */
63 + off_t size; /* size of real folder */
68 + * ctx - context to lock
69 + * excl - exclusive lock?
70 + * retry - should retry if unable to lock?
72 +int mbox_lock_compressed (CONTEXT *ctx, FILE *fp, int excl, int retry)
76 + if ((r = mx_lock_file (ctx->realpath, fileno (fp), excl, 1, retry)) == 0)
78 + else if (retry && !excl)
87 +void mbox_unlock_compressed (CONTEXT *ctx, FILE *fp)
93 + mx_unlock_file (ctx->realpath, fileno (fp), 1);
98 +static int is_new (const char *path)
100 + return (access (path, W_OK) != 0 && errno == ENOENT) ? 1 : 0;
103 +static const char* find_compress_hook (int type, const char *path)
105 + const char* c = mutt_find_hook (type, path);
106 + return (!c || !*c) ? NULL : c;
109 +int mutt_can_read_compressed (const char *path)
111 + return find_compress_hook (M_OPENHOOK, path) ? 1 : 0;
115 + * if the file is new, we really do not append, but create, and so use
116 + * close-hook, and not append-hook
118 +static const char* get_append_command (const char *path, const CONTEXT* ctx)
120 + COMPRESS_INFO *ci = (COMPRESS_INFO *) ctx->compressinfo;
121 + return (is_new (path)) ? ci->close : ci->append;
124 +int mutt_can_append_compressed (const char *path)
129 + return (find_compress_hook (M_CLOSEHOOK, path) ? 1 : 0);
131 + magic = mx_get_magic (path);
133 + if (magic != 0 && magic != M_COMPRESSED)
136 + return (find_compress_hook (M_APPENDHOOK, path)
137 + || (find_compress_hook (M_OPENHOOK, path)
138 + && find_compress_hook (M_CLOSEHOOK, path))) ? 1 : 0;
141 +/* open a compressed mailbox */
142 +static COMPRESS_INFO *set_compress_info (CONTEXT *ctx)
146 + /* Now lets uncompress this thing */
147 + ci = safe_malloc (sizeof (COMPRESS_INFO));
148 + ctx->compressinfo = (void*) ci;
149 + ci->append = find_compress_hook (M_APPENDHOOK, ctx->path);
150 + ci->open = find_compress_hook (M_OPENHOOK, ctx->path);
151 + ci->close = find_compress_hook (M_CLOSEHOOK, ctx->path);
155 +static void set_path (CONTEXT* ctx)
157 + char tmppath[_POSIX_PATH_MAX];
159 + /* Setup the right paths */
160 + ctx->realpath = ctx->path;
162 + /* Uncompress to /tmp */
163 + mutt_mktemp (tmppath);
164 + ctx->path = safe_malloc (strlen (tmppath) + 1);
165 + strcpy (ctx->path, tmppath);
168 +static int get_size (const char* path)
171 + if (stat (path, &sb) != 0)
173 + return (sb.st_size);
176 +static void store_size (CONTEXT* ctx)
178 + COMPRESS_INFO *ci = (COMPRESS_INFO *) ctx->compressinfo;
179 + ci->size = get_size (ctx->realpath);
183 +compresshook_format_str (char *dest, size_t destlen, char op, const char *src,
184 + const char *fmt, const char *ifstring,
185 + const char *elsestring, unsigned long data,
188 + char tmp[SHORT_STRING];
190 + CONTEXT *ctx = (CONTEXT *) data;
194 + snprintf (tmp, sizeof (tmp), "%%%ss", fmt);
195 + snprintf (dest, destlen, tmp, ctx->realpath);
198 + snprintf (tmp, sizeof (tmp), "%%%ss", fmt);
199 + snprintf (dest, destlen, tmp, ctx->path);
206 + * check that the command has both %f and %t
207 + * 0 means OK, -1 means error
209 +int mutt_test_compress_command (const char* cmd)
211 + return (strstr (cmd, "%f") && strstr (cmd, "%t")) ? 0 : -1;
214 +static char *get_compression_cmd (const char* cmd, const CONTEXT* ctx)
216 + char expanded[_POSIX_PATH_MAX];
217 + mutt_FormatString (expanded, sizeof (expanded), cmd, compresshook_format_str,
218 + (unsigned long) ctx, 0);
219 + return safe_strdup (expanded);
222 +int mutt_check_mailbox_compressed (CONTEXT* ctx)
224 + COMPRESS_INFO *ci = (COMPRESS_INFO *) ctx->compressinfo;
225 + if (ci->size != get_size (ctx->realpath))
227 + FREE (&ctx->compressinfo);
228 + FREE (&ctx->realpath);
229 + mutt_error _("Mailbox was corrupted!");
235 +int mutt_open_read_compressed (CONTEXT *ctx)
241 + COMPRESS_INFO *ci = set_compress_info (ctx);
244 + FREE (ctx->compressinfo);
247 + if (!ci->close || access (ctx->path, W_OK) != 0)
254 + mutt_message (_("Decompressing %s..."), ctx->realpath);
256 + cmd = get_compression_cmd (ci->open, ctx);
259 + dprint (2, (debugfile, "DecompressCmd: '%s'\n", cmd));
261 + if ((fp = fopen (ctx->realpath, "r")) == NULL)
263 + mutt_perror (ctx->realpath);
267 + mutt_block_signals ();
268 + if (mbox_lock_compressed (ctx, fp, 0, 1) == -1)
271 + mutt_unblock_signals ();
272 + mutt_error _("Unable to lock mailbox!");
279 + fprintf (stderr, _("Decompressing %s...\n"),ctx->realpath);
280 + rc = mutt_system (cmd);
281 + mbox_unlock_compressed (ctx, fp);
282 + mutt_unblock_signals ();
287 + mutt_any_key_to_continue (NULL);
289 + FREE (ctx->compressinfo);
290 + mutt_error (_("Error executing: %s : unable to open the mailbox!\n"), cmd);
296 + if (mutt_check_mailbox_compressed (ctx))
299 + ctx->magic = mx_get_magic (ctx->path);
304 +void restore_path (CONTEXT* ctx)
307 + ctx->path = ctx->realpath;
310 +/* remove the temporary mailbox */
311 +void remove_file (CONTEXT* ctx)
313 + if (ctx->magic == M_MBOX || ctx->magic == M_MMDF)
314 + remove (ctx->path);
317 +int mutt_open_append_compressed (CONTEXT *ctx)
320 + COMPRESS_INFO *ci = set_compress_info (ctx);
322 + if (!get_append_command (ctx->path, ctx))
324 + if (ci->open && ci->close)
325 + return (mutt_open_read_compressed (ctx));
328 + FREE (&ctx->compressinfo);
334 + ctx->magic = DefaultMagic;
336 + if (!is_new (ctx->realpath))
337 + if (ctx->magic == M_MBOX || ctx->magic == M_MMDF)
338 + if ((fh = fopen (ctx->path, "w")))
340 + /* No error checking - the parent function will catch it */
345 +/* close a compressed mailbox */
346 +void mutt_fast_close_compressed (CONTEXT *ctx)
348 + dprint (2, (debugfile, "mutt_fast_close_compressed called on '%s'\n",
351 + if (ctx->compressinfo)
356 + /* if the folder was removed, remove the gzipped folder too */
357 + if ((ctx->magic > 0)
358 + && (access (ctx->path, F_OK) != 0)
359 + && ! option (OPTSAVEEMPTY))
360 + remove (ctx->realpath);
364 + restore_path (ctx);
365 + FREE (&ctx->compressinfo);
369 +/* return 0 on success, -1 on failure */
370 +int mutt_sync_compressed (CONTEXT* ctx)
375 + COMPRESS_INFO *ci = (COMPRESS_INFO *) ctx->compressinfo;
378 + mutt_message (_("Compressing %s..."), ctx->realpath);
380 + cmd = get_compression_cmd (ci->close, ctx);
384 + if ((fp = fopen (ctx->realpath, "a")) == NULL)
386 + mutt_perror (ctx->realpath);
390 + mutt_block_signals ();
391 + if (mbox_lock_compressed (ctx, fp, 1, 1) == -1)
394 + mutt_unblock_signals ();
395 + mutt_error _("Unable to lock mailbox!");
401 + dprint (2, (debugfile, "CompressCommand: '%s'\n", cmd));
405 + fprintf (stderr, _("Compressing %s...\n"), ctx->realpath);
406 + if (mutt_system (cmd))
408 + mutt_any_key_to_continue (NULL);
409 + mutt_error (_("%s: Error compressing mailbox! Original mailbox deleted, uncompressed one kept!\n"), ctx->path);
413 + mbox_unlock_compressed (ctx, fp);
414 + mutt_unblock_signals ();
424 +int mutt_slow_close_compressed (CONTEXT *ctx)
427 + const char *append;
429 + COMPRESS_INFO *ci = (COMPRESS_INFO *) ctx->compressinfo;
431 + dprint (2, (debugfile, "mutt_slow_close_compressed called on '%s'\n",
435 + && ((append = get_append_command (ctx->realpath, ctx))
436 + || (append = ci->close))))
438 + /* if we can not or should not append, we only have to remove the */
439 + /* compressed info, because sync was already called */
440 + mutt_fast_close_compressed (ctx);
450 + if (append == ci->close)
451 + mutt_message (_("Compressing %s..."), ctx->realpath);
453 + mutt_message (_("Compressed-appending to %s..."), ctx->realpath);
456 + cmd = get_compression_cmd (append, ctx);
460 + if ((fp = fopen (ctx->realpath, "a")) == NULL)
462 + mutt_perror (ctx->realpath);
466 + mutt_block_signals ();
467 + if (mbox_lock_compressed (ctx, fp, 1, 1) == -1)
470 + mutt_unblock_signals ();
471 + mutt_error _("Unable to lock mailbox!");
476 + dprint (2, (debugfile, "CompressCmd: '%s'\n", cmd));
481 + if (append == ci->close)
482 + fprintf (stderr, _("Compressing %s...\n"), ctx->realpath);
484 + fprintf (stderr, _("Compressed-appending to %s...\n"), ctx->realpath);
486 + if (mutt_system (cmd))
488 + mutt_any_key_to_continue (NULL);
489 + mutt_error (_(" %s: Error compressing mailbox! Uncompressed one kept!\n"),
492 + mbox_unlock_compressed (ctx, fp);
493 + mutt_unblock_signals ();
498 + mbox_unlock_compressed (ctx, fp);
499 + mutt_unblock_signals ();
502 + restore_path (ctx);
504 + FREE (&ctx->compressinfo);
509 +#endif /* USE_COMPRESSED */
510 diff -urN mutt-1.5.10/compress.h mutt-1.5.10-ro/compress.h
511 --- mutt-1.5.10/compress.h 1970-01-01 01:00:00.000000000 +0100
512 +++ mutt-1.5.10-ro/compress.h 2005-08-14 12:10:21.000000000 +0200
515 + * Copyright (C) 1997 Alain Penders <Alain@Finale-Dev.com>
517 + * This program is free software; you can redistribute it and/or modify
518 + * it under the terms of the GNU General Public License as published by
519 + * the Free Software Foundation; either version 2 of the License, or
520 + * (at your option) any later version.
522 + * This program is distributed in the hope that it will be useful,
523 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
524 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
525 + * GNU General Public License for more details.
527 + * You should have received a copy of the GNU General Public License
528 + * along with this program; if not, write to the Free Software
529 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
532 +int mutt_can_read_compressed (const char *);
533 +int mutt_can_append_compressed (const char *);
534 +int mutt_open_read_compressed (CONTEXT *);
535 +int mutt_open_append_compressed (CONTEXT *);
536 +int mutt_slow_close_compressed (CONTEXT *);
537 +int mutt_sync_compressed (CONTEXT *);
538 +int mutt_test_compress_command (const char *);
539 +int mutt_check_mailbox_compressed (CONTEXT *);
540 +void mutt_fast_close_compressed (CONTEXT *);
541 diff -urN mutt-1.5.10/config.h.in mutt-1.5.10-ro/config.h.in
542 diff -urN mutt-1.5.10/configure mutt-1.5.10-ro/configure
543 diff -urN mutt-1.5.10/configure.in mutt-1.5.10-ro/configure.in
544 --- mutt-1.5.10/configure.in 2005-08-11 23:49:24.000000000 +0200
545 +++ mutt-1.5.10-ro/configure.in 2005-08-14 12:10:21.000000000 +0200
547 AC_DEFINE(LOCALES_HACK,1,[ Define if the result of isprint() is unreliable. ])
550 +AC_ARG_ENABLE(compressed, AC_HELP_STRING([--enable-compressed], [Enable compressed folders support]),
551 + [if test x$enableval = xyes; then
552 + AC_DEFINE(USE_COMPRESSED,1, [ Define to support compressed folders. ])
555 AC_ARG_WITH(exec-shell, AC_HELP_STRING([--with-exec-shell=SHELL], [Specify alternate shell (ONLY if /bin/sh is broken)]),
556 [if test $withval != yes; then
557 AC_DEFINE_UNQUOTED(EXECSHELL, "$withval",
558 diff -urN mutt-1.5.10/curs_main.c mutt-1.5.10-ro/curs_main.c
559 --- mutt-1.5.10/curs_main.c 2005-08-11 21:37:01.000000000 +0200
560 +++ mutt-1.5.10-ro/curs_main.c 2005-08-14 12:10:21.000000000 +0200
561 @@ -1087,6 +1087,11 @@
565 +#ifdef USE_COMPRESSED
566 + if (Context->compressinfo && Context->realpath)
567 + mutt_str_replace (&LastFolder, Context->realpath);
570 mutt_str_replace (&LastFolder, Context->path);
571 oldcount = Context ? Context->msgcount : 0;
573 diff -urN mutt-1.5.10/doc/manual-4.html mutt-1.5.10-ro/doc/manual-4.html
574 diff -urN mutt-1.5.10/doc/manual-6.html mutt-1.5.10-ro/doc/manual-6.html
575 diff -urN mutt-1.5.10/doc/manual.html mutt-1.5.10-ro/doc/manual.html
576 diff -urN mutt-1.5.10/doc/manual.sgml mutt-1.5.10-ro/doc/manual.sgml
577 diff -urN mutt-1.5.10/doc/manual.sgml.head mutt-1.5.10-ro/doc/manual.sgml.head
578 diff -urN mutt-1.5.10/doc/manual.txt mutt-1.5.10-ro/doc/manual.txt
579 diff -urN mutt-1.5.10/doc/muttrc.man mutt-1.5.10-ro/doc/muttrc.man
580 diff -urN mutt-1.5.10/doc/muttrc.man.head mutt-1.5.10-ro/doc/muttrc.man.head
581 --- mutt-1.5.10/doc/muttrc.man.head 2005-01-15 10:42:45.000000000 +0100
582 +++ mutt-1.5.10-ro/doc/muttrc.man.head 2005-08-14 12:10:21.000000000 +0200
584 to a certain recipient. The meaning of "key ID" is to be taken
585 broadly: This can be a different e-mail address, a numerical key ID,
586 or even just an arbitrary search string.
589 +\fBopen-hook\fP \fIregexp\fP "\fIcommand\fP"
590 +\fBclose-hook\fP \fIregexp\fP "\fIcommand\fP"
591 +\fBappend-hook\fP \fIregexp\fP "\fIcommand\fP"
594 +These commands provide a way to handle compressed folders. The given
595 +\fBregexp\fP specifies which folders are taken as compressed (e.g.
596 +"\fI\\\\.gz$\fP"). The commands tell Mutt how to uncompress a folder
597 +(\fBopen-hook\fP), compress a folder (\fBclose-hook\fP) or append a
598 +compressed mail to a compressed folder (\fBappend-hook\fP). The
599 +\fIcommand\fP string is the
601 +like format string, and it should accept two parameters: \fB%f\fP,
602 +which is replaced with the (compressed) folder name, and \fB%t\fP
603 +which is replaced with the name of the temporary folder to which to
606 \fBpush\fP \fIstring\fP
607 This command adds the named \fIstring\fP to the keyboard buffer.
608 diff -urN mutt-1.5.10/hook.c mutt-1.5.10-ro/hook.c
609 --- mutt-1.5.10/hook.c 2005-02-03 19:47:52.000000000 +0100
610 +++ mutt-1.5.10-ro/hook.c 2005-08-14 12:10:21.000000000 +0200
613 #include "mutt_crypt.h"
615 +#ifdef USE_COMPRESSED
616 +#include "compress.h"
623 memset (&pattern, 0, sizeof (pattern));
624 pattern.data = safe_strdup (path);
626 +#ifdef USE_COMPRESSED
627 + else if (data & (M_APPENDHOOK | M_OPENHOOK | M_CLOSEHOOK))
629 + if (mutt_test_compress_command (command.data))
631 + strfcpy (err->data, _("bad formatted command string"), err->dsize);
636 else if (DefaultHook && !(data & (M_CHARSETHOOK | M_ACCOUNTHOOK))
637 && (!WithCrypto || !(data & M_CRYPTHOOK))
639 diff -urN mutt-1.5.10/init.h mutt-1.5.10-ro/init.h
640 --- mutt-1.5.10/init.h 2005-08-11 21:37:01.000000000 +0200
641 +++ mutt-1.5.10-ro/init.h 2005-08-14 12:10:21.000000000 +0200
642 @@ -2979,6 +2979,11 @@
643 { "fcc-hook", mutt_parse_hook, M_FCCHOOK },
644 { "fcc-save-hook", mutt_parse_hook, M_FCCHOOK | M_SAVEHOOK },
645 { "folder-hook", mutt_parse_hook, M_FOLDERHOOK },
646 +#ifdef USE_COMPRESSED
647 + { "open-hook", mutt_parse_hook, M_OPENHOOK },
648 + { "close-hook", mutt_parse_hook, M_CLOSEHOOK },
649 + { "append-hook", mutt_parse_hook, M_APPENDHOOK },
651 { "hdr_order", parse_list, UL &HeaderOrderList },
653 { "iconv-hook", mutt_parse_hook, M_ICONVHOOK },
654 diff -urN mutt-1.5.10/main.c mutt-1.5.10-ro/main.c
655 --- mutt-1.5.10/main.c 2005-08-11 21:37:01.000000000 +0200
656 +++ mutt-1.5.10-ro/main.c 2005-08-14 12:10:21.000000000 +0200
662 +#ifdef USE_COMPRESSED
670 diff -urN mutt-1.5.10/Makefile.am mutt-1.5.10-ro/Makefile.am
671 --- mutt-1.5.10/Makefile.am 2005-08-11 23:27:28.000000000 +0200
672 +++ mutt-1.5.10-ro/Makefile.am 2005-08-14 12:10:21.000000000 +0200
674 bin_PROGRAMS = mutt @DOTLOCK_TARGET@ @PGPAUX_TARGET@
675 mutt_SOURCES = $(BUILT_SOURCES) \
676 addrbook.c alias.c attach.c base64.c browser.c buffy.c color.c \
677 - crypt.c cryptglue.c \
678 + crypt.c cryptglue.c compress.c \
679 commands.c complete.c compose.c copy.c curs_lib.c curs_main.c date.c \
680 edit.c enter.c flags.c init.c filter.c from.c getdomain.c \
681 handler.c hash.c hdrline.c headers.c help.c hook.c keymap.c \
683 crypt-gpgme.c crypt-mod-pgp-gpgme.c crypt-mod-smime-gpgme.c
685 EXTRA_DIST = COPYRIGHT GPL OPS OPS.PGP OPS.CRYPT OPS.SMIME TODO \
686 - configure account.h \
687 + configure account.h compress.h \
688 attach.h buffy.h charset.h copy.h crypthash.h dotlock.h functions.h gen_defs \
689 globals.h hash.h history.h init.h keymap.h mutt_crypt.h \
690 mailbox.h mapping.h md5.h mime.h mutt.h mutt_curses.h mutt_menu.h \
691 diff -urN mutt-1.5.10/Makefile.in mutt-1.5.10-ro/Makefile.in
692 diff -urN mutt-1.5.10/mbox.c mutt-1.5.10-ro/mbox.c
693 --- mutt-1.5.10/mbox.c 2005-08-02 09:08:00.000000000 +0200
694 +++ mutt-1.5.10-ro/mbox.c 2005-08-14 12:10:21.000000000 +0200
699 +#ifdef USE_COMPRESSED
700 +#include "compress.h"
703 #include <sys/stat.h>
706 @@ -1014,6 +1018,12 @@
707 int mbox_close_mailbox (CONTEXT *ctx)
709 mx_unlock_file (ctx->path, fileno (ctx->fp), 1);
711 +#ifdef USE_COMPRESSED
712 + if (ctx->compressinfo)
713 + mutt_slow_close_compressed (ctx);
716 mutt_unblock_signals ();
717 mx_fastclose_mailbox (ctx);
719 diff -urN mutt-1.5.10/mutt.h mutt-1.5.10-ro/mutt.h
720 --- mutt-1.5.10/mutt.h 2005-08-11 21:37:23.000000000 +0200
721 +++ mutt-1.5.10-ro/mutt.h 2005-08-14 12:10:21.000000000 +0200
723 #define M_ACCOUNTHOOK (1<<9)
724 #define M_REPLYHOOK (1<<10)
725 #define M_SEND2HOOK (1<<11)
726 +#ifdef USE_COMPRESSED
727 +#define M_OPENHOOK (1<<12)
728 +#define M_APPENDHOOK (1<<13)
729 +#define M_CLOSEHOOK (1<<14)
732 /* tree characters for linearize_tree and print_enriched_string */
733 #define M_TREE_LLCORNER 1
735 void *data; /* driver specific data */
736 #endif /* USE_IMAP */
738 +#ifdef USE_COMPRESSED
739 + void *compressinfo; /* compressed mbox module private data */
740 + char *realpath; /* path to compressed mailbox */
741 +#endif /* USE_COMPRESSED */
743 short magic; /* mailbox type */
745 unsigned int locked : 1; /* is the mailbox locked? */
746 diff -urN mutt-1.5.10/Muttrc mutt-1.5.10-ro/Muttrc
747 diff -urN mutt-1.5.10/Muttrc.head mutt-1.5.10-ro/Muttrc.head
748 diff -urN mutt-1.5.10/Muttrc.head.in mutt-1.5.10-ro/Muttrc.head.in
749 diff -urN mutt-1.5.10/mx.c mutt-1.5.10-ro/mx.c
750 --- mutt-1.5.10/mx.c 2005-08-02 09:08:01.000000000 +0200
751 +++ mutt-1.5.10-ro/mx.c 2005-08-14 12:10:21.000000000 +0200
756 +#ifdef USE_COMPRESSED
757 +#include "compress.h"
767 +#ifdef USE_COMPRESSED
768 + if (magic == 0 && mutt_can_read_compressed (path))
769 + return M_COMPRESSED;
778 +#ifdef USE_COMPRESSED
779 + /* special case for appending to compressed folders -
780 + * even if we can not open them for reading */
781 + if (mutt_can_append_compressed (ctx->path))
782 + mutt_open_append_compressed (ctx);
791 ctx->magic = mx_get_magic (path);
794 +#ifdef USE_COMPRESSED
795 + if (ctx->magic == M_COMPRESSED)
796 + mutt_open_read_compressed (ctx);
800 mutt_error (_("%s is not a mailbox."), path);
803 mutt_free_header (&ctx->hdrs[i]);
806 +#ifdef USE_COMPRESSED
807 + if (ctx->compressinfo)
808 + mutt_fast_close_compressed (ctx);
811 FREE (&ctx->pattern);
812 if (ctx->limit_pattern)
814 if (tmp && tmp->new == 0)
815 mutt_update_mailbox (tmp);
818 +#ifdef USE_COMPRESSED
819 + if (rc == 0 && ctx->compressinfo)
820 + return mutt_sync_compressed (ctx);
826 @@ -1021,6 +1051,11 @@
827 !mutt_is_spool(ctx->path) && !option (OPTSAVEEMPTY))
828 mx_unlink_empty (ctx->path);
830 +#ifdef USE_COMPRESSED
831 + if (ctx->compressinfo && mutt_slow_close_compressed (ctx))
835 mx_fastclose_mailbox (ctx);
838 @@ -1330,6 +1365,11 @@
842 +#ifdef USE_COMPRESSED
843 + if (ctx->compressinfo)
844 + return mutt_check_mailbox_compressed (ctx);
849 if (ctx->locked) lock = 0;
850 diff -urN mutt-1.5.10/mx.h mutt-1.5.10-ro/mx.h
851 --- mutt-1.5.10/mx.h 2003-08-05 15:58:16.000000000 +0200
852 +++ mutt-1.5.10-ro/mx.h 2005-08-14 12:10:21.000000000 +0200
857 +#ifdef USE_COMPRESSED
862 WHERE short DefaultMagic INITVAL (M_MBOX);
863 diff -urN mutt-1.5.10/PATCHES mutt-1.5.10-ro/PATCHES
864 --- mutt-1.5.10/PATCHES 2005-08-11 23:27:30.000000000 +0200
865 +++ mutt-1.5.10-ro/PATCHES 2005-08-14 12:10:35.000000000 +0200
867 +patch-1.5.10.rr.compressed.1
868 diff -urN mutt-1.5.10/po/de.po mutt-1.5.10-ro/po/de.po
869 --- mutt-1.5.10/po/de.po 2005-08-11 23:50:35.000000000 +0200
870 +++ mutt-1.5.10-ro/po/de.po 2005-08-14 12:12:20.000000000 +0200
871 @@ -1281,6 +1281,48 @@
872 msgid "Failed to figure out sender"
873 msgstr "Kann Datei nicht öffnen, um Nachrichtenkopf zu untersuchen."
875 +#: compress.c:203 mbox.c:661
876 +msgid "Mailbox was corrupted!"
877 +msgstr "Mailbox wurde zerstört!"
879 +#: compress.c:228 compress.c:253
881 +msgid "Decompressing %s...\n"
882 +msgstr "Entpacke %s...\n"
884 +#: compress.c:246 compress.c:367 compress.c:443 mbox.c:706
885 +msgid "Unable to lock mailbox!"
886 +msgstr "Kann Mailbox nicht für exklusiven Zugriff sperren!"
890 +msgid "Error executing: %s : unable to open the mailbox!\n"
891 +msgstr "Fehler beim Ausführen von %s : Kann die Mailbox nicht öffnen!\n"
893 +#: compress.c:350 compress.c:377 compress.c:423 compress.c:454
895 +msgid "Compressing %s...\n"
896 +msgstr "Komprimiere %s...\n"
901 +"%s: Error compressing mailbox! Original mailbox deleted, uncompressed one "
904 +"%s: Fehler beim Komprimieren der Mailbox! Ursprüngliche Mailbox gelöscht, "
905 +"entpackte gespeichert!\n"
907 +#: compress.c:425 compress.c:456
909 +msgid "Compressed-appending to %s...\n"
910 +msgstr "Hänge komprimiert an %s... an\n"
914 +msgid " %s: Error compressing mailbox! Uncompressed one kept!\n"
915 +msgstr " %s: Fehler beim packen der Mailbox! Entpackte Mailbox gespeichert!\n"
919 msgid " (current time: %c)"
920 @@ -1901,6 +1943,10 @@
922 msgstr "Hilfe für %s"
925 +msgid "bad formatted command string"
926 +msgstr "Hook enthält nicht die Muster %f und %t"
930 msgid "unhook: Can't do unhook * from within a hook."
931 @@ -3383,18 +3429,10 @@
932 msgid "Mailbox is corrupt!"
933 msgstr "Mailbox fehlerhaft!"
936 -msgid "Mailbox was corrupted!"
937 -msgstr "Mailbox wurde zerstört!"
939 #: mbox.c:701 mbox.c:952
940 msgid "Fatal error! Could not reopen mailbox!"
941 msgstr "Fataler Fehler, konnte Mailbox nicht erneut öffnen!"
944 -msgid "Unable to lock mailbox!"
945 -msgstr "Kann Mailbox nicht für exklusiven Zugriff sperren!"
947 #. this means ctx->changed or ctx->deleted was set, but no
948 #. * messages were found to be changed or deleted. This should
949 #. * never happen, is we presume it is a bug in mutt.
950 diff -urN mutt-1.5.10/po/POTFILES.in mutt-1.5.10-ro/po/POTFILES.in
951 --- mutt-1.5.10/po/POTFILES.in 2005-08-03 11:17:47.000000000 +0200
952 +++ mutt-1.5.10-ro/po/POTFILES.in 2005-08-14 12:13:18.000000000 +0200
961 diff -urN mutt-1.5.10/status.c mutt-1.5.10-ro/status.c
962 --- mutt-1.5.10/status.c 2005-02-03 19:47:53.000000000 +0100
963 +++ mutt-1.5.10-ro/status.c 2005-08-14 12:10:21.000000000 +0200
967 snprintf (fmt, sizeof(fmt), "%%%ss", prefix);
968 +#ifdef USE_COMPRESSED
969 + if (Context && Context->compressinfo && Context->realpath)
971 + strfcpy (tmp, Context->realpath, sizeof (tmp));
972 + mutt_pretty_mailbox (tmp);
976 if (Context && Context->path)
978 strfcpy (tmp, Context->path, sizeof (tmp));