On Wed, May 28, 2014 at 04:46:14PM +0100, st...@thornet.co.uk wrote:

> > Real evidence would be in the form of strace (or equivalent)
> > output that shows Postfix uses an AF_UNIX (AF_LOCAL) socket.
>
> We got this:
> May 28 16:39:52 balder logger: socket(PF_FILE, SOCK_STREAM, 0) = 23
> May 28 16:39:52 balder logger: fcntl(23, F_GETFL) = 0x2 (flags O_RDWR)
> May 28 16:39:52 balder logger: fcntl(23, F_SETFL, O_RDWR|O_NONBLOCK) = 0
> May 28 16:39:52 balder logger: connect(23, {sa_family=AF_FILE, 
> path="inet:82.113.142.39:12345"...}, 110) = -1 ENOENT (No such file or 
> directory)
> May 28 16:39:52 balder logger: close(23)

Then your Postfix release predates Postfix 2.6 in which support
for "inet:" was introduced (postfix-2.6-20090212).  Or someone
"improved" the code after obtaining it from postfix.org.

The change to support "inet:" from 2.6-20090212 is below:

-    if ((fd = unix_connect(xp->socket_path, BLOCKING, AUTH_TIMEOUT)) < 0) {
+    /*
+     * Not documented, but necessary for testing.
+     */
+    path = xp->socket_path;
+    if (strncmp(path, "inet:", 5) == 0) {
+       fd = inet_connect(path + 5, BLOCKING, AUTH_TIMEOUT);
+    } else {
+       if (strncmp(path, "unix:", 5) == 0)
+           path += 5;
+       fd = unix_connect(path, BLOCKING, AUTH_TIMEOUT);
+    }
+    if (fd < 0) {
        msg_warn("SASL: Connect to %s failed: %m", xp->socket_path);
        return (-1);
     }

Perhaps the comment could be modified now that the "inet:" syntax
is documented in SASL_README.

-- 
        Viktor.

Reply via email to