From a0fc723827233ba635e989595ef1f72c52f44b00 Mon Sep 17 00:00:00 2001
From: Thomas Jarosch <thomas.jarosch@intra2net.com>
Date: Thu, 22 Aug 2013 22:09:09 +0200
Subject: [PATCH] Add unix socket support.

It's activated by specifying 'unix' as port.
---
 .../Imap_Client/lib/Horde/Imap/Client/Socket/Connection.php      | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/framework/Imap_Client/lib/Horde/Imap/Client/Socket/Connection.php b/framework/Imap_Client/lib/Horde/Imap/Client/Socket/Connection.php
index 48db988..8d7e306 100644
--- a/framework/Imap_Client/lib/Horde/Imap/Client/Socket/Connection.php
+++ b/framework/Imap_Client/lib/Horde/Imap/Client/Socket/Connection.php
@@ -70,8 +70,15 @@ extends Horde_Imap_Client_Base_Connection
 
         $timeout = $base->getParam('timeout');
 
+        $port = $base->getParam('port');
+        if ($port == 'unix') {
+            $remote_target = 'unix://' . $base->getParam('hostspec');
+        } else {
+            $remote_target = $conn . $base->getParam('hostspec') . ':' . $port;
+        }
+
         $this->_stream = @stream_socket_client(
-            $conn . $base->getParam('hostspec') . ':' . $base->getParam('port'),
+            $remote_target,
             $error_number,
             $error_string,
             $timeout
-- 
1.8.1.4