man-pages/man3/Mail::Filter.3pm.html
2021-03-31 01:06:50 +01:00

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">&nbsp;</A>
<H2>NAME</H2>
Mail::Filter - filter mail through multiple subroutines
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<PRE>
use Mail::Filter;
my $filter = Mail::Filter-&gt;new( \&amp;filter1, \&amp;filter2 );
my $mail = Mail::Internet-&gt;new( [&lt;&gt;] );
my $mail = $filter-&gt;filter($mail);
my $folder = Mail::Folder-&gt;new( .... );
my $filter-&gt;filter($folder);
</PRE>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<TT>&quot;Mail::Filter&quot;</TT> provides an interface to filtering Email through multiple
subroutines.
<P>
<TT>&quot;Mail::Filter&quot;</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>&quot;Mail::Filter&quot;</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">&nbsp;</A>
<H2>METHODS</H2>
<A NAME="lbAF">&nbsp;</A>
<H3>Constructors</H3>
<DL COMPACT>
<DT id="1">Mail::Filter-&gt;<B>new</B>(@filters)<DD>
Create a new <TT>&quot;Mail::Filter&quot;</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 &lt;Mail::Filter&gt; object.
</DL>
<A NAME="lbAG">&nbsp;</A>
<H3>Accessors</H3>
<DL COMPACT>
<DT id="2">$obj-&gt;<B>add</B>(@filters)<DD>
Add the given <TT>@filters</TT> to the end of the filter list.
</DL>
<A NAME="lbAH">&nbsp;</A>
<H3>Processing</H3>
<DL COMPACT>
<DT id="3">$obj-&gt;<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-&gt;<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-&gt;<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">&nbsp;</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">&nbsp;</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 &lt;<A HREF="mailto:aas@oslonett.no">aas@oslonett.no</A>&gt;.
Mail::Field::AddrList by Peter Orbaek &lt;<A HREF="mailto:poe@cit.dk">poe@cit.dk</A>&gt;.
Mail::Mailer and Mail::Send by Tim Bunce &lt;<A HREF="mailto:Tim.Bunce@ig.co.uk">Tim.Bunce@ig.co.uk</A>&gt;.
For other contributors see ChangeLog.
<A NAME="lbAK">&nbsp;</A>
<H2>LICENSE</H2>
Copyrights 1995-2000 Graham Barr &lt;<A HREF="mailto:gbarr@pobox.com">gbarr@pobox.com</A>&gt; and
2001-2017 Mark Overmeer &lt;<A HREF="mailto:perl@overmeer.net">perl@overmeer.net</A>&gt;.
<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">&nbsp;</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>