1Mail::Filter(3) User Contributed Perl Documentation Mail::Filter(3)
2
3
4
6 Mail::Filter - Filter mail through multiple subroutines
7
10 use Mail::Filter;
11
12 my $filter = Mail::Filter->new( \&filter1, \&filter2 );
13
14 my $mail = Mail::Internet->new( [<>] );
15 my $mail = $filter->filter($mail);
16
17 my $folder = Mail::Folder->new( .... );
18 my $filter->filter($folder);
19
21 "Mail::Filter" provides an interface to filtering Email through
22 multiple subroutines.
23
24 "Mail::Filter" filters mail by calling each filter subroutine in turn.
25 Each filter subroutine is called with two arguments, the first is the
26 filter object and the second is the mail or folder object being
27 filtered.
28
29 The result from each filter sub is passed to the next filter as the
30 mail object. If a filter subroutine returns undef, then "Mail::Filter"
31 will abort and return immediately.
32
33 The function returns the result from the last subroutine to operate on
34 the mail object.
35
37 Constructors
38 Mail::Filter->new([FILTER [, ... ]])
39
40 Create a new "Mail::Filter" object with the given filter
41 subroutines. Each filter may be either a code reference or the name
42 of a method to call on the <Mail::Filter> object.
43
44 Accessors
45 $obj->add(FILTER [, FILTER ...])
46
47 Add the given filters to the end of the fliter list.
48
49 Processing
50 $obj->filter(MAIL-OBJECT | MAIL-FOLDER)
51
52 If the first argument is a "Mail::Internet" object, then this
53 object will be passed through the filter list. If the first
54 argument is a "Mail::Folder" object, then each message in turn will
55 be passed through the filter list.
56
57 $obj->folder
58
59 While the "filter" method is called with a "Mail::Folder" object,
60 these filter subroutines can call this method to obtain the folder
61 object that is being processed.
62
63 $obj->msgnum
64
65 If the "filter" method is called with a "Mail::Folder" object, then
66 the filter subroutines may call this method to obtain the message
67 number of the message that is being processed.
68
70 This module is part of the MailTools distribution,
71 http://perl.overmeer.net/mailtools/.
72
74 The MailTools bundle was developed by Graham Barr. Later, Mark
75 Overmeer took over maintenance without commitment to further
76 development.
77
78 Mail::Cap by Gisle Aas <aas@oslonett.no>. Mail::Field::AddrList by
79 Peter Orbaek <poe@cit.dk>. Mail::Mailer and Mail::Send by Tim Bunce
80 <Tim.Bunce@ig.co.uk>. For other contributors see ChangeLog.
81
83 Copyrights 1995-2000 Graham Barr <gbarr@pobox.com> and 2001-2007 Mark
84 Overmeer <perl@overmeer.net>.
85
86 This program is free software; you can redistribute it and/or modify it
87 under the same terms as Perl itself. See
88 http://www.perl.com/perl/misc/Artistic.html
89
90
91
92perl v5.10.1 2008-07-29 Mail::Filter(3)