File: compressed-folders

package info (click to toggle)
mutt 1.5.9-2sarge2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 3,484 kB
  • ctags: 17
  • sloc: sh: 315; makefile: 231; perl: 80
file content (1185 lines) | stat: -rw-r--r-- 35,910 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
# vi: ft=diff
This is the compressed folders patch by Roland Rosenfeld
<roland@spinnaker.de>.

The home page for this patch is:

  http://www.spinnaker.de/mutt/compressed/

* Patch last synced with upstream:
  - Date: 2005-04-03
  - File: http://www.spinnaker.de/mutt/compressed/patch-1.5.9.rr.compressed.1.gz

* Changes made:
  - filterdiff -p1 \
    $(for f in Makefile.in config.h.in configure 'Muttrc*' doc/manual.txt \
      doc/manual.sgml 'doc/manual*.html' doc/muttrc.man; do echo "-x $f"; done)
  - 2005-03-10: fix configure.in to match latest CVS.

== END PATCH
diff -urN mutt-1.5.9/compress.c mutt-1.5.9-ro/compress.c
--- mutt-1.5.9/compress.c	1970-01-01 01:00:00.000000000 +0100
+++ mutt-1.5.9-ro/compress.c	2005-03-20 14:06:20.000000000 +0100
@@ -0,0 +1,487 @@
+/*
+ * Copyright (C) 1997 Alain Penders <Alain@Finale-Dev.com>
+ *
+ *     This program is free software; you can redistribute it and/or modify
+ *     it under the terms of the GNU General Public License as published by
+ *     the Free Software Foundation; either version 2 of the License, or
+ *     (at your option) any later version.
+ *
+ *     This program is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ *     You should have received a copy of the GNU General Public License
+ *     along with this program; if not, write to the Free Software
+ *     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#if HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "mutt.h"
+
+#ifdef USE_COMPRESSED
+
+#include "mx.h"
+#include "mailbox.h"
+#include "mutt_curses.h"
+
+#include <errno.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/stat.h>
+
+typedef struct
+{
+  const char *close;	/* close-hook  command */
+  const char *open;	/* open-hook   command */
+  const char *append;	/* append-hook command */
+  off_t size;		/* size of real folder */
+} COMPRESS_INFO;
+
+
+/*
+ * ctx - context to lock
+ * excl - exclusive lock?
+ * retry - should retry if unable to lock?
+ */
+int mbox_lock_compressed (CONTEXT *ctx, FILE *fp, int excl, int retry)
+{
+  int r;
+
+  if ((r = mx_lock_file (ctx->realpath, fileno (fp), excl, 1, retry)) == 0)
+    ctx->locked = 1;
+  else if (retry && !excl)
+  {
+    ctx->readonly = 1;
+    return 0;
+  }
+
+  return (r);
+}
+
+void mbox_unlock_compressed (CONTEXT *ctx, FILE *fp)
+{
+  if (ctx->locked)
+  {
+    fflush (fp);
+
+    mx_unlock_file (ctx->realpath, fileno (fp), 1);
+    ctx->locked = 0;
+  }
+}
+
+static int is_new (const char *path)
+{
+  return (access (path, W_OK) != 0 && errno == ENOENT) ? 1 : 0;
+}
+
+static const char* find_compress_hook (int type, const char *path)
+{
+  const char* c = mutt_find_hook (type, path);
+  return (!c || !*c) ? NULL : c;
+}
+
+int mutt_can_read_compressed (const char *path)
+{
+  return find_compress_hook (M_OPENHOOK, path) ? 1 : 0;
+}
+
+/*
+ * if the file is new, we really do not append, but create, and so use
+ * close-hook, and not append-hook
+ */
+static const char* get_append_command (const char *path, const CONTEXT* ctx)
+{
+  COMPRESS_INFO *ci = (COMPRESS_INFO *) ctx->compressinfo;
+  return (is_new (path)) ? ci->close : ci->append;
+}
+
+int mutt_can_append_compressed (const char *path)
+{
+  int magic;
+
+  if (is_new (path))
+    return (find_compress_hook (M_CLOSEHOOK, path) ? 1 : 0);
+
+  magic = mx_get_magic (path);
+
+  if (magic != 0 && magic != M_COMPRESSED)
+    return 0;
+
+  return (find_compress_hook (M_APPENDHOOK, path)
+	  || (find_compress_hook (M_OPENHOOK, path)
+	      && find_compress_hook (M_CLOSEHOOK, path))) ? 1 : 0;
+}
+
+/* open a compressed mailbox */
+static COMPRESS_INFO *set_compress_info (CONTEXT *ctx)
+{
+  COMPRESS_INFO *ci;
+
+  /* Now lets uncompress this thing */
+  ci = safe_malloc (sizeof (COMPRESS_INFO));
+  ctx->compressinfo = (void*) ci;
+  ci->append = find_compress_hook (M_APPENDHOOK, ctx->path);
+  ci->open = find_compress_hook (M_OPENHOOK, ctx->path);
+  ci->close = find_compress_hook (M_CLOSEHOOK, ctx->path);
+  return ci;
+}
+
+static void set_path (CONTEXT* ctx)
+{
+  char tmppath[_POSIX_PATH_MAX];
+
+  /* Setup the right paths */
+  ctx->realpath = ctx->path;
+
+  /* Uncompress to /tmp */
+  mutt_mktemp (tmppath);
+  ctx->path = safe_malloc (strlen (tmppath) + 1);
+  strcpy (ctx->path, tmppath);
+}
+
+static int get_size (const char* path)
+{
+  struct stat sb;
+  if (stat (path, &sb) != 0)
+    return 0;
+  return (sb.st_size);
+}
+
+static void store_size (CONTEXT* ctx)
+{
+  COMPRESS_INFO *ci = (COMPRESS_INFO *) ctx->compressinfo;
+  ci->size = get_size (ctx->realpath);
+}
+
+static const char *
+compresshook_format_str (char *dest, size_t destlen, char op, const char *src,
+			 const char *fmt, const char *ifstring,
+			 const char *elsestring, unsigned long data,
+			 format_flag flags)
+{
+  char tmp[SHORT_STRING];
+
+  CONTEXT *ctx = (CONTEXT *) data;
+  switch (op)
+  {
+  case 'f':
+    snprintf (tmp, sizeof (tmp), "%%%ss", fmt);
+    snprintf (dest, destlen, tmp, ctx->realpath);
+    break;
+  case 't':
+    snprintf (tmp, sizeof (tmp), "%%%ss", fmt);
+    snprintf (dest, destlen, tmp, ctx->path);
+    break;
+  }
+  return (src);
+}
+
+/*
+ * check that the command has both %f and %t
+ * 0 means OK, -1 means error
+ */
+int mutt_test_compress_command (const char* cmd)
+{
+  return (strstr (cmd, "%f") && strstr (cmd, "%t")) ? 0 : -1;
+}
+
+static char *get_compression_cmd (const char* cmd, const CONTEXT* ctx)
+{
+  char expanded[_POSIX_PATH_MAX];
+  mutt_FormatString (expanded, sizeof (expanded), cmd, compresshook_format_str,
+		     (unsigned long) ctx, 0);
+  return safe_strdup (expanded);
+}
+
+int mutt_check_mailbox_compressed (CONTEXT* ctx)
+{
+  COMPRESS_INFO *ci = (COMPRESS_INFO *) ctx->compressinfo;
+  if (ci->size != get_size (ctx->realpath))
+  {
+    FREE (&ctx->compressinfo);
+    FREE (&ctx->realpath);
+    mutt_error _("Mailbox was corrupted!");
+    return (-1);
+  }
+  return (0);
+}
+
+int mutt_open_read_compressed (CONTEXT *ctx)
+{
+  char *cmd;
+  FILE *fp;
+  int rc;
+
+  COMPRESS_INFO *ci = set_compress_info (ctx);
+  if (!ci->open) {
+    ctx->magic = 0;
+    FREE (ctx->compressinfo);
+    return (-1);
+  }
+  if (!ci->close || access (ctx->path, W_OK) != 0)
+    ctx->readonly = 1;
+
+  set_path (ctx);
+  store_size (ctx);
+
+  if (!ctx->quiet)
+    mutt_message (_("Decompressing %s..."), ctx->realpath);
+
+  cmd = get_compression_cmd (ci->open, ctx);
+  if (cmd == NULL)
+    return (-1);
+  dprint (2, (debugfile, "DecompressCmd: '%s'\n", cmd));
+
+  if ((fp = fopen (ctx->realpath, "r")) == NULL)
+  {
+    mutt_perror (ctx->realpath);
+    FREE (&cmd);
+    return (-1);
+  }
+  mutt_block_signals ();
+  if (mbox_lock_compressed (ctx, fp, 0, 1) == -1)
+  {
+    fclose (fp);
+    mutt_unblock_signals ();
+    mutt_error _("Unable to lock mailbox!");
+    FREE (&cmd);
+    return (-1);
+  }
+
+  endwin ();
+  fflush (stdout);
+  fprintf (stderr, _("Decompressing %s...\n"),ctx->realpath);
+  rc = mutt_system (cmd);
+  mbox_unlock_compressed (ctx, fp);
+  mutt_unblock_signals ();
+  fclose (fp);
+
+  if (rc)
+  {
+    mutt_any_key_to_continue (NULL);
+    ctx->magic = 0;
+    FREE (ctx->compressinfo);
+    mutt_error (_("Error executing: %s : unable to open the mailbox!\n"), cmd);
+  }
+  FREE (&cmd);
+  if (rc)
+    return (-1);
+
+  if (mutt_check_mailbox_compressed (ctx))
+    return (-1);
+
+  ctx->magic = mx_get_magic (ctx->path);
+
+  return (0);
+}
+
+void restore_path (CONTEXT* ctx)
+{
+  FREE (&ctx->path);
+  ctx->path = ctx->realpath;
+}
+
+/* remove the temporary mailbox */
+void remove_file (CONTEXT* ctx)
+{
+  if (ctx->magic == M_MBOX || ctx->magic == M_MMDF)
+    remove (ctx->path);
+}
+
+int mutt_open_append_compressed (CONTEXT *ctx)
+{
+  FILE *fh;
+  COMPRESS_INFO *ci = set_compress_info (ctx);
+
+  if (!get_append_command (ctx->path, ctx))
+  {
+    if (ci->open && ci->close)
+      return (mutt_open_read_compressed (ctx));
+
+    ctx->magic = 0;
+    FREE (&ctx->compressinfo);
+    return (-1);
+  }
+
+  set_path (ctx);
+
+  ctx->magic = DefaultMagic;
+
+  if (!is_new (ctx->realpath))
+    if (ctx->magic == M_MBOX || ctx->magic == M_MMDF)
+      if ((fh = fopen (ctx->path, "w")))
+	fclose (fh);
+  /* No error checking - the parent function will catch it */
+
+  return (0);
+}
+
+/* close a compressed mailbox */
+void mutt_fast_close_compressed (CONTEXT *ctx)
+{
+  dprint (2, (debugfile, "mutt_fast_close_compressed called on '%s'\n",
+	      ctx->path));
+
+  if (ctx->compressinfo)
+  {
+    if (ctx->fp)
+      fclose (ctx->fp);
+    ctx->fp = NULL;
+    /* if the folder was removed, remove the gzipped folder too */
+    if ((ctx->magic > 0) 
+	&& (access (ctx->path, F_OK) != 0) 
+	&& ! option (OPTSAVEEMPTY))
+      remove (ctx->realpath);
+    else
+      remove_file (ctx);
+
+    restore_path (ctx);
+    FREE (&ctx->compressinfo);
+  }
+}
+
+/* return 0 on success, -1 on failure */
+int mutt_sync_compressed (CONTEXT* ctx)
+{
+  char *cmd;
+  int rc = 0;
+  FILE *fp;
+  COMPRESS_INFO *ci = (COMPRESS_INFO *) ctx->compressinfo;
+
+  if (!ctx->quiet)
+    mutt_message (_("Compressing %s..."), ctx->realpath);
+
+  cmd = get_compression_cmd (ci->close, ctx);
+  if (cmd == NULL)
+    return (-1);
+
+  if ((fp = fopen (ctx->realpath, "a")) == NULL)
+  {
+    mutt_perror (ctx->realpath);
+    FREE (&cmd);
+    return (-1);
+  }
+  mutt_block_signals ();
+  if (mbox_lock_compressed (ctx, fp, 1, 1) == -1)
+  {
+    fclose (fp);
+    mutt_unblock_signals ();
+    mutt_error _("Unable to lock mailbox!");
+    store_size (ctx);
+    FREE (&cmd);
+    return (-1);
+  }
+
+  dprint (2, (debugfile, "CompressCommand: '%s'\n", cmd));
+
+  endwin ();
+  fflush (stdout);
+  fprintf (stderr, _("Compressing %s...\n"), ctx->realpath);
+  if (mutt_system (cmd))
+  {
+    mutt_any_key_to_continue (NULL);
+    mutt_error (_("%s: Error compressing mailbox! Original mailbox deleted, uncompressed one kept!\n"), ctx->path);
+    rc = -1;
+  }
+
+  mbox_unlock_compressed (ctx, fp);
+  mutt_unblock_signals ();
+  fclose (fp);
+
+  FREE (&cmd);
+
+  store_size (ctx);
+
+  return (rc);
+}
+
+int mutt_slow_close_compressed (CONTEXT *ctx)
+{
+  FILE *fp;
+  const char *append;
+  char *cmd;
+  COMPRESS_INFO *ci = (COMPRESS_INFO *) ctx->compressinfo;
+
+  dprint (2, (debugfile, "mutt_slow_close_compressed called on '%s'\n",
+	      ctx->path));
+
+  if (! (ctx->append
+	 && ((append = get_append_command (ctx->realpath, ctx))
+	     || (append = ci->close))))
+  { 
+    /* if we can not or should not append, we only have to remove the */
+    /* compressed info, because sync was already called               */
+    mutt_fast_close_compressed (ctx);
+    return (0);
+  }
+
+  if (ctx->fp)
+    fclose (ctx->fp);
+  ctx->fp = NULL;
+
+  if (!ctx->quiet)
+  {
+    if (append == ci->close)
+      mutt_message (_("Compressing %s..."), ctx->realpath);
+    else
+      mutt_message (_("Compressed-appending to %s..."), ctx->realpath);
+  }
+
+  cmd = get_compression_cmd (append, ctx);
+  if (cmd == NULL)
+    return (-1);
+
+  if ((fp = fopen (ctx->realpath, "a")) == NULL)
+  {
+    mutt_perror (ctx->realpath);
+    FREE (&cmd);
+    return (-1);
+  }
+  mutt_block_signals ();
+  if (mbox_lock_compressed (ctx, fp, 1, 1) == -1)
+  {
+    fclose (fp);
+    mutt_unblock_signals ();
+    mutt_error _("Unable to lock mailbox!");
+    FREE (&cmd);
+    return (-1);
+  }
+
+  dprint (2, (debugfile, "CompressCmd: '%s'\n", cmd));
+
+  endwin ();
+  fflush (stdout);
+
+  if (append == ci->close)
+    fprintf (stderr, _("Compressing %s...\n"), ctx->realpath);
+  else
+    fprintf (stderr, _("Compressed-appending to %s...\n"), ctx->realpath);
+
+  if (mutt_system (cmd))
+  {
+    mutt_any_key_to_continue (NULL);
+    mutt_error (_(" %s: Error compressing mailbox!  Uncompressed one kept!\n"),
+		ctx->path);
+    FREE (&cmd);
+    mbox_unlock_compressed (ctx, fp);
+    mutt_unblock_signals ();
+    fclose (fp);
+    return (-1);
+  }
+
+  mbox_unlock_compressed (ctx, fp);
+  mutt_unblock_signals ();
+  fclose (fp);
+  remove_file (ctx);
+  restore_path (ctx);
+  FREE (&cmd);
+  FREE (&ctx->compressinfo);
+
+  return (0);
+}
+
+#endif /* USE_COMPRESSED */
diff -urN mutt-1.5.9/compress.h mutt-1.5.9-ro/compress.h
--- mutt-1.5.9/compress.h	1970-01-01 01:00:00.000000000 +0100
+++ mutt-1.5.9-ro/compress.h	2005-03-20 14:06:20.000000000 +0100
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 1997 Alain Penders <Alain@Finale-Dev.com>
+ *
+ *     This program is free software; you can redistribute it and/or modify
+ *     it under the terms of the GNU General Public License as published by
+ *     the Free Software Foundation; either version 2 of the License, or
+ *     (at your option) any later version.
+ *
+ *     This program is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ *     You should have received a copy of the GNU General Public License
+ *     along with this program; if not, write to the Free Software
+ *     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+int mutt_can_read_compressed (const char *);
+int mutt_can_append_compressed (const char *);
+int mutt_open_read_compressed (CONTEXT *);
+int mutt_open_append_compressed (CONTEXT *);
+int mutt_slow_close_compressed (CONTEXT *);
+int mutt_sync_compressed (CONTEXT *);
+int mutt_test_compress_command (const char *);
+int mutt_check_mailbox_compressed (CONTEXT *);
+void mutt_fast_close_compressed (CONTEXT *);
diff -urN mutt-1.5.9/config.h.in mutt-1.5.9-ro/config.h.in
diff -urN mutt-1.5.9/configure mutt-1.5.9-ro/configure
diff -urN mutt-1.5.9/configure.in mutt-1.5.9-ro/configure.in
--- mutt-1.5.9/configure.in	2005-03-13 17:36:01.000000000 +0100
+++ mutt-1.5.9-ro/configure.in	2005-03-20 14:11:05.000000000 +0100
@@ -777,6 +777,11 @@
                 AC_DEFINE(LOCALES_HACK,1,[ Define if the result of isprint() is unreliable. ])
         fi])
 
