File Coverage

blib/lib/App/Addex/Output/SpamAssassin.pm
Criterion Covered Total %
statement 12 12 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod 1 1 100.0
total 17 17 100.0


line stmt bran cond sub pod time code
1 1     1   7 use strict;
  1         2  
  1         31  
2 1     1   5 use warnings;
  1         3  
  1         40  
3              
4             package App::Addex::Output::SpamAssassin 0.027;
5             # ABSTRACT: generate SpamAssassin whitelists from an address book
6              
7 1     1   6 use parent qw(App::Addex::Output::ToFile);
  1         1  
  1         6  
8              
9             #pod =head1 DESCRIPTION
10             #pod
11             #pod This plugin produces a file that contains a list of SpamAssassin whitelist
12             #pod declarations.
13             #pod
14             #pod =head1 CONFIGURATION
15             #pod
16             #pod The valid configuration parameters for this plugin are:
17             #pod
18             #pod filename - the filename to which to write the whitelists
19             #pod
20             #pod =method process_entry
21             #pod
22             #pod $sa_outputter->process_entry($addex, $entry);
23             #pod
24             #pod This method does the actual writing of configuration to the file.
25             #pod
26             #pod =cut
27              
28             sub process_entry {
29 6     6 1 14 my ($self, $addex, $entry) = @_;
30              
31 6         12 $self->output("whitelist_from $_") for grep { $_->sends } $entry->emails;
  12         23  
32             }
33              
34             1;
35              
36             __END__
37              
38             =pod
39              
40             =encoding UTF-8
41              
42             =head1 NAME
43              
44             App::Addex::Output::SpamAssassin - generate SpamAssassin whitelists from an address book
45              
46             =head1 VERSION
47              
48             version 0.027
49              
50             =head1 DESCRIPTION
51              
52             This plugin produces a file that contains a list of SpamAssassin whitelist
53             declarations.
54              
55             =head1 PERL VERSION SUPPORT
56              
57             This module has the same support period as perl itself: it supports the two
58             most recent versions of perl. (That is, if the most recently released version
59             is v5.40, then this module should work on both v5.40 and v5.38.)
60              
61             Although it may work on older versions of perl, no guarantee is made that the
62             minimum required version will not be increased. The version may be increased
63             for any reason, and there is no promise that patches will be accepted to lower
64             the minimum required perl.
65              
66             =head1 METHODS
67              
68             =head2 process_entry
69              
70             $sa_outputter->process_entry($addex, $entry);
71              
72             This method does the actual writing of configuration to the file.
73              
74             =head1 CONFIGURATION
75              
76             The valid configuration parameters for this plugin are:
77              
78             filename - the filename to which to write the whitelists
79              
80             =head1 AUTHOR
81              
82             Ricardo SIGNES <rjbs@semiotic.systems>
83              
84             =head1 COPYRIGHT AND LICENSE
85              
86             This software is copyright (c) 2006 by Ricardo SIGNES.
87              
88             This is free software; you can redistribute it and/or modify it under
89             the same terms as the Perl 5 programming language system itself.
90              
91             =cut