X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;f=bin%2FannounceEmail.pl;h=71c96dd5fd378a24da199f4ecc424b7dae9366d6;hb=39158f66c2f8b792ddb04a22854e332a023b3d16;hp=01c42263edcbfb4c1e2c7d61d02fcd4154015940;hpb=68585f2c71b199b8a9ee2184e762071fb9289bae;p=clearscm.git diff --git a/bin/announceEmail.pl b/bin/announceEmail.pl index 01c4226..71c96dd 100755 --- a/bin/announceEmail.pl +++ b/bin/announceEmail.pl @@ -44,7 +44,7 @@ $Date: 2019/04/04 13:40:10 $ -use|rname: User name to log in with (Default: $USER) -p|assword: Password to use (Default: prompted) -i|map: IMAP server to talk to (Default: defaria.com) - -s|leep: Number of minutes to sleep inbetween checking mail (Default: 5) + -s|leep: Number of minutes to sleep inbetween checking mail (Default: 1) =head1 DESCRIPTION @@ -168,14 +168,15 @@ sub MonitorMail() { } # if # Now speak it! + my $logmsg = "From $from $subject"; my $msg = "Message from $from... " . quotemeta $subject; $msg =~ s/\"/\\"/g; if (get_verbose) { - $log->msg("Announcing $msg"); + $log->msg($logmsg); } else { - $log->log("Announcing $msg") - } + $log->log($logmsg); + } # if my $cmd = "/usr/local/bin/gt \"$msg\""; @@ -226,4 +227,8 @@ $log = Logger->new( ); Connect2IMAP; + +my $cmd = "/usr/local/bin/gt \"Now monitoring email for $opts{username}\@$opts{imap}\""; +my ($status, @output) = Execute $cmd; + MonitorMail;