Transform::Alert::Input::POP3 - Transform alerts from POP3 messages
# 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>
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.
Username
Password
Full text of the raw message, including headers. All CRs are stripped.
{ # 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, }
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.
(?<RAWMSG>[\s\S]+)
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/.
Brendan Byrd <BBYRD@CPAN.org>
This software is Copyright (c) 2013 by Brendan Byrd.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
To install Transform::Alert, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Transform::Alert
CPAN shell
perl -MCPAN -e shell install Transform::Alert
For more information on module installation, please visit the detailed CPAN module installation guide.