# Copyrights 1995-2019 by [Mark Overmeer <markov@cpan.org>]. # For other contributors see ChangeLog. # See the manual pages for details on the licensing terms. # Pod stripped from pm file by OODoc 2.02. # This code is part of the bundle MailTools. Meta-POD processed with # OODoc into POD and HTML manual-pages. See README.md for Copyright. # Licensed under the same terms as Perl itself. package Mail::Filter; use vars '$VERSION'; $VERSION = '2.21'; use strict; use Carp; sub new(@) { my $class = shift; bless { filters => [ @_ ] }, $class; } #------------ sub add(@) { my $self = shift; push @{$self->{filters}}, @_; } #------------ sub _filter($) { my ($self, $mail) = @_; foreach my $sub ( @{$self->{filters}} ) { my $mail = ref $sub eq 'CODE' ? $sub->($self,$mail) : !ref $sub ? $self->$sub($mail) : carp "Cannot call filter '$sub', ignored"; ref $mail or last; } $mail; } sub filter { my ($self, $obj) = @_; if($obj->isa('Mail::Folder')) { $self->{folder} = $obj; foreach my $m ($obj->message_list) { my $mail = $obj->get_message($m) or next; $self->{msgnum} = $m; $self->_filter($mail); } delete $self->{folder}; delete $self->{msgnum}; } elsif($obj->isa('Mail::Internet')) { return $self->filter($obj); } else { carp "Cannot process '$obj'"; return undef; } } sub folder() {shift->{folder}} sub msgnum() {shift->{msgnum}} 1;
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
Field | Folder | 0755 |
|
|
Mailer | Folder | 0755 |
|
|
Address.pm | File | 6.84 KB | 0644 |
|
Address.pod | File | 4.07 KB | 0644 |
|
Cap.pm | File | 6.42 KB | 0644 |
|
Cap.pod | File | 3.78 KB | 0644 |
|
Field.pm | File | 4.94 KB | 0644 |
|
Field.pod | File | 4.91 KB | 0644 |
|
Filter.pm | File | 1.44 KB | 0644 |
|
Filter.pod | File | 2.82 KB | 0644 |
|
Header.pm | File | 13.82 KB | 0644 |
|
Header.pod | File | 7.76 KB | 0644 |
|
Internet.pm | File | 12.26 KB | 0644 |
|
Internet.pod | File | 10.24 KB | 0644 |
|
Mailer.pm | File | 4.94 KB | 0644 |
|
Mailer.pod | File | 4.1 KB | 0644 |
|
Send.pm | File | 1.35 KB | 0644 |
|
Send.pod | File | 3.17 KB | 0644 |
|
Util.pm | File | 3.36 KB | 0644 |
|
Util.pod | File | 3.09 KB | 0644 |
|