aboutsummaryrefslogtreecommitdiff
path: root/mail/spamassassin
diff options
context:
space:
mode:
authorAdam Weinberger <adamw@FreeBSD.org>2015-11-23 17:00:18 +0000
committerAdam Weinberger <adamw@FreeBSD.org>2015-11-23 17:00:18 +0000
commitb4a3b2f221fb0f07973b0bc21b5015b5146dbc13 (patch)
treee6897575c1bc64407c0b16b93d065b9998507d9f /mail/spamassassin
parent82abbbe8b6b9d1ca1344e0c4c5d12a844910931d (diff)
downloadports-b4a3b2f221fb0f07973b0bc21b5015b5146dbc13.tar.gz
ports-b4a3b2f221fb0f07973b0bc21b5015b5146dbc13.zip
Notes
Diffstat (limited to 'mail/spamassassin')
-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);
+ }
+ }