SA Bugzilla – Bug 7623
sa-update files with mirrors containing paths (or ports)
Last modified: 2018-09-29 10:21:28 UTC
The DNS query introduced in https://github.com/apache/spamassassin/commit/83bc5ea4062948f399ca1b96ea906314717850fe fails if the update URL contains paths or ports. According to https://wiki.apache.org/spamassassin/PublishingRuleUpdates this should be supported. Right now only the trailing slash + leading scheme will be removed. Optional paths or ports will be passed together with the domain to do_dns_query. e.g. "http://sa.zmi.at/sa-update-german/" will result in do_dns_query("sa.zmi.at/sa-update-german"). Obviously this can't work and the mirror will be marked as failed. A quick fix would be using the URI module: $mirror = URI->new($mirror)->host Do not know if this is available in all supported perl versions.
The following patch does work for me. diff -ruN Mail-SpamAssassin-3.4.2.orig/sa-update.raw Mail-SpamAssassin-3.4.2/sa-update.raw --- Mail-SpamAssassin-3.4.2.orig/sa-update.raw 2018-09-14 03:27:51.000000000 +0200 +++ Mail-SpamAssassin-3.4.2/sa-update.raw 2018-09-27 18:07:22.339001090 +0200 @@ -1659,6 +1659,7 @@ my($a_rr, $aaaa_rr); # RFC 3986: scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) $mirror =~ s{^[a-z][a-z0-9.+-]*://}{}si; # strip scheme like http:// + $mirror =~ s{(:[0-9]+)?(/.*)?$}{}si; # strip port and path like :8090/updatestage/ return 1 if $have_inet4 && do_dns_query($mirror, "A"); return 1 if $have_inet6 && do_dns_query($mirror, "AAAA"); return 0;
Fixed Sending spamassassin-3.4/sa-update.raw Sending trunk/sa-update.raw Transmitting file data ..done Committing transaction... Committed revision 1842303.
Ok might as well do it properly, before someone thinks of using IPv4 or IPv6 IP-address literals.. Sending spamassassin-3.4/sa-update.raw Sending trunk/sa-update.raw Transmitting file data ..done Committing transaction... Committed revision 1842321.