+AC_ARG_ENABLE(compressed, AC_HELP_STRING([--enable-compressed], [Enable compressed folders support]),
+	[if test x$enableval = xyes; then
+                AC_DEFINE(USE_COMPRESSED,1, [ Define to support compressed folders. ])
+        fi])
+
 AC_ARG_WITH(exec-shell, AC_HELP_STRING([--with-exec-shell=SHELL], [Specify alternate shell (ONLY if /bin/sh is broken)]),
         [if test $withval != yes; then
                 AC_DEFINE_UNQUOTED(EXECSHELL, "$withval",
diff -urN mutt-1.5.9/curs_main.c mutt-1.5.9-ro/curs_main.c
--- mutt-1.5.9/curs_main.c	2005-02-28 19:36:35.000000000 +0100
+++ mutt-1.5.9-ro/curs_main.c	2005-03-20 14:06:20.000000000 +0100
@@ -1076,6 +1076,11 @@
         {
 	  int check;
 
+#ifdef USE_COMPRESSED
+	  if (Context->compressinfo && Context->realpath)
+	    mutt_str_replace (&LastFolder, Context->realpath);
+	  else
+#endif
 	  mutt_str_replace (&LastFolder, Context->path);
 	  oldcount = Context ? Context->msgcount : 0;
 
diff -urN mutt-1.5.9/doc/manual-4.html mutt-1.5.9-ro/doc/manual-4.html
diff -urN mutt-1.5.9/doc/manual-6.html mutt-1.5.9-ro/doc/manual-6.html
diff -urN mutt-1.5.9/doc/manual.html mutt-1.5.9-ro/doc/manual.html
diff -urN mutt-1.5.9/doc/manual.sgml mutt-1.5.9-ro/doc/manual.sgml
diff -urN mutt-1.5.9/doc/manual.sgml.head mutt-1.5.9-ro/doc/manual.sgml.head
--- mutt-1.5.9/doc/manual.sgml.head	2005-02-19 14:49:49.000000000 +0100
+++ mutt-1.5.9-ro/doc/manual.sgml.head	2005-03-20 14:06:20.000000000 +0100
@@ -2539,6 +2539,176 @@
 macro pager \cb |urlview\n
 </verb></tscreen>
 
+<sect1>Compressed folders Support (OPTIONAL)
+<p>
+
+If Mutt was compiled with compressed folders support (by running the
+<em/configure/ script with the <em/--enable-compressed/ flag), Mutt
+can open folders stored in an arbitrary format, provided that the user
+has a script to convert from/to this format to one of the accepted.
+
+The most common use is to open compressed archived folders e.g. with
+gzip.
+
+In addition, the user can provide a script that gets a folder in an
+accepted format and appends its context to the folder in the
+user-defined format, which may be faster than converting the entire
+folder to the accepted format, appending to it and converting back to
+the user-defined format.
+
+There are three hooks defined (<ref id="open-hook" name="open-hook">,
+<ref id="close-hook" name="close-hook"> and <ref id="append-hook"
+name="append-hook">) which define commands to uncompress and compress
+a folder and to append messages to an existing compressed folder 
+respectively.
+
+For example:
+
+<tscreen><verb>
+open-hook \\.gz$ "gzip -cd %f &gt; %t" 
+close-hook \\.gz$ "gzip -c %t &gt; %f"
+append-hook \\.gz$ "gzip -c %t &gt;&gt; %f" 
+</verb></tscreen>
+
+You do not have to specify all of the commands. If you omit <ref
+id="append-hook" name="append-hook">, the folder will be open and
+closed again each time you will add to it. If you omit <ref
+id="close-hook" name="close-hook"> (or give empty command) , the
+folder will be open in the  mode. If you specify <ref
+id="append-hook" name="append-hook"> though you'll be able to append
+to the folder.
+
+Note that Mutt will only try to use hooks if the file is not in one of
+the accepted formats. In particular, if the file is empty, mutt
+supposes it is not compressed. This is important because it allows the
+use of programs that do not have well defined extensions. Just use
+&dquot;.&dquot; as a regexp. But this may be surprising if your
+compressing script produces empty files. In this situation, unset <ref
+id="save_empty" name="&dollar;save&lowbar;empty">, so that the compressed file
+will be removed if you delete all of the messages.
+
+<sect2>Open a compressed mailbox for reading<label id="open-hook">
+<p>
+Usage: <tt/open-hook/ <em/regexp/ &dquot;<em/command/&dquot;
+
+The <em/command/ is the command that can be used for opening the
+folders whose names match <em/regexp/.
+
+The <em/command/ string is the printf-like format string, and it
+should accept two parameters: &percnt;f, which is replaced with the
+(compressed) folder name, and &percnt;t which is replaced with the
+name of the temporary folder to which to write.
+
+&percnt;f and &percnt;t can be repeated any number of times in the
+command string, and all of the entries are replaced with the
+appropriate folder name. In addition, &percnt;&percnt; is replaced by
+&percnt;, as in printf, and any other &percnt;anything is left as is.
+
+The <em/command/ should <bf/not/ remove the original compressed file.
+The <em/command/ should return non-zero exit status if it fails, so
+mutt knows something's wrong.
+
+Example:
+
+<tscreen><verb>
+open-hook \\.gz$ "gzip -cd %f &gt; %t" 
+</verb></tscreen>
+
+If the <em/command/ is empty, this operation is disabled for this file
+type.
+
+<sect2>Write a compressed mailbox<label id="close-hook">
+<p>
+Usage: <tt/close-hook/ <em/regexp/ &dquot;<em/command/&dquot;
+
+This is used to close the folder that was open with the <ref id="open-hook" 
+name="open-hook"> command after some changes were made to it.
+
+The <em/command/ string is the command that can be used for closing the
+folders whose names match <em/regexp/. It has the same format as in 
+the <ref id="open-hook" name="open-hook"> command. Temporary folder
+in this case is the folder previously produced by the <ref id="open-hook"
+name="open-hook"> command.
+
+The <em/command/ should <bf/not/ remove the decompressed file. The
+<em/command/ should return non-zero exit status if it fails, so mutt
+knows something's wrong.
+
+Example:
+
+<tscreen><verb>
+close-hook \\.gz$ "gzip -c %t &gt; %f"
+</verb></tscreen>
+
+If the <em/command/ is empty, this operation is disabled for this file
+type, and the file can only be open in the read-only mode.
+
+<ref id="close-hook" name ="close-hook"> is not called when you exit
+from the folder if the folder was not changed.
+
+<sect2>Append a message to a compressed mailbox<label id="append-hook">
+<p>
+Usage: <tt/append-hook/ <em/regexp/ &dquot;<em/command/&dquot;
+
+This command is used for saving to an existing compressed folder.
+The <em/command/ is the command that can be used for appending to the
+folders whose names match <em/regexp/. It has the same format as in 
+ the <ref id="open-hook" name="open-hook"> command.
+The temporary folder in this case contains the messages that are being
+appended. 
+
+The <em/command/ should <bf/not/ remove the decompressed file. The
+<em/command/ should return non-zero exit status if it fails, so mutt
+knows something's wrong.
+
+Example:
+
+<tscreen><verb>
+append-hook \\.gz$ "gzip -c %t &gt;&gt; %f" 
+</verb></tscreen>
+
+When <ref id="append-hook" name="append-hook"> is used, the folder is
+not opened, which saves time, but this means that we can not find out
+what the folder type is. Thus the default (<ref id="mbox_type"
+name="&dollar;mbox&lowbar;type">) type is always supposed (i.e.
+this is the format used for the temporary folder).
+
+If the file does not exist when you save to it, <ref id="close-hook"
+name="close-hook"> is called, and not <ref id="append-hook"
+name="append-hook">. <ref id="append-hook" name="append-hook"> is only
+for appending to existing folders.
+
+If the <em/command/ is empty, this operation is disabled for this file
+type. In this case, the folder will be open and closed again (using
+<ref id="open-hook" name="open-hook"> and <ref id="close-hook" 
+name="close-hook">respectively) each time you will add to it.
+
+<sect2>Encrypted folders
+<p>
+The compressed folders support can also be used to handle encrypted
+folders. If you want to encrypt a folder with PGP, you may want to use
+the following hooks:
+
+<tscreen><verb>
+open-hook  \\.pgp$ "pgp -f &lt; %f &gt; %t"
+close-hook \\.pgp$ "pgp -fe YourPgpUserIdOrKeyId &lt; %t &gt; %f"
+</verb></tscreen>
+
+Please note, that PGP does not support appending to an encrypted
+folder, so there is no append-hook defined.
+
+If you are using GnuPG instead of PGP, you may use the following hooks
+instead:
+
+<tscreen><verb>
+open-hook  \\.gpg$ "gpg --decrypt &lt; %f &gt; %t"
+close-hook \\.gpg$ "gpg --encrypt --recipient YourGpgUserIdOrKeyId &lt; %t &gt; %f"
+</verb></tscreen>
+
+<bf/Note:/ the folder is temporary stored decrypted in the /tmp
+directory, where it can be read by your system administrator. So think
+about the security aspects of this.
+
 <sect>Mutt's MIME Support
 <p>
 Quite a bit of effort has been made to make Mutt the premier text-mode
@@ -3118,6 +3288,8 @@
 <item>
 <tt><ref id="alternative_order" name="unalternative&lowbar;order"></tt> <em/mimetype/ &lsqb; <em/mimetype/ ... &rsqb;
 <item>
+<tt><ref id="append-hook" name="append-hook"></tt> <em/regexp/ &dquot;<em/command/&dquot;
+<item>
 <tt><ref id="auto_view" name="auto&lowbar;view"></tt> <em/mimetype/ &lsqb; <em/mimetype/ ... &rsqb;
 <item>
 <tt><ref id="auto_view" name="unauto&lowbar;view"></tt> <em/mimetype/ &lsqb; <em/mimetype/ ... &rsqb;
@@ -3126,6 +3298,8 @@
 <item>
 <tt><ref id="charset-hook" name="charset-hook"></tt> <em/alias/ <em/charset/
 <item>
+<tt><ref id="close-hook" name="close-hook"></tt> <em/regexp/ &dquot;<em/command/&dquot;
+<item>
 <tt><ref id="color" name="color"></tt> <em/object/ <em/foreground/ <em/background/ &lsqb; <em/regexp/ &rsqb;
 <item>
 <tt><ref id="color" name="uncolor"></tt> <em/index/ <em/pattern/ &lsqb; <em/pattern/ ... &rsqb;
@@ -3172,6 +3346,8 @@
 <item>
 <tt><ref id="my_hdr" name="unmy&lowbar;hdr"></tt> <em/field/ &lsqb; <em/field/ ... &rsqb;
 <item>
+<tt><ref id="open-hook" name="open-hook"></tt> <em/regexp/ &dquot;<em/command/&dquot;
+<item>
 <tt><ref id="crypt-hook" name="crypt-hook"></tt> <em/pattern/ <em/key-id/
 <item>
 <tt><ref id="push" name="push"></tt> <em/string/
diff -urN mutt-1.5.9/doc/manual.txt mutt-1.5.9-ro/doc/manual.txt
diff -urN mutt-1.5.9/doc/muttrc.man mutt-1.5.9-ro/doc/muttrc.man
diff -urN mutt-1.5.9/doc/muttrc.man.head mutt-1.5.9-ro/doc/muttrc.man.head
--- mutt-1.5.9/doc/muttrc.man.head	2005-01-15 10:42:45.000000000 +0100
+++ mutt-1.5.9-ro/doc/muttrc.man.head	2005-03-20 14:06:20.000000000 +0100
@@ -316,6 +316,24 @@
 to a certain recipient.  The meaning of "key ID" is to be taken
 broadly: This can be a different e-mail address, a numerical key ID,
 or even just an arbitrary search string.
+.PP
+.nf
+\fBopen-hook\fP \fIregexp\fP "\fIcommand\fP"
+\fBclose-hook\fP \fIregexp\fP "\fIcommand\fP"
+\fBappend-hook\fP \fIregexp\fP "\fIcommand\fP"
+.fi
+.IP
+These commands provide a way to handle compressed folders. The given
+\fBregexp\fP specifies which folders are taken as compressed (e.g.
+"\fI\\\\.gz$\fP"). The commands tell Mutt how to uncompress a folder
+(\fBopen-hook\fP), compress a folder (\fBclose-hook\fP) or append a
+compressed mail to a compressed folder (\fBappend-hook\fP). The
+\fIcommand\fP string is the 
+.BR printf (3)
+like format string, and it should accept two parameters: \fB%f\fP,
+which is replaced with the (compressed) folder name, and \fB%t\fP
+which is replaced with the name of the temporary folder to which to
+write.
 .TP
 \fBpush\fP \fIstring\fP
 This command adds the named \fIstring\fP to the keyboard buffer.
diff -urN mutt-1.5.9/hook.c mutt-1.5.9-ro/hook.c
--- mutt-1.5.9/hook.c	2005-02-03 19:47:52.000000000 +0100
+++ mutt-1.5.9-ro/hook.c	2005-03-20 14:06:20.000000000 +0100
@@ -24,6 +24,10 @@
 #include "mailbox.h"
 #include "mutt_crypt.h"
 
+#ifdef USE_COMPRESSED
+#include "compress.h"
+#endif
+
 #include <limits.h>
 #include <string.h>
 #include <stdlib.h>
@@ -92,6 +96,16 @@
     memset (&pattern, 0, sizeof (pattern));
     pattern.data = safe_strdup (path);
   }
+#ifdef USE_COMPRESSED
+  else if (data & (M_APPENDHOOK | M_OPENHOOK | M_CLOSEHOOK))
+  {
+    if (mutt_test_compress_command (command.data))
+    {
+      strfcpy (err->data, _("bad formatted command string"), err->dsize);
+      return (-1);
+    }
+  }
+#endif
   else if (DefaultHook && !(data & (M_CHARSETHOOK | M_ACCOUNTHOOK))
            && (!WithCrypto || !(data & M_CRYPTHOOK))
       )
diff -urN mutt-1.5.9/init.h mutt-1.5.9-ro/init.h
--- mutt-1.5.9/init.h	2005-03-01 16:56:02.000000000 +0100
+++ mutt-1.5.9-ro/init.h	2005-03-20 14:06:20.000000000 +0100
@@ -2933,6 +2933,11 @@
   { "fcc-hook",		mutt_parse_hook,	M_FCCHOOK },
   { "fcc-save-hook",	mutt_parse_hook,	M_FCCHOOK | M_SAVEHOOK },
   { "folder-hook",	mutt_parse_hook,	M_FOLDERHOOK },
+#ifdef USE_COMPRESSED
+  { "open-hook",	mutt_parse_hook,	M_OPENHOOK },
+  { "close-hook",	mutt_parse_hook,	M_CLOSEHOOK },
+  { "append-hook",	mutt_parse_hook,	M_APPENDHOOK },
+#endif
   { "hdr_order",	parse_list,		UL &HeaderOrderList },
 #ifdef HAVE_ICONV
   { "iconv-hook",	mutt_parse_hook,	M_ICONVHOOK }, 
diff -urN mutt-1.5.9/main.c mutt-1.5.9-ro/main.c
--- mutt-1.5.9/main.c	2005-02-12 22:09:52.000000000 +0100
+++ mutt-1.5.9-ro/main.c	2005-03-20 14:06:20.000000000 +0100
@@ -376,6 +376,12 @@
 #else
 	"-LOCALES_HACK  "
 #endif
+
+#ifdef USE_COMPRESSED
+	"+COMPRESSED  "
+#else
+	"-COMPRESSED  "
+#endif
 	      
 #ifdef HAVE_WC_FUNCS
 	"+HAVE_WC_FUNCS  "
diff -urN mutt-1.5.9/Makefile.am mutt-1.5.9-ro/Makefile.am
--- mutt-1.5.9/Makefile.am	2005-02-13 10:56:41.000000000 +0100
+++ mutt-1.5.9-ro/Makefile.am	2005-03-20 14:06:20.000000000 +0100
@@ -18,7 +18,7 @@
 bin_PROGRAMS = mutt @DOTLOCK_TARGET@ @PGPAUX_TARGET@
 mutt_SOURCES = $(BUILT_SOURCES) \
 	addrbook.c alias.c attach.c base64.c browser.c buffy.c color.c \
-        crypt.c cryptglue.c \
+        crypt.c cryptglue.c compress.c \
 	commands.c complete.c compose.c copy.c curs_lib.c curs_main.c date.c \
 	edit.c enter.c flags.c init.c filter.c from.c getdomain.c \
 	handler.c hash.c hdrline.c headers.c help.c hook.c keymap.c \
@@ -67,7 +67,7 @@
 	crypt-gpgme.c crypt-mod-pgp-gpgme.c crypt-mod-smime-gpgme.c
 
 EXTRA_DIST = COPYRIGHT GPL OPS OPS.PGP OPS.CRYPT OPS.SMIME TODO \
-	configure account.h \
+	configure account.h compress.h \
 	attach.h buffy.h charset.h copy.h crypthash.h dotlock.h functions.h gen_defs \
 	globals.h hash.h history.h init.h keymap.h mutt_crypt.h \
 	mailbox.h mapping.h md5.h mime.h mutt.h mutt_curses.h mutt_menu.h \
diff -urN mutt-1.5.9/Makefile.in mutt-1.5.9-ro/Makefile.in
diff -urN mutt-1.5.9/mbox.c mutt-1.5.9-ro/mbox.c
--- mutt-1.5.9/mbox.c	2005-02-03 19:47:53.000000000 +0100
+++ mutt-1.5.9-ro/mbox.c	2005-03-20 14:06:20.000000000 +0100
@@ -28,6 +28,10 @@
 #include "sort.h"
 #include "copy.h"
 
+#ifdef USE_COMPRESSED
+#include "compress.h"
+#endif
+
 #include <sys/stat.h>
 #include <dirent.h>
 #include <string.h>
@@ -1020,6 +1024,12 @@
 int mbox_close_mailbox (CONTEXT *ctx)
 {
   mx_unlock_file (ctx->path, fileno (ctx->fp), 1);
+
+#ifdef USE_COMPRESSED
+  if (ctx->compressinfo)
+    mutt_slow_close_compressed (ctx);
+#endif
+
   mutt_unblock_signals ();
   mx_fastclose_mailbox (ctx);
   return 0;
diff -urN mutt-1.5.9/mutt.h mutt-1.5.9-ro/mutt.h
--- mutt-1.5.9/mutt.h	2005-02-28 16:13:57.000000000 +0100
+++ mutt-1.5.9-ro/mutt.h	2005-03-20 14:06:20.000000000 +0100
@@ -159,6 +159,11 @@
 #define M_ACCOUNTHOOK	(1<<9)
 #define M_REPLYHOOK	(1<<10)
 #define M_SEND2HOOK     (1<<11)
+#ifdef USE_COMPRESSED
+#define M_OPENHOOK	(1<<12)
+#define M_APPENDHOOK	(1<<13)
+#define M_CLOSEHOOK	(1<<14)
+#endif
 
 /* tree characters for linearize_tree and print_enriched_string */
 #define M_TREE_LLCORNER		1
@@ -824,6 +829,11 @@
   void *data;			/* driver specific data */
 #endif /* USE_IMAP */
 
+#ifdef USE_COMPRESSED
+  void *compressinfo;		/* compressed mbox module private data */
+  char *realpath;		/* path to compressed mailbox */
+#endif /* USE_COMPRESSED */
+
   short magic;			/* mailbox type */
 
   unsigned int locked : 1;	/* is the mailbox locked? */
diff -urN mutt-1.5.9/Muttrc mutt-1.5.9-ro/Muttrc
diff -urN mutt-1.5.9/Muttrc.head mutt-1.5.9-ro/Muttrc.head
diff -urN mutt-1.5.9/Muttrc.head.in mutt-1.5.9-ro/Muttrc.head.in
diff -urN mutt-1.5.9/mx.c mutt-1.5.9-ro/mx.c
--- mutt-1.5.9/mx.c	2005-02-03 19:47:53.000000000 +0100
+++ mutt-1.5.9-ro/mx.c	2005-03-20 14:06:20.000000000 +0100
@@ -30,6 +30,10 @@
 #include "keymap.h"
 #include "url.h"
 
+#ifdef USE_COMPRESSED
+#include "compress.h"
+#endif
+
 #ifdef USE_IMAP
 #include "imap.h"
 #endif
@@ -454,6 +458,10 @@
     return (-1);
   }
 
+#ifdef USE_COMPRESSED
+  if (magic == 0 && mutt_can_read_compressed (path))
+    return M_COMPRESSED;
+#endif
   return (magic);
 }
 
@@ -493,6 +501,13 @@
 {
   struct stat sb;
 
+#ifdef USE_COMPRESSED
+  /* special case for appending to compressed folders -
+   * even if we can not open them for reading */
+  if (mutt_can_append_compressed (ctx->path))
+    mutt_open_append_compressed (ctx);
+#endif
+
   ctx->append = 1;
 
 #ifdef USE_IMAP
@@ -653,7 +668,12 @@
   }
 
   ctx->magic = mx_get_magic (path);
-  
+
+#ifdef USE_COMPRESSED
+  if (ctx->magic == M_COMPRESSED)
+    mutt_open_read_compressed (ctx);
+#endif
+
   if(ctx->magic == 0)
     mutt_error (_("%s is not a mailbox."), path);
 
@@ -759,6 +779,10 @@
     mutt_free_header (&ctx->hdrs[i]);
   FREE (&ctx->hdrs);
   FREE (&ctx->v2r);
+#ifdef USE_COMPRESSED
+  if (ctx->compressinfo)
+    mutt_fast_close_compressed (ctx);
+#endif
   FREE (&ctx->path);
   FREE (&ctx->pattern);
   if (ctx->limit_pattern) 
@@ -816,6 +840,12 @@
   if (tmp && tmp->new == 0)
     mutt_update_mailbox (tmp);
 #endif
+
+#ifdef USE_COMPRESSED
+  if (rc == 0 && ctx->compressinfo)
+    return mutt_sync_compressed (ctx);
+#endif
+
   return rc;
 }
 
@@ -1021,6 +1051,11 @@
       !mutt_is_spool(ctx->path) && !option (OPTSAVEEMPTY))
     mx_unlink_empty (ctx->path);
 
+#ifdef USE_COMPRESSED
+  if (ctx->compressinfo && mutt_slow_close_compressed (ctx))
+    return (-1);
+#endif
+
   mx_fastclose_mailbox (ctx);
 
   return 0;
@@ -1325,6 +1360,11 @@
 {
   int rc;
 
+#ifdef USE_COMPRESSED
+  if (ctx->compressinfo)
+    return mutt_check_mailbox_compressed (ctx);
+#endif
+
   if (ctx)
   {
     if (ctx->locked) lock = 0;
diff -urN mutt-1.5.9/mx.h mutt-1.5.9-ro/mx.h
--- mutt-1.5.9/mx.h	2003-08-05 15:58:16.000000000 +0200
+++ mutt-1.5.9-ro/mx.h	2005-03-20 14:06:20.000000000 +0100
@@ -40,6 +40,9 @@
 #ifdef USE_POP
   , M_POP
 #endif
+#ifdef USE_COMPRESSED
+  , M_COMPRESSED
+#endif
 };
 
 WHERE short DefaultMagic INITVAL (M_MBOX);
diff -urN mutt-1.5.9/PATCHES mutt-1.5.9-ro/PATCHES
--- mutt-1.5.9/PATCHES	2005-03-13 17:33:06.000000000 +0100
+++ mutt-1.5.9-ro/PATCHES	2005-03-20 17:59:28.000000000 +0100
@@ -0,0 +1 @@
+patch-1.5.9.rr.compressed.1
diff -urN mutt-1.5.9/po/de.po mutt-1.5.9-ro/po/de.po
--- mutt-1.5.9/po/de.po	2005-03-13 17:38:22.000000000 +0100
+++ mutt-1.5.9-ro/po/de.po	2005-03-20 14:06:20.000000000 +0100
@@ -715,6 +715,48 @@
 msgid "PGP already selected. Clear & continue ? "
 msgstr "PGP bereits ausgewhlt. Lschen und weiter?"
 
+#: compress.c:203 mbox.c:661
+msgid "Mailbox was corrupted!"
+msgstr "Mailbox wurde zerstrt!"
+
+#: compress.c:228 compress.c:253
+#, c-format
+msgid "Decompressing %s...\n"
+msgstr "Entpacke %s...\n"
+
+#: compress.c:246 compress.c:367 compress.c:443 mbox.c:706
+msgid "Unable to lock mailbox!"
+msgstr "Kann Mailbox nicht fr exklusiven Zugriff sperren!"
+
+#: compress.c:264
+#, c-format
+msgid "Error executing: %s : unable to open the mailbox!\n"
+msgstr "Fehler beim Ausfhren von %s : Kann die Mailbox nicht ffnen!\n"
+
+#: compress.c:350 compress.c:377 compress.c:423 compress.c:454
+#, c-format
+msgid "Compressing %s...\n"
+msgstr "Komprimiere %s...\n"
+
+#: compress.c:381
+#, c-format
+msgid ""
+"%s: Error compressing mailbox! Original mailbox deleted, uncompressed one "
+"kept!\n"
+msgstr ""
+"%s: Fehler beim Komprimieren der Mailbox! Ursprngliche Mailbox gelscht, "
+"entpackte gespeichert!\n"
+
+#: compress.c:425 compress.c:456
+#, c-format
+msgid "Compressed-appending to %s...\n"
+msgstr "Hnge komprimiert an %s... an\n"
+
+#: compress.c:461
+#, c-format
+msgid " %s: Error compressing mailbox!  Uncompressed one kept!\n"
+msgstr " %s: Fehler beim packen der Mailbox! Entpackte Mailbox gespeichert!\n"
+
 #: crypt.c:69
 #, c-format
 msgid " (current time: %c)"
@@ -1305,6 +1347,10 @@
 msgid "Help for %s"
 msgstr "Hilfe fr %s"
 
+#: hook.c:96
+msgid "bad formatted command string"
+msgstr "Hook enthlt nicht die Muster %f und %t"
+
 #: hook.c:246
 #, c-format
 msgid "unhook: Can't do unhook * from within a hook."
@@ -2737,18 +2783,10 @@
 msgid "Mailbox is corrupt!"
 msgstr "Mailbox fehlerhaft!"
 
-#: mbox.c:662
-msgid "Mailbox was corrupted!"
-msgstr "Mailbox wurde zerstrt!"
-
 #: mbox.c:699 mbox.c:953
 msgid "Fatal error!  Could not reopen mailbox!"
 msgstr "Fataler Fehler, konnte Mailbox nicht erneut ffnen!"
 
-#: mbox.c:708
-msgid "Unable to lock mailbox!"
-msgstr "Kann Mailbox nicht fr exklusiven Zugriff sperren!"
-
 #. this means ctx->changed or ctx->deleted was set, but no
 #. * messages were found to be changed or deleted.  This should
 #. * never happen, is we presume it is a bug in mutt.
diff -urN mutt-1.5.9/po/POTFILES.in mutt-1.5.9-ro/po/POTFILES.in
--- mutt-1.5.9/po/POTFILES.in	2002-03-27 09:44:17.000000000 +0100
+++ mutt-1.5.9-ro/po/POTFILES.in	2005-03-20 14:06:20.000000000 +0100
@@ -8,6 +8,7 @@
 color.c
 commands.c
 compose.c
+compress.c
 crypt.c
 curs_lib.c
 curs_main.c
diff -urN mutt-1.5.9/status.c mutt-1.5.9-ro/status.c
--- mutt-1.5.9/status.c	2005-02-03 19:47:53.000000000 +0100
+++ mutt-1.5.9-ro/status.c	2005-03-20 14:06:20.000000000 +0100
@@ -97,6 +97,14 @@
 
     case 'f':
       snprintf (fmt, sizeof(fmt), "%%%ss", prefix);
+#ifdef USE_COMPRESSED
+      if (Context && Context->compressinfo && Context->realpath)
+      {
+	 strfcpy (tmp, Context->realpath, sizeof (tmp));
+	 mutt_pretty_mailbox (tmp);
+      }
+      else
+#endif
       if (Context && Context->path)
       {
 	strfcpy (tmp, Context->path, sizeof (tmp));