summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Geerinckx-Rice <me@tobias.gr>2019-03-01 21:04:23 +0100
committerTobias Geerinckx-Rice <me@tobias.gr>2019-07-25 22:42:39 +0200
commit66e39000c612a9e16e6db709954582c6c0db8499 (patch)
tree3dae63dbddb7f9cb46dcf72218839e87185517de
parent41097b2dee9367974c6dd16ac1ba2ee945457237 (diff)
gnu: dkimproxy: Add IPv6 support.
* gnu/packages/mail.scm (dkimproxy)[source]: Add patch. * gnu/packages/patches/dkimproxy-add-ipv6-support.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it.
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/mail.scm8
-rw-r--r--gnu/packages/patches/dkimproxy-add-ipv6-support.patch75
3 files changed, 82 insertions, 2 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index 96b5dec029..455bea0397 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -756,6 +756,7 @@ dist_patch_DATA = \
%D%/packages/patches/dfu-programmer-fix-libusb.patch \
%D%/packages/patches/diffutils-gets-undeclared.patch \
%D%/packages/patches/diffutils-getopt.patch \
+ %D%/packages/patches/dkimproxy-add-ipv6-support.patch \
%D%/packages/patches/docbook-xsl-nonrecursive-string-subst.patch \
%D%/packages/patches/doc++-include-directives.patch \
%D%/packages/patches/doc++-segfault-fix.patch \
diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index 4f0c7cf265..5ffb5b6cd1 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -1967,7 +1967,9 @@ DKIM and/or DomainKeys.")
version "/dkimproxy-" version ".tar.gz"))
(sha256
(base32
- "1gc5c7lg2qrlck7b0lvjfqr824ch6jkrzkpsn0gjvlzg7hfmld75"))))
+ "1gc5c7lg2qrlck7b0lvjfqr824ch6jkrzkpsn0gjvlzg7hfmld75"))
+ (patches
+ (search-patches "dkimproxy-add-ipv6-support.patch"))))
(build-system gnu-build-system)
(arguments
`(#:phases
@@ -1997,11 +1999,13 @@ DKIM and/or DomainKeys.")
(inputs
`(("perl" ,perl)
("perl-crypt-openssl-rsa" ,perl-crypt-openssl-rsa)
+ ("perl-io-socket-inet6" ,perl-io-socket-inet6)
("perl-mailtools" ,perl-mailtools)
("perl-mail-authenticationresults" ,perl-mail-authenticationresults)
("perl-mail-dkim" ,perl-mail-dkim)
("perl-net-dns" ,perl-net-dns)
- ("perl-net-server" ,perl-net-server)))
+ ("perl-net-server" ,perl-net-server)
+ ("perl-socket6" ,perl-socket6)))
(home-page "http://dkimproxy.sourceforge.net/")
(synopsis "SMTP-proxy for DKIM signing and verifying")
(description "DKIMproxy is an SMTP-proxy that signs and/or verifies emails,
diff --git a/gnu/packages/patches/dkimproxy-add-ipv6-support.patch b/gnu/packages/patches/dkimproxy-add-ipv6-support.patch
new file mode 100644
index 0000000000..8e9988791d
--- /dev/null
+++ b/gnu/packages/patches/dkimproxy-add-ipv6-support.patch
@@ -0,0 +1,75 @@
+From: Tobias Geerinckx-Rice <me@tobias.gr>
+Date: Fri, 01 Mar 2019 20:51:32 +0100
+Subject: [PATCH] dkimproxy: Add IPv6 support.
+
+The following patch was copied verbatim from Debian[0].
+
+[0]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=656041
+
+---
+--- 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 <bet@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 = $@)
+ {