Hi Jason,

I have receive the below bug report on the Debian bug tracker. The
attached patch which was sent together with the bug report enables IPv6
support for dkimproxy (so that it can also listen on v6).

1/ What do you think of this patch?
2/ Can this be added upstream, and a new version of dkimproxy be
released with it, so that I can package that in Debian?

Please let me know asap.

Cheers,

Thomas Goirand

GPLHost CEO, Debian Developer since June 2010
Debian PGP: E4F0 EDDF 374F 2C50 D473  5EC0 9783 3DC9 98EF 9A49

-------- Original Message --------
Subject: Bug#656041: dkimproxy: add IPv6 support
Resent-Date: Mon, 16 Jan 2012 05:09:01 +0000
Resent-From: Kenyon Ralph <ken...@kenyonralph.com>
Resent-To: debian-bugs-dist@lists.debian.org
Resent-CC: Thomas Goirand <z...@debian.org>
Date: Sun, 15 Jan 2012 21:06:34 -0800
From: Kenyon Ralph <ken...@kenyonralph.com>
Reply-To: Kenyon Ralph <ken...@kenyonralph.com>, 656...@bugs.debian.org
To: Debian Bug Tracking System <sub...@bugs.debian.org>

Package: dkimproxy
Version: 1.4.1-3
Severity: normal
Tags: ipv6 patch

Attached is a patch that allows dkimproxy to listen on IPv6, provided
that the installed version of libnet-server-perl supports IPv6, which
version 0.99-3 in Debian does. This patch depends on the package
libio-socket-inet6-perl.

I haven't tested whether it still works with a non-IPv6-patched
libnet-server-perl, but I think it should.

Without this patch, if you have libnet-server-perl 0.99-3 installed,
dkimproxy will open a socket for listening on IPv6, but upon
connection, you will get "Connection closed by foreign host."

-- System Information:
Debian Release: 6.0.3
  APT prefers stable
  APT policy: (990, 'stable'), (500, 'stable-updates')
Architecture: amd64 (x86_64)

Kernel: Linux 3.0.4-x86_64-linode21 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages dkimproxy depends on:
ii  adduser                3.112+nmu2        add and remove users and groups
ii  liberror-perl          0.17-1            Perl module for
error/exception ha
ii  libmail-dkim-perl      0.38-1            cryptographically identify
the sen
ii  libnet-server-perl     0.99-3~bpo60+1    extensible, general perl
server en
ii  libtext-wrapper-perl   1.02-1            Simple word wrapping routine
ii  lsb-base               3.2-23.2squeeze1  Linux Standard Base 3.2
init scrip
ii  openssl                0.9.8o-4squeeze5  Secure Socket Layer (SSL)
binary a
ii  perl                   5.10.1-17squeeze2 Larry Wall's Practical
Extraction
ii  ssl-cert               1.0.28            simple debconf wrapper for
OpenSSL

Versions of packages dkimproxy recommends:
pn  amavisd-new                   <none>     (no description available)

dkimproxy suggests no packages.

-- Configuration Files:
/etc/default/dkimproxy changed:
RUN_DKIMPROXY_IN=0

/etc/dkimproxy/dkimproxy_in.conf changed:
listen    localhost:10026
relay     localhost:10024

/etc/dkimproxy/dkimproxy_out.conf changed:
listen    localhost:10028
relay     localhost:10029
domain    kenyonralph.com
signature dkim
keyfile   /var/lib/dkimproxy/private.key
selector  postfix


-- no debconf information

--- dkimproxy-1.4.1.orig/lib/MSDW/SMTP/Server.pm
+++ dkimproxy-1.4.1/lib/MSDW/SMTP/Server.pm
@@ -11,7 +11,7 @@
 # Written by Bennett Todd <b...@rahul.net>
 
 package MSDW::SMTP::Server;
-use IO::Socket;
+use IO::Socket::INET6;
 use IO::File;
 
 =head1 NAME
@@ -88,14 +88,14 @@
 =item new(interface => $interface, port => $port);
 
 The interface and port to listen on must be specified. The interface
-must be a valid numeric IP address (0.0.0.0 to listen on all
-interfaces, as usual); the port must be numeric. If this call
-succeeds, it returns a server structure with an open
-IO::Socket::INET in it, ready to listen on. If it fails it dies, so
-if you want anything other than an exit with an explanatory error
-message, wrap the constructor call in an eval block and pull the
-error out of $@ as usual. This is also the case for all other
-methods; they succeed or they die.
+must be a valid numeric IPv4 or IPv6 address (0.0.0.0 or :: to listen
+on all interfaces, as usual); the port must be numeric. If this call
+succeeds, it returns a server structure with an open IO::Socket::INET6
+in it, ready to listen on. If it fails it dies, so if you want
+anything other than an exit with an explanatory error message, wrap
+the constructor call in an eval block and pull the error out of $@ as
+usual. This is also the case for all other methods; they succeed or
+they die.
 
 =item accept([debug => FD]);
 
@@ -154,7 +154,7 @@
     my ($this, @opts) = @_;
     my $class = ref($this) || $this;
     my $self = bless { @opts }, $class;
-    $self->{sock} = IO::Socket::INET->new(
+    $self->{sock} = IO::Socket::INET6->new(
        LocalAddr => $self->{interface},
        LocalPort => $self->{port},
        Proto => 'tcp',
only in patch2:
unchanged:
--- dkimproxy-1.4.1.orig/scripts/dkimproxy.out
+++ dkimproxy-1.4.1/scripts/dkimproxy.out
@@ -314,17 +314,11 @@
 {
        my $self = shift;
 
-       # try to determine peer's address
-       use Socket;
-       my $peersockaddr = getpeername(STDOUT);
-       my ($port, $iaddr) = sockaddr_in($peersockaddr);
-       $ENV{REMOTE_ADDR} = inet_ntoa($iaddr);
-
        # initialize syslog
        eval
        {
                openlog("dkimproxy.out", "perror,pid,ndelay", "mail");
-               syslog("debug", '%s', "connect from $ENV{REMOTE_ADDR}");
+               syslog("debug", '%s', "connect from 
$self->{server}->{peeraddr}");
        };
        if (my $E = $@)
        {

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to