rev 1310 - trunk/Email-Folder/lib/Email/Folder

[prev] [thread] [next] [lurker] [Date index for 2003/08/11]

From: richardc
Subject: rev 1310 - trunk/Email-Folder/lib/Email/Folder
Date: 13:11 on 11 Aug 2003
Author: richardc
Date: 2003-08-11 13:11:28 +0100 (Mon, 11 Aug 2003)
New Revision: 1310

Added:
   trunk/Email-Folder/lib/Email/Folder/Ezmlm.pm
Modified:
   trunk/Email-Folder/lib/Email/Folder/Maildir.pm
Log:
ezmlm

Added: trunk/Email-Folder/lib/Email/Folder/Ezmlm.pm
===================================================================
--- trunk/Email-Folder/lib/Email/Folder/Ezmlm.pm	2003-08-11 11:15:39 UTC (rev 1309)
+++ trunk/Email-Folder/lib/Email/Folder/Ezmlm.pm	2003-08-11 12:11:28 UTC (rev 1310)
@@ -0,0 +1,29 @@
+package Email::Folder::Ezmlm;
+use strict;
+use Carp;
+use Email::Folder::Maildir;
+use base 'Email::Folder::Maildir';
+
+# we're a little complicit, just redefining an internal method, but
+# that's fine, we maintain both piles :)
+
+sub _what_is_there {
+    my $self = shift;
+    my $dir = $self->{_file};
+
+    croak "$dir does not exist"           unless (-e $dir);
+    croak "$dir is not an ezmlm archive"  unless (-d $dir);
+    croak "$dir is not an ezmlm archive"  unless (-e "$dir/archive" && -d "$dir/archive");
+
+    my $num;
+    if (my $fh = IO::File->new("$dir/num")) {
+        ($num) = (<$fh> =~ m/^(\d+)/);
+    }
+
+    $self->{_messages} = [ map {
+        sprintf '%s/archive/%d/%02d', $dir, int $_ / 100, $_ % 100
+    } 1..$num ];
+}
+
+
+1;

Modified: trunk/Email-Folder/lib/Email/Folder/Maildir.pm
===================================================================
--- trunk/Email-Folder/lib/Email/Folder/Maildir.pm	2003-08-11 11:15:39 UTC (rev 1309)
+++ trunk/Email-Folder/lib/Email/Folder/Maildir.pm	2003-08-11 12:11:28 UTC (rev 1310)
@@ -29,7 +29,7 @@
     croak "$dir does not exist"    unless (-e $dir);
     croak "$dir is not a maildir"  unless (-d $dir);
     croak "$dir is not a maildir"  unless (-e "$dir/cur" && -d "$dir/cur");
-    croak "$dir is not a maildir"  unless (-e "$dir/cur" && -d "$dir/new");
+    croak "$dir is not a maildir"  unless (-e "$dir/new" && -d "$dir/new");
 
     my @messages;
     # ignore the tmp directory although the spec

Generated at 13:57 on 01 Jul 2004 by mariachi 0.52