Small bug on PERL script

İptal Edildi İlan edilme: Oct 1, 2012 Teslim sırasında ödenir
İptal Edildi Teslim sırasında ödenir

Having a bug error with a perl script. Need this fixed so our program works again to imap into gmail and compile a list of all email addresses. I will provide complete scripts once you accept the project. Getting following error when I run it via command line:

[root@web1 /u/home/o/onli17/public_html/gmailimap]# ./[url removed, login to view]

Can't call method "login" on an undefined value at ./[url removed, login to view] line 84.

(please see further description)

## Deliverables

line 84 is the "die" line in the following section of the script: [url removed, login to view]

}

sub extractAddresses {

for(my $i = 0; $i < @imap_usernames; $i++) {

my $imap = Net::IMAP::Simple::SSL->new('[url removed, login to view]');

die('Error logging in with '.$imap_usernames[$i]) if(!$imap->login($imap_usernames[$i] => $imap_passwords[$i]));

my $msgnum = $imap->select($imap_foldername);

print "[INFO] Logged in to SMTP with username ".$imap_usernames[$i].", extracting addresses...\n";

# extract names and addresses from mails

my $maxDate = str2time(getLastCheck($imap_usernames[$i]));

my $queryDate = time2str("%d", $maxDate)."-".$months[int(time2str("%L", $maxDate)) - 1]."-".time2str("%Y", $maxDate)

;

my @ids = imapsearch($imap, "SENTSINCE $queryDate");

$msgnum = @ids;

my $count = 0;

foreach my $i (@ids) {

$count++;

printf("\r%d / %d (%.2f%)", $count, $msgnum, ($count / $msgnum * 100)) if($print_progress);

my $imapRes = $imap->top($i);

if(defined($imapRes)) {

my $email = Email::Simple->new(join '', @{$imapRes});

my @to_adr = Email::Address->parse($email->header('to'));

my @cc_adr = Email::Address->parse($email->header('cc'));

foreach my $adr ((@to_adr, @cc_adr)) {

my $phrase = decode('MIME-Header', $adr->phrase);

utf8::encode($phrase);

my $lcaddress = lc($adr->address);

$lcaddress =~ s/'//g;

if((!defined($all_messages{$lcaddress})) ||

(($phrase ne "") && ($all_messages{$lcaddress} ne $phrase))) {

$all_messages{$lcaddress} = $phrase;

}

}

}

}

print "\n" if(($print_progress) && ($msgnum > 0));

print "[INFO] Done.\n";

$imap->quit;

}

}

Linux MySQL Perl PHP Yazılım Mimarisi Yazılım Test Etme UNIX

Proje NO: #2781380

Proje hakkında

4 teklif Uzak proje Aktif Oct 8, 2012

Bu iş için 4 freelancer ortalamada $36 teklif veriyor

dezignercoder

See private message.

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(95 Değerlendirme)
6.2
laknotech

See private message.

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(2 Değerlendirme)
3.5
addisoftsoln

See private message.

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(2 Değerlendirme)
0.5
nhatquangso

See private message.

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(0 Değerlendirme)
0.0
hiteshgajjarvw

See private message.

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(0 Değerlendirme)
0.0