diff options
-rw-r--r-- | archiveIMAP.pl | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/archiveIMAP.pl b/archiveIMAP.pl index 35d4ea8..a33cf23 100644 --- a/archiveIMAP.pl +++ b/archiveIMAP.pl @@ -14,9 +14,10 @@ my $account = "zimbra"; # How many months before today the cut date should be? my $howManyMonths = 3; +my $debug = 1; # get configuration for the account -my $conf = new Config::IniFiles ( -file => "/home/matej/.bugzillarc"); +my $conf = Config::IniFiles->new( -file => "/home/matej/.bugzillarc"); die "No configuration for account $account" unless $conf->SectionExists($account); my $hostname = $conf->val($account,'host'); my $login = $conf->val($account,'name'); @@ -60,7 +61,7 @@ sub getMessageYear { my $imap = Mail::IMAPClient->new(); if ($ssl) { - my $sslSocket=new IO::Socket::SSL("$hostname:imaps"); + my $sslSocket=IO::Socket::SSL->new("$hostname:imaps"); die ("Error connecting - $@") unless defined $sslSocket; $sslSocket->autoflush(1); @@ -68,7 +69,7 @@ if ($ssl) { Server => $hostname, Socket => $sslSocket, User => $login, - Debug => 1, + Debug => $debug, Password => $password, UID => 1 ) or die "Cannot connect to localhost as matej: $@"; @@ -76,7 +77,7 @@ if ($ssl) { $imap = Mail::IMAPClient->new( Server => $hostname, User => $login, - Debug => 1, + Debug => $debug, Password => $password, UID => 1 ) or die "Cannot connect to localhost as matej: $@"; @@ -107,4 +108,4 @@ foreach my $folder (@sourceFolders) { } } } -$imap->close();
\ No newline at end of file +$imap->close(); |