aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authoradamw <adamw@FreeBSD.org>2015-11-24 01:00:18 +0800
committeradamw <adamw@FreeBSD.org>2015-11-24 01:00:18 +0800
commita8350ba761c6b25f3760fb4d096260de64221da9 (patch)
treee6897575c1bc64407c0b16b93d065b9998507d9f /mail
parent07c42ab760434788cc47a3ae8cb1815262a3d0de (diff)
downloadfreebsd-ports-gnome-a8350ba761c6b25f3760fb4d096260de64221da9.tar.gz
freebsd-ports-gnome-a8350ba761c6b25f3760fb4d096260de64221da9.tar.zst
freebsd-ports-gnome-a8350ba761c6b25f3760fb4d096260de64221da9.zip
Add two patches from upstream bug #7265, which fixes incompatibilities with
Net::DNS 1.03. The FreeBSD p5-Net-DNS port has been downgraded to 1.02 but Net::DNS will be re-issued at some point soon. The changes in these patches seem to work well with Net::DNS 1.02. While here, add some TEST_DEPENDS so I can run the plugin-based tests as well. Bump PORTREVISION for spamassassin and japanese/spamassassin. PR: 204682 Submitted by: Mark.Martinec@ijs.si Obtained from: https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7265
Diffstat (limited to 'mail')
-rw-r--r--mail/spamassassin/Makefile6
-rw-r--r--mail/spamassassin/files/patch-bug726583
2 files changed, 88 insertions, 1 deletions
diff --git a/mail/spamassassin/Makefile b/mail/spamassassin/Makefile
index 552529d75c28..d17dd375bb1a 100644
--- a/mail/spamassassin/Makefile
+++ b/mail/spamassassin/Makefile
@@ -3,7 +3,7 @@
PORTNAME= spamassassin
PORTVERSION= 3.4.1
-PORTREVISION?= 4 # also bump japanese/spamassassin
+PORTREVISION?= 5 # also bump japanese/spamassassin
CATEGORIES?= mail perl5
MASTER_SITES= APACHE/spamassassin/source CPAN/Mail
DISTNAME= Mail-SpamAssassin-${PORTVERSION}
@@ -22,6 +22,10 @@ BUILD_DEPENDS= p5-Encode-Detect>=0:${PORTSDIR}/converters/p5-Encode-Detect \
RUN_DEPENDS:= ${BUILD_DEPENDS} \
re2c>=.12.0:${PORTSDIR}/devel/re2c
+.for dep in DCC DKIM MYSQL PGSQL PYZOR RAZOR RELAY_COUNTRY SPF_QUERY SSL
+TEST_DEPENDS+= ${${dep}_RUN_DEPENDS}
+.endfor
+
CONFLICTS?= ja-spamassassin-[0-9]*
CPE_VENDOR= apache
diff --git a/mail/spamassassin/files/patch-bug7265 b/mail/spamassassin/files/patch-bug7265
new file mode 100644
index 000000000000..b8cf28f1d456
--- /dev/null
+++ b/mail/spamassassin/files/patch-bug7265
@@ -0,0 +1,83 @@
+--- lib/Mail/SpamAssassin/DnsResolver.pm (revision 1715195)
++++ lib/Mail/SpamAssassin/DnsResolver.pm (working copy)
+@@ -725,6 +725,37 @@
+
+ ###########################################################################
+
++=item $id = $res->bgread()
++
++Similar to C<Net::DNS::Resolver::bgread>. Reads a DNS packet from
++a supplied socket, decodes it, and returns a Net::DNS::Packet object
++if successful. Dies on error.
++
++=cut
++
++sub bgread() {
++ my ($self) = @_;
++ my $sock = $self->{sock};
++ my $packetsize = $self->{res}->udppacketsize;
++ $packetsize = 512 if $packetsize < 512; # just in case
++ my $data = '';
++ my $peeraddr = $sock->recv($data, $packetsize+256); # with some size margin for troubleshooting
++ defined $peeraddr or die "bgread: recv() failed: $!";
++ my $peerhost = $sock->peerhost;
++ $data ne '' or die "bgread: received empty packet from $peerhost";
++ dbg("dns: bgread: received %d bytes from %s", length($data), $peerhost);
++ my($answerpkt, $decoded_length) = Net::DNS::Packet->new(\$data);
++ $answerpkt or die "bgread: decoding DNS packet failed: $@";
++ $answerpkt->answerfrom($peerhost);
++ if ($decoded_length ne length($data)) {
++ warn sprintf("bgread: received a %d bytes packet from %s, decoded %d bytes\n",
++ length($data), $peerhost, $decoded_length);
++ }
++ return $answerpkt;
++}
++
++###########################################################################
++
+ =item $nfound = $res->poll_responses()
+
+ See if there are any C<bgsend> reply packets ready, and return
+@@ -772,13 +803,25 @@
+ $timeout = 0; # next time around collect whatever is available, then exit
+ last if $nfound == 0;
+
+- my $packet = $self->{res}->bgread($self->{sock});
++ my $packet;
++ eval {
++ $packet = $self->bgread();
++ } or do {
++ undef $packet;
++ my $eval_stat = $@ ne '' ? $@ : "errno=$!"; chomp $eval_stat;
++ # resignal if alarm went off
++ die $eval_stat if $eval_stat =~ /__alarm__ignore__\(.*\)/s;
++ info("dns: bad dns reply: %s", $eval_stat);
++ };
+
++# Bug 7265, use our own bgread()
++# my $packet = $self->{res}->bgread($self->{sock});
++
+ if (!$packet) {
+- my $dns_err = $self->{res}->errorstring;
+- # resignal if alarm went off
+- die "dns (3) $dns_err\n" if $dns_err =~ /__alarm__ignore__\(.*\)/s;
+- info("dns: bad dns reply: $dns_err");
++ # error already reported above
++# my $dns_err = $self->{res}->errorstring;
++# die "dns (3) $dns_err\n" if $dns_err =~ /__alarm__ignore__\(.*\)/s;
++# info("dns: bad dns reply: $dns_err");
+ } else {
+ my $header = $packet->header;
+ if (!$header) {
+--- lib/Mail/SpamAssassin/Plugin/DKIM.pm (revision 1715196)
++++ lib/Mail/SpamAssassin/Plugin/DKIM.pm (working copy)
+@@ -794,7 +794,8 @@
+ # Only do so if EDNS0 provides a reasonably-sized UDP payload size,
+ # as our interface does not provide a DNS fallback to TCP, unlike
+ # the Net::DNS::Resolver::send which does provide it.
+- my $res = $self->{main}->{resolver}->get_resolver;
++ my $res = $self->{main}->{resolver};
++ dbg("dkim: providing our own resolver: %s", ref $res);
+ Mail::DKIM::DNS::resolver($res);
+ }
+ }