1Mail::Filter(3) User Contributed Perl Documentation Mail::Filter(3)
2
3
4
6 Mail::Filter - Filter mail through multiple subroutines
7
9 use Mail::Filter;
10
11 $filter = new Mail::Filter( \&filter1, \&filter2 );
12
13 $mail = new Mail::Internet( [<>] );
14 $mail = $filter->filter($mail);
15
16 $folder = new Mail::Folder( .... );
17 $filter->filter($folder);
18
20 "Mail::Filter" provides an interface to filtering Email through multi‐
21 ple subroutines.
22
23 "Mail::Filter" filters mail by calling each filter subroutine in turn.
24 Each filter subroutine is called with two arguments, the first is the
25 filter object and the second is the mail or folder object being fil‐
26 tered.
27
28 The result from each filter sub is passed to the next filter as the
29 mail object. If a filter subroutine returns undef, then "Mail::Filter"
30 will abort and return immediately.
31
32 The function returns the result from the last subroutine to operate on
33 the mail object.
34
36 new ( [ FILTER [, ... ]])
37 Create a new "Mail::Filter" object with the given filter subrou‐
38 tines. Each filter may be either a code reference or the name of a
39 method to call on the <Mail::Filter> object.
40
42 add ( FILTER [, FILTER ...] )
43 Add the given filters to the end of the fliter list.
44
45 filter ( MAIL-OBJECT ⎪ MAIL-FOLDER )
46 If the first argument is a "Mail::Internet" object, then this
47 object will be passed through the filter list. If the first argu‐
48 ment is a "Mail::Folder" object, then each message in turn will be
49 passed through the filter list.
50
51 folder
52 If the "filter" method is called with a "Mail::Folder" object, then
53 the filter subroutines may call this method to obtain the folder
54 object that is being processed.
55
56 msgnum
57 If the "filter" method is called with a "Mail::Folder" object, then
58 the filter subroutines may call this method to obtain the message
59 number of the message that is being processed.
60
62 Mail::Internet Mail::Folder
63
65 Graham Barr.
66
67 Maintained by Mark Overmeer <mailtools@overmeer.net>
68
70 Copyright (c) 2002-2003 Mark Overmeer, 1995-2001 Graham Barr. All
71 rights reserved. This program is free software; you can redistribute it
72 and/or modify it under the same terms as Perl itself.
73
74
75
76perl v5.8.8 2007-05-11 Mail::Filter(3)