#!/usr/bin/perl -w use GMail::Checker; my $gwrapper = new GMail::Checker(); my $inbox = "c:\\Documents and Settings\\sai\\Local Settings\\Application Data\\Identities\\{DBF16927-8FE1-1EDA-A099-460B7165289A}\\Microsoft\\Outlook Express\\Inbox.dbx"; my $inbox_pre = "c:\\Documents and Settings\\sai\\Local Settings\\Application Data\\Identities\\{DBF16927-8FE1-1EDA-A099-460B7165289A}\\Microsoft\\Outlook Express\\Inbox.bak"; # no new mail my $inbox_post = "c:\\Documents and Settings\\sai\\Local Settings\\Application Data\\Identities\\{DBF16927-8FE1-1EDA-A099-460B7165289A}\\Microsoft\\Outlook Express\\Inbox.new"; # has new mail my $new_messages = 0; my $cp = ""; # initialize inbox.dbx to "no new mail" file: $cp = "cp \"".$inbox_pre."\" \"".$inbox."\""; `$cp`; while (1) { # Let's log into our account (using SSL) $gwrapper->login("username","password"); # Do we have new messages ? my $alert = $gwrapper->get_pretty_nb_messages(ALERT => "NEW_MSG_ONLY"); $alert =~/(\d+) new/; # if a new msg was deleted then reset new_messages: if ($1 < $new_messages) { $new_messages = $1;} # if new messages is > 0 then light up that button if (($1 - $new_messages) > 0) { $new_messages = $1; # update inbox.dbx with the 'has new mail' inbox file $cp = "cp \"".$inbox_post."\" \"".$inbox."\""; `$cp`; sleep 5; # reset inbox.dbx with the 'no new mail' inbox file $cp = "cp \"".$inbox_pre."\" \"".$inbox."\""; `$cp`; } sleep 60; }