projects
/
clearscm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
56813f1
)
Added friendly greetings
author
Andrew DeFaria
<Andrew@DeFaria.com>
Wed, 15 Jul 2020 17:31:11 +0000
(10:31 -0700)
committer
Andrew DeFaria
<Andrew@DeFaria.com>
Wed, 15 Jul 2020 17:31:11 +0000
(10:31 -0700)
bin/announceEmail.pl
patch
|
blob
|
history
diff --git
a/bin/announceEmail.pl
b/bin/announceEmail.pl
index
7e840e1
..
31c7596
100755
(executable)
--- a/
bin/announceEmail.pl
+++ b/
bin/announceEmail.pl
@@
-76,6
+76,19
@@
my $IMAP;
my %unseen;
my $log;
my %unseen;
my $log;
+my @greetings = (
+ 'Incoming message',
+ 'You have received a new message',
+ 'Hey I found this in your inbox',
+ 'For some unknown reason this guy send you a message',
+ 'Did you know you just got a message',
+ 'Potential spam',
+ 'You received a communique',
+ 'I was looking in your inbox and found a message',
+ 'Not sure you want to hear this message',
+ 'Good news',
+);
+
my %opts = (
usage => sub { pod2usage },
help => sub { pod2usage(-verbose => 2)},
my %opts = (
usage => sub { pod2usage },
help => sub { pod2usage(-verbose => 2)},
@@
-117,7
+130,7
@@
sub unseenMsgs() {
} # unseenMsgs
sub Connect2IMAP() {
} # unseenMsgs
sub Connect2IMAP() {
- $log->msg("Connecting to $opts{imap} as $opts{username}
...", 1
);
+ $log->msg("Connecting to $opts{imap} as $opts{username}
"
);
$IMAP = Mail::IMAPTalk->new(
Server => $opts{imap},
$IMAP = Mail::IMAPTalk->new(
Server => $opts{imap},
@@
-125,7
+138,7
@@
sub Connect2IMAP() {
Password => $opts{password},
) or $log->err("Unable to connect to IMAP server $opts{imap}: $@", 1);
Password => $opts{password},
) or $log->err("Unable to connect to IMAP server $opts{imap}: $@", 1);
- $log->msg('
c
onnected');
+ $log->msg('
C
onnected');
# Focus on INBOX only
$IMAP->select('inbox');
# Focus on INBOX only
$IMAP->select('inbox');
@@
-184,10
+197,12
@@
sub MonitorMail() {
# Now speak it!
debugit "Speaking message from $from";
# Now speak it!
debugit "Speaking message from $from";
+
my $logmsg = "From $from $subject";
my $logmsg = "From $from $subject";
- my $msg = "Message from $from... " . quotemeta $subject;
- $msg =~ s/\"/\\"/g;
+ my $greeting = $greetings[int rand $#greetings];
+ my $msg = "$greeting from $from... " . quotemeta $subject;
+ $msg =~ s/\"/\\"/g;
# Log it
$log->msg($logmsg);
# Log it
$log->msg($logmsg);