aboutsummaryrefslogtreecommitdiffstats
path: root/listFolders.pl
blob: 5be4bc6e0d1b0ca971f0bb4bdb7b57d470af5cf2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/perl

use strict;
use warnings;
use Mail::IMAPClient;
use Data::Dumper;

my $msg;
my $hostname = "localhost";
my $login = "matej";
my $passwd = "lubdkc";

my $imap = Mail::IMAPClient->new();
$imap = Mail::IMAPClient->new(
	Server => $hostname,
	User => $login,
	Password => $passwd,
	UID => 1
) or die "Cannot connect to localhost as matej: $@";

print "\n===============================\n";
my @folders = $imap->folders;
print join("\n",@folders),"\n";