aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2008-10-01 01:06:36 +0200
committerMatej Cepl <mcepl@redhat.com>2008-10-01 01:06:36 +0200
commita8765667d700f9250d9bb6b6cd4baca8b5520873 (patch)
tree3621465ecfbf3d0308d0107ca7e1e608aeb0763e
parent6a84a24aa748517bb2a798f6035cdebe8d85c5f5 (diff)
downloadimapArch-a8765667d700f9250d9bb6b6cd4baca8b5520873.tar.gz
Change from new Class (parameters) to Class->new(parameters) so the code
is editable well with EPIC.
-rw-r--r--archiveIMAP.pl11
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();