Skip Menu |

This queue is for tickets about the Mail-IMAPClient CPAN distribution.

Report information
The Basics
Id: 38655
Status: resolved
Priority: 0/
Queue: Mail-IMAPClient

People
Owner: Nobody in particular
Requestors: thomas.jarosch [...] intra2net.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: Support for UNIX domain sockets
Hello Mark, the cyrus imap server supports connections via UNIX domain sockets. We have a setup where the "superadmin" user is only allowed to connect via those. Attached patch adds unix domain sockets support to Mail- Cheers, Thomas
Subject: Mail-IMAPClient-3.08-unixsockets.patch
diff -u -r -p Mail-IMAPClient-3.08/lib/Mail/IMAPClient.pm Mail-IMAPClient-3.08-unixsockets/lib/Mail/IMAPClient.pm --- Mail-IMAPClient-3.08/lib/Mail/IMAPClient.pm 2008-05-26 13:25:39.000000000 +0200 +++ Mail-IMAPClient-3.08-unixsockets/lib/Mail/IMAPClient.pm 2008-08-22 10:43:38.000000000 +0200 @@ -242,13 +242,22 @@ sub connect(@) $self->_debug("Connecting to $server port $port"); - my $sock = IO::Socket::INET->new - ( PeerAddr => $server - , PeerPort => $port - , Proto => 'tcp' - , Debug => $self->Debug - , @timeout - ); + my $sock; + if ($server =~ /^\//) { + $sock = IO::Socket::UNIX->new + ( Peer => $server + , Debug => $self->Debug + , @timeout + ); + } else { + $sock = IO::Socket::INET->new + ( PeerAddr => $server + , PeerPort => $port + , Proto => 'tcp' + , Debug => $self->Debug + , @timeout + ); + } unless($sock) { $self->LastError("Unable to connect to $server: $@");
Accepted. Please provide a documentation update as well, next time. Thanks for the contribution