179 lines
4.5 KiB
HTML
179 lines
4.5 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of Mail::Filter</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>Mail::Filter</H1>
|
|
Section: User Contributed Perl Documentation (3pm)<BR>Updated: 2019-07-25<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
Mail::Filter - filter mail through multiple subroutines
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
use Mail::Filter;
|
|
|
|
my $filter = Mail::Filter->new( \&filter1, \&filter2 );
|
|
|
|
my $mail = Mail::Internet->new( [<>] );
|
|
my $mail = $filter->filter($mail);
|
|
|
|
my $folder = Mail::Folder->new( .... );
|
|
my $filter->filter($folder);
|
|
|
|
</PRE>
|
|
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
|
|
|
|
<TT>"Mail::Filter"</TT> provides an interface to filtering Email through multiple
|
|
subroutines.
|
|
<P>
|
|
|
|
<TT>"Mail::Filter"</TT> filters mail by calling each filter subroutine in turn. Each
|
|
filter subroutine is called with two arguments, the first is the filter
|
|
object and the second is the mail or folder object being filtered.
|
|
<P>
|
|
|
|
The result from each filter sub is passed to the next filter as the mail
|
|
object. If a filter subroutine returns undef, then <TT>"Mail::Filter"</TT> will abort
|
|
and return immediately.
|
|
<P>
|
|
|
|
The function returns the result from the last subroutine to operate on the
|
|
mail object.
|
|
<A NAME="lbAE"> </A>
|
|
<H2>METHODS</H2>
|
|
|
|
|
|
|
|
<A NAME="lbAF"> </A>
|
|
<H3>Constructors</H3>
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="1">Mail::Filter-><B>new</B>(@filters)<DD>
|
|
|
|
|
|
Create a new <TT>"Mail::Filter"</TT> object with the given filter subroutines. Each
|
|
filter may be either a code reference or the name of a method to call
|
|
on the <Mail::Filter> object.
|
|
</DL>
|
|
<A NAME="lbAG"> </A>
|
|
<H3>Accessors</H3>
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="2">$obj-><B>add</B>(@filters)<DD>
|
|
|
|
|
|
|
|
|
|
Add the given <TT>@filters</TT> to the end of the filter list.
|
|
</DL>
|
|
<A NAME="lbAH"> </A>
|
|
<H3>Processing</H3>
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="3">$obj-><B>filter</B>($mail|$folder)<DD>
|
|
|
|
|
|
|
|
|
|
If the first argument is a Mail::Internet object, then this object will
|
|
be passed through the filter list. If the first argument is a Mail::Folder
|
|
object, then each message in turn will be passed through the filter list.
|
|
<DT id="4">$obj-><B>folder</B>()<DD>
|
|
|
|
|
|
|
|
|
|
While the <B>filter()</B> method is called with a Mail::Folder object, these
|
|
filter subroutines can call this method to obtain the folder object that is
|
|
being processed.
|
|
<DT id="5">$obj-><B>msgnum</B>()<DD>
|
|
|
|
|
|
|
|
|
|
If the <B>filter()</B> method is called with a Mail::Folder object, then the
|
|
filter subroutines may call this method to obtain the message number
|
|
of the message that is being processed.
|
|
</DL>
|
|
<A NAME="lbAI"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
|
|
|
|
This module is part of the MailTools distribution,
|
|
<I><A HREF="http://perl.overmeer.net/mailtools/">http://perl.overmeer.net/mailtools/</A></I>.
|
|
<A NAME="lbAJ"> </A>
|
|
<H2>AUTHORS</H2>
|
|
|
|
|
|
|
|
The MailTools bundle was developed by Graham Barr. Later, Mark
|
|
Overmeer took over maintenance without commitment to further development.
|
|
<P>
|
|
|
|
Mail::Cap by Gisle Aas <<A HREF="mailto:aas@oslonett.no">aas@oslonett.no</A>>.
|
|
Mail::Field::AddrList by Peter Orbaek <<A HREF="mailto:poe@cit.dk">poe@cit.dk</A>>.
|
|
Mail::Mailer and Mail::Send by Tim Bunce <<A HREF="mailto:Tim.Bunce@ig.co.uk">Tim.Bunce@ig.co.uk</A>>.
|
|
For other contributors see ChangeLog.
|
|
<A NAME="lbAK"> </A>
|
|
<H2>LICENSE</H2>
|
|
|
|
|
|
|
|
Copyrights 1995-2000 Graham Barr <<A HREF="mailto:gbarr@pobox.com">gbarr@pobox.com</A>> and
|
|
2001-2017 Mark Overmeer <<A HREF="mailto:perl@overmeer.net">perl@overmeer.net</A>>.
|
|
<P>
|
|
|
|
This program is free software; you can redistribute it and/or modify it
|
|
under the same terms as Perl itself.
|
|
See <I><A HREF="http://www.perl.com/perl/misc/Artistic.html">http://www.perl.com/perl/misc/Artistic.html</A></I>
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="6"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="7"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="8"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="9"><A HREF="#lbAE">METHODS</A><DD>
|
|
<DL>
|
|
<DT id="10"><A HREF="#lbAF">Constructors</A><DD>
|
|
<DT id="11"><A HREF="#lbAG">Accessors</A><DD>
|
|
<DT id="12"><A HREF="#lbAH">Processing</A><DD>
|
|
</DL>
|
|
<DT id="13"><A HREF="#lbAI">SEE ALSO</A><DD>
|
|
<DT id="14"><A HREF="#lbAJ">AUTHORS</A><DD>
|
|
<DT id="15"><A HREF="#lbAK">LICENSE</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:47 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|