gnu: Add kafs-client
[jackhill/guix/guix.git] / gnu / packages / patches / dkimproxy-add-ipv6-support.patch
1 From: Tobias Geerinckx-Rice <me@tobias.gr>
2 Date: Fri, 01 Mar 2019 20:51:32 +0100
3 Subject: [PATCH] dkimproxy: Add IPv6 support.
4
5 The following patch was copied verbatim from Debian[0].
6
7 [0]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=656041
8
9 ---
10 --- dkimproxy-1.4.1.orig/lib/MSDW/SMTP/Server.pm
11 +++ dkimproxy-1.4.1/lib/MSDW/SMTP/Server.pm
12 @@ -11,7 +11,7 @@
13 # Written by Bennett Todd <bet@rahul.net>
14
15 package MSDW::SMTP::Server;
16 -use IO::Socket;
17 +use IO::Socket::INET6;
18 use IO::File;
19
20 =head1 NAME
21 @@ -88,14 +88,14 @@
22 =item new(interface => $interface, port => $port);
23
24 The interface and port to listen on must be specified. The interface
25 -must be a valid numeric IP address (0.0.0.0 to listen on all
26 -interfaces, as usual); the port must be numeric. If this call
27 -succeeds, it returns a server structure with an open
28 -IO::Socket::INET in it, ready to listen on. If it fails it dies, so
29 -if you want anything other than an exit with an explanatory error
30 -message, wrap the constructor call in an eval block and pull the
31 -error out of $@ as usual. This is also the case for all other
32 -methods; they succeed or they die.
33 +must be a valid numeric IPv4 or IPv6 address (0.0.0.0 or :: to listen
34 +on all interfaces, as usual); the port must be numeric. If this call
35 +succeeds, it returns a server structure with an open IO::Socket::INET6
36 +in it, ready to listen on. If it fails it dies, so if you want
37 +anything other than an exit with an explanatory error message, wrap
38 +the constructor call in an eval block and pull the error out of $@ as
39 +usual. This is also the case for all other methods; they succeed or
40 +they die.
41
42 =item accept([debug => FD]);
43
44 @@ -154,7 +154,7 @@
45 my ($this, @opts) = @_;
46 my $class = ref($this) || $this;
47 my $self = bless { @opts }, $class;
48 - $self->{sock} = IO::Socket::INET->new(
49 + $self->{sock} = IO::Socket::INET6->new(
50 LocalAddr => $self->{interface},
51 LocalPort => $self->{port},
52 Proto => 'tcp',
53 only in patch2:
54 unchanged:
55 --- dkimproxy-1.4.1.orig/scripts/dkimproxy.out
56 +++ dkimproxy-1.4.1/scripts/dkimproxy.out
57 @@ -314,17 +314,11 @@
58 {
59 my $self = shift;
60
61 - # try to determine peer's address
62 - use Socket;
63 - my $peersockaddr = getpeername(STDOUT);
64 - my ($port, $iaddr) = sockaddr_in($peersockaddr);
65 - $ENV{REMOTE_ADDR} = inet_ntoa($iaddr);
66 -
67 # initialize syslog
68 eval
69 {
70 openlog("dkimproxy.out", "perror,pid,ndelay", "mail");
71 - syslog("debug", '%s', "connect from $ENV{REMOTE_ADDR}");
72 + syslog("debug", '%s', "connect from $self->{server}->{peeraddr}");
73 };
74 if (my $E = $@)
75 {