Subject: | "Bug" in deliver(). Can cause corruption to the system. |
The loop in deliver() which expands the mailbox filenames out and stores them into the to_deliver hash prior to delivery has a large problem. I'm guessing it's caused by a change in Email::FolderType.
The bug results in the mailbox stored in the hash being the path to the relevant Email::FolderType module, instead of the mailbox passed in. At best this causes things just not to work (like the test suite). At worst, when running as a user with write permissions to said module file, this results in the email(s) being appended to the module file, after which it won't load any more. (nice example of this being running the CPAN shell as root; can you guess i got caught by this :/)
--- LocalDelivery.pm.prob 2004-12-17 17:16:10.000000000 +0000
+++ LocalDelivery.pm.works 2005-08-09 15:39:36.000000000 +0100
@@ -46,8 +46,9 @@
}
my %to_deliver;
- push @{$to_deliver{folder_type($_)}}, $_
- for map { expand_filename $_ } @boxes;
+ for my $box (map { expand_filename $_ } @boxes) {
+ push @{$to_deliver{folder_type($box)}}, $box;
+ }
my @rv;
for my $method (keys %to_deliver) {
eval "require Email::LocalDelivery::$method";