print "\nPoller2 for wellnow.com\n";
print "I will poll in intervals of ";
print "$interval_between_polling seconds.\n\n";
#############################################
# do forever, or until Ctrl-C or SIGINT: #
# #
# - get Mail Server ID# as number from #
# command line; program is invoked as: #
# #
# C:\perl poll2.pl 2 1 (etc.) #
# #
# - logon to server and get a count of #
# waiting mail; #
# #
# - if $waiting_mail_count == 0, move on #
# to next mailbox connection; #
# #
# - else, fetch-and-stash-and-analyze-and- #
# rewrite-and-deliver-mail; #
# #
# - then sleep awhile, and start again #
#############################################
do
{
¬ify_time_date("Getting mail on ",".\n\n");
foreach $mx (@ARGV)
{
&logon_to_pop_server;
if ($waiting_mail_count == 0) { next; }
print "\a"; # bell/beep
&fetch_waiting_mail_if_any;
}
print " (sleeping $interval_between_polling...)\n\n";
sleep $interval_between_polling;
} until 1 > 2; # end of 'do', end of main