File Coverage

blib/lib/Mail/Qmail/Filter/Queue.pm
Criterion Covered Total %
statement 8 12 66.6
branch 0 2 0.0
condition n/a
subroutine 3 4 75.0
pod 1 1 100.0
total 12 19 63.1


line stmt bran cond sub pod time code
1 1     1   980 use 5.014;
  1         3  
2 1     1   6 use warnings;
  1         3  
  1         48  
3              
4             package Mail::Qmail::Filter::Queue;
5              
6             our $VERSION = '1.0';
7              
8 1     1   6 use Mo qw(coerce);
  1         2  
  1         4  
9             extends 'Mail::Qmail::Filter';
10              
11             sub filter {
12 0     0 1   my $self = shift;
13 0           local $ENV{QMAILQUEUE}; # use original qmail-queue
14 0 0         $self->message->send == 0 or die "Error sending message: exit status $?\n";
15 0           $self->debug( action => 'queue' );
16             }
17              
18             1;
19              
20             __END__
21              
22             =head1 NAME
23              
24             Mail::Qmail::Filter::Queue -
25             queue message
26              
27             =head1 SYNOPSIS
28              
29             use Mail::Qmail::Filter;
30            
31             Mail::Qmail::Filter->new->add_filters(
32             # Usually you want to add additional filters here.
33             '::Queue',
34             )->run;
35              
36             =head1 DESCRIPTION
37              
38             This L<Mail::Qmail::Filter> plugin passes the message on to C<qmail-queue>.
39             This is usually the last plugin you should use in your filter chain.
40             If you do not use it, the message will be discarded.
41             You can use it several times to copy the message.
42             (I'm not saying you should, only that you can.)
43              
44             =head1 SEE ALSO
45              
46             L<Mail::Qmail::Filter/COMMON PARAMETERS FOR ALL FILTERS>
47              
48             =head1 LICENSE AND COPYRIGHT
49              
50             Copyright 2019 Martin Sluka.
51              
52             This module is free software; you can redistribute it and/or modify it
53             under the terms of the the Artistic License (2.0). You may obtain a
54             copy of the full license at:
55              
56             L<http://www.perlfoundation.org/artistic_license_2_0>
57              
58             Any use, modification, and distribution of the Standard or Modified
59             Versions is governed by this Artistic License. By using, modifying or
60             distributing the Package, you accept this license. Do not use, modify,
61             or distribute the Package, if you do not accept this license.
62              
63             If your Modified Version has been derived from a Modified Version made
64             by someone other than you, you are nevertheless required to ensure that
65             your Modified Version complies with the requirements of this license.
66              
67             This license does not grant you the right to use any trademark, service
68             mark, tradename, or logo of the Copyright Holder.
69              
70             This license includes the non-exclusive, worldwide, free-of-charge
71             patent license to make, have made, use, offer to sell, sell, import and
72             otherwise transfer the Package with respect to any patent claims
73             licensable by the Copyright Holder that are necessarily infringed by the
74             Package. If you institute patent litigation (including a cross-claim or
75             counterclaim) against any party alleging that the Package constitutes
76             direct or contributory patent infringement, then this Artistic License
77             to you shall terminate on the date that such litigation is filed.
78              
79             Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER
80             AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
81             THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
82             PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY
83             YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR
84             CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR
85             CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE,
86             EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
87              
88             =cut