]> iEval git - app-lastmsg.git/blobdiff - lib/App/Lastmsg.pm
Bump version and update Changes
[app-lastmsg.git] / lib / App / Lastmsg.pm
index 8d2cce57eb09d247c336dcd61711c9ed32a58d0d..8f7be5ed663814c2b79960e88a2d5cf757965b05 100644 (file)
@@ -12,7 +12,7 @@ use List::Util qw/max/;
 use POSIX qw/strftime/;
 
 our $OUTPUT_FILEHANDLE = \*STDOUT;
-our $VERSION = '0.001002';
+our $VERSION = '0.002';
 
 our @DEFAULT_INBOX;
 push @DEFAULT_INBOX, "/var/mail/$ENV{USER}" if exists $ENV{USER};
@@ -59,15 +59,14 @@ sub run {
 
        for my $folder (@{$config->{inbox}}) {
                next unless -e $folder;
-               say "Scanning $folder (inbox)" if $ENV{LASTMSG_DEBUG};
+               say STDERR "Scanning $folder (inbox)" if $ENV{LASTMSG_DEBUG};
                my $folder = Email::Folder->new($folder);
                while (my $msg = $folder->next_message) {
                        my ($from) = grep { /^from$/i } $msg->header_names;
                        $from = $msg->header_raw($from);
                        if ($ENV{LASTMSG_DEBUG}) {
-                               my $mid = grep { /^message-id$/i } $msg->header_names;
-                               say 'Processing ', $msg->header_raw('Message-ID'),
-                                 " from $from" if $ENV{LASTMSG_DEBUG};
+                               my ($mid) = grep { /^message-id$/i } $msg->header_names;
+                               say STDERR 'Processing ', $msg->header_raw($mid), " from $from";
                        }
                        $process_message->($msg, $from);
                }
@@ -75,7 +74,7 @@ sub run {
 
        for my $folder (@{$config->{sent}}) {
                next unless -e $folder;
-               say "Scanning $folder (sent)" if $ENV{LASTMSG_DEBUG};
+               say STDERR "Scanning $folder (sent)" if $ENV{LASTMSG_DEBUG};
                my $folder = Email::Folder->new($folder);
                while (my $msg = $folder->next_message) {
                        my @hdrs = grep { /^(?:to|cc|bcc)$/i } $msg->header_names;
@@ -84,9 +83,9 @@ sub run {
                                @people = (@people, split /,/, $msg->header_raw($hdr));
                        }
                        if ($ENV{LASTMSG_DEBUG}) {
-                               my $mid = grep { /^message-id$/i } $msg->header_names;
-                               say 'Processing ', $msg->header_raw($mid),
-                                 ' sent to ', join ',', @people if $ENV{LASTMSG_DEBUG};
+                               my ($mid) = grep { /^message-id$/i } $msg->header_names;
+                               say STDERR 'Processing ', $msg->header_raw($mid),
+                                 ' sent to ', join ',', @people;
                        }
                        $process_message->($msg, @people);
                }
@@ -134,7 +133,7 @@ Marius Gavrilescu, E<lt>marius@ieval.roE<gt>
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright (C) 2016 by Marius Gavrilescu
+Copyright (C) 2016-2017 by Marius Gavrilescu
 
 This library is free software; you can redistribute it and/or modify
 it under the same terms as Perl itself, either Perl version 5.24.1 or,
This page took 0.028088 seconds and 4 git commands to generate.