{
    "mode": "perldoc",
    "parameter": "Mail::Filter",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Mail%3A%3AFilter/json",
    "generated": "2026-06-15T13:33:47Z",
    "synopsis": "use Mail::Filter;\nmy $filter = Mail::Filter->new( \\&filter1, \\&filter2 );\nmy $mail   = Mail::Internet->new( [<>] );\nmy $mail   = $filter->filter($mail);\nmy $folder = Mail::Folder->new( .... );\nmy $filter->filter($folder);",
    "sections": {
        "NAME": {
            "content": "Mail::Filter - filter mail through multiple subroutines\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use Mail::Filter;\n\nmy $filter = Mail::Filter->new( \\&filter1, \\&filter2 );\n\nmy $mail   = Mail::Internet->new( [<>] );\nmy $mail   = $filter->filter($mail);\n\nmy $folder = Mail::Folder->new( .... );\nmy $filter->filter($folder);\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "\"Mail::Filter\" provides an interface to filtering Email through multiple subroutines.\n\n\"Mail::Filter\" filters mail by calling each filter subroutine in turn. Each filter subroutine is\ncalled with two arguments, the first is the filter object and the second is the mail or folder\nobject being filtered.\n\nThe result from each filter sub is passed to the next filter as the mail object. If a filter\nsubroutine returns undef, then \"Mail::Filter\" will abort and return immediately.\n\nThe function returns the result from the last subroutine to operate on the mail object.\n",
            "subsections": []
        },
        "METHODS": {
            "content": "",
            "subsections": [
                {
                    "name": "Constructors",
                    "content": "Mail::Filter->new(@filters)\nCreate a new \"Mail::Filter\" object with the given filter subroutines. Each filter may be\neither a code reference or the name of a method to call on the <Mail::Filter> object.\n"
                },
                {
                    "name": "Accessors",
                    "content": "$obj->add(@filters)\nAdd the given @filters to the end of the filter list.\n"
                },
                {
                    "name": "Processing",
                    "content": "$obj->filter($mail|$folder)\nIf the first argument is a Mail::Internet object, then this object will be passed through\nthe filter list. If the first argument is a Mail::Folder object, then each message in turn\nwill be passed through the filter list.\n\n$obj->folder()\nWhile the filter() method is called with a Mail::Folder object, these filter subroutines can\ncall this method to obtain the folder object that is being processed.\n\n$obj->msgnum()\nIf the filter() method is called with a Mail::Folder object, then the filter subroutines may\ncall this method to obtain the message number of the message that is being processed.\n"
                }
            ]
        },
        "SEE ALSO": {
            "content": "This module is part of the MailTools distribution, http://perl.overmeer.net/mailtools/.\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "The MailTools bundle was developed by Graham Barr. Later, Mark Overmeer took over maintenance\nwithout commitment to further development.\n\nMail::Cap by Gisle Aas <aas@oslonett.no>. Mail::Field::AddrList by Peter Orbaek <poe@cit.dk>.\nMail::Mailer and Mail::Send by Tim Bunce <Tim.Bunce@ig.co.uk>. For other contributors see\nChangeLog.\n",
            "subsections": []
        },
        "LICENSE": {
            "content": "Copyrights 1995-2000 Graham Barr <gbarr@pobox.com> and 2001-2017 Mark Overmeer\n<perl@overmeer.net>.\n\nThis program is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself. See http://www.perl.com/perl/misc/Artistic.html\n",
            "subsections": []
        }
    },
    "summary": "Mail::Filter - filter mail through multiple subroutines",
    "flags": [],
    "examples": [],
    "see_also": []
}