File Coverage

blib/lib/Siesta/Plugin/Archive.pm
Criterion Covered Total %
statement 24 24 100.0
branch 1 2 50.0
condition n/a
subroutine 8 8 100.0
pod 2 3 66.6
total 35 37 94.5


line stmt bran cond sub pod time code
1             # $Id: Archive.pm 1306 2003-08-11 09:24:32Z richardc $
2             package Siesta::Plugin::Archive;
3 5     5   2279 use strict;
  5         11  
  5         232  
4 5     5   27 use Siesta::Config;
  5         9  
  5         76  
5 5     5   214 use Siesta::Plugin;
  5         13  
  5         74  
6 5     5   163 use base 'Siesta::Plugin';
  5         10  
  5         844  
7 5     5   5217 use Email::LocalDelivery;
  5         202765  
  5         80  
8              
9             sub description {
10 1     1 0 657 "save a copy of the message to an archive."
11             }
12              
13             sub process {
14 1     1 1 3 my $self = shift;
15 1         4 my $mail = shift;
16              
17 1         19 my $path = $self->pref('path');
18 1 50       17 Email::LocalDelivery->deliver( $mail->as_string, $path )
19             or die "local delivery into '$path' failed";
20 1         19458 return;
21             }
22              
23             sub options {
24 1     1 1 4 my $self = shift;
25 1         11 my $name = $self->list->name;
26              
27             +{
28 1         1936 path => {
29             description => "where to drop the archives",
30             type => "string",
31             default => "$Siesta::Config::ARCHIVE/$name/",
32             },
33             };
34             }
35              
36             1;