Using IMAP::Client with Cyrus IMAP server
I’m currently working on a personal project where I want to access my Cyrus IMAP-Server using Perl. Hence I looked at CPAN and there are two major modules dealing with IMAP:
I’ve chosen the first one, because it seems to make less effort to get into it and everything I need should be supported. I followed the example in the POD:
my $imap = new IMAP::Client();
$imap->connect(PeerAddr => $server,
ConnectMethod => 'SSL STARTTLS PLAIN',
)
or die "Unable to connect to [$server]: ".$imap->error();
$imap->onfail('ERROR');
$imap->errorstyle('STACK');
$imap->debuglevel(1);
$imap->capability_checking(1);
$imap->authenticate($user,$pass)
or die "Unable to authenticate as $user ".$imap->error()."\n";
Unfortunately I always got the nasty little error driving my insane (well, ok, most people think I am already insane anyway):
```« * OK odin Cyrus IMAP4 v2.1.18-IPv6-Debian-2.1.18-5.1 server ready
0001 NOOP « 0001 OK Completed « * OK odin Cyrus IMAP4 v2.1.18-IPv6-Debian-2.1.18-5.1 server ready 0002 NOOP « 0002 OK Completed 0003 CAPABILITY « * CAPABILITY IMAP4 IMAP4rev1 ACL QUOTA LITERAL+ MAILBOX-REFERRALS NAMESPACE UIDPLUS ID NO_ATOMIC_RENAME UNSELECT CHILDREN MULTIAPPEND SORT THREAD=ORDEREDSUBJECT THREAD=REFERENCES IDLE STARTTLS ANNOTATEMORE « 0003 OK Completed 0004 STARTTLS « 0004 OK Begin TLS negotiation now