Brendan Byrd > Transform-Alert-1.00 > Transform::Alert::Input::POP3

Download:
Transform-Alert-1.00.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: 1.00   Source  

NAME ^

Transform::Alert::Input::POP3 - Transform alerts from POP3 messages

SYNOPSIS ^

    # In your configuration
    <Input test>
       Type      POP3
       Interval  60  # seconds (default)
 
       <ConnOpts>
          Username  bob
          Password  mail4fun
 
          # See Net::POP3->new
          Host     mail.foobar.org
          Port     110  # default
          Timeout  120  # default
       </ConnOpts>
       # <Template> tags...
    </Input>

DESCRIPTION ^

This input type will read a POP3 mailbox and process each message through the input template engine. If it finds a match, the results of the match are sent to one or more outputs, depending on the group configuration.

See Net::POP3 for a list of the ConnOpts section parameters. The Username and Password options are included in this set, but not used in the POP3 object's construction.

OUTPUTS ^

Text

Full text of the raw message, including headers. All CRs are stripped.

Preparsed Hash

    {
       # Header pairs, as per Email::Simple::Header
       Email::Simple->new($msg)->header_obj->header_pairs,
 
       # decoded via Email::MIME->new($msg)
       # $pmsg->body_str, or body_str of the first text/plain part (if it croaks), or $pmsg->body_raw
       # (all \r are stripped)
       BODY => $str,
    }

CAVEATS ^

Special care should be made when using input templates on raw email messages. For one, header order may change, which is difficult to manage with REs. For another, the message is probably MIME-encoded and would contain 80-character splits. Use of Mungers here is highly recommended.

All messages are deleted from the system, whether it was matched or not. If you need to save your messages, you should consider using IMAP.

The raw message isn't kept for the Munger. If you really need it, you can implement an input RE template of (?<RAWMSG>[\s\S]+), and parse out the email message yourself.

AVAILABILITY ^

The project homepage is https://github.com/SineSwiper/Transform-Alert/wiki.

The latest version of this module is available from the Comprehensive Perl Archive Network (CPAN). Visit http://www.perl.com/CPAN/ to find a CPAN site near you, or see https://metacpan.org/module/Transform::Alert/.

AUTHOR ^

Brendan Byrd <BBYRD@CPAN.org>

COPYRIGHT AND LICENSE ^

This software is Copyright (c) 2013 by Brendan Byrd.

This is free software, licensed under:

  The Artistic License 2.0 (GPL Compatible)
syntax highlighting: