Skip Menu |
 

This queue is for tickets about the IMAP-Admin CPAN distribution.

Report information
The Basics
Id: 38656
Status: new
Priority: 0/
Queue: IMAP-Admin

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

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



Subject: Support for UNIX domain sockets
Download (untitled) / with headers
text/plain 278b
Hello, 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 IMAP-Admin if the server variable begins with a "/". Cheers, Thomas
Subject: IMAP-Admin-unix_socket.patch
diff -u -r IMAP-Admin-1.6.4/Admin.pm IMAP-Admin.unix_socket/Admin.pm --- IMAP-Admin-1.6.4/Admin.pm Wed Feb 16 14:43:04 2005 +++ IMAP-Admin.unix_socket/Admin.pm Fri Aug 22 10:09:40 2008 @@ -91,19 +91,30 @@ return; } } else { - if (!eval { - $self->{'Socket'} = - IO::Socket::INET->new(PeerAddr => $self->{'Server'}, - PeerPort => $self->{'Port'}, - Proto => 'tcp', - Reuse => 1, - Timeout => 5); }) - { - delete $self->{'Socket'}; - $self->_error("initialize", "couldn't establish connection to", - $self->{'Server'}); - return; - + if ($self->{'Server'} =~ /^\//) { + if (!eval { + $self->{'Socket'} = + IO::Socket::UNIX->new(Peer => $self->{'Server'}); }) + { + delete $self->{'Socket'}; + $self->_error("initialize", "couldn't establish connection to", + $self->{'Server'}); + return; + } + } else { + if (!eval { + $self->{'Socket'} = + IO::Socket::INET->new(PeerAddr => $self->{'Server'}, + PeerPort => $self->{'Port'}, + Proto => 'tcp', + Reuse => 1, + Timeout => 5); }) + { + delete $self->{'Socket'}; + $self->_error("initialize", "couldn't establish connection to", + $self->{'Server'}); + return; + } } } my $fh = $self->{'Socket'};


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.