=head1 ENVIRONMENT
The only recognised environment variable is B<LASTMSG_DEBUG>, which if
-set to a true value causes the script to emit a lot of information
-about what it is doing.
+set to a true value causes the script to emit a lot of information on
+STDERR about what it is doing.
=head1 TODO
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'),
+ say STDERR 'Processing ', $msg->header_raw('Message-ID'),
" from $from" if $ENV{LASTMSG_DEBUG};
}
$process_message->($msg, $from);
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;
}
if ($ENV{LASTMSG_DEBUG}) {
my $mid = grep { /^message-id$/i } $msg->header_names;
- say 'Processing ', $msg->header_raw($mid),
+ say STDERR 'Processing ', $msg->header_raw($mid),
' sent to ', join ',', @people if $ENV{LASTMSG_DEBUG};
}
$process_message->($msg, @people);