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: $@");