OS: ==== FreeBSD lrrr 10.1-RELEASE-p15 FreeBSD 10.1-RELEASE-p15 #0: Tue Jul 21 18:00:00 UTC 2015 root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64 problem description: ====================== policyd-weight does not work during operation. Jul 22 07:41:21 <mail.warn> lrrr postfix/policyd-weight[1382]: warning: child: err: Undefined subroutine &Net::DNS::Packet::dn_expand called at /usr/local/bin/policyd-weight line 3589, <GEN7> line 26. information about involved ports: ================================== [ph@lrrr ~]$ pkg info postfix-policyd-weight postfix-policyd-weight-0.1.15.2_4 Name : postfix-policyd-weight Version : 0.1.15.2_4 Installed on : Wed Jul 22 12:37:33 CEST 2015 Origin : mail/postfix-policyd-weight Architecture : freebsd:10:x86:64 Prefix : /usr/local Categories : mail Licenses : GPLv2 Maintainer : ohauer@FreeBSD.org WWW : http://www.policyd-weight.org Comment : Weighted policy daemon for postfix Annotations : Flat size : 151KiB Description : Policyd-weight is (as the name says) a weighted policyd for Postfix. It uses HELO, MAIL FROM and the MTA IP address for scoring their correctness. It also uses definable DNSBLs and RHSBLs in a scored fashion. WWW: http://www.policyd-weight.org [ph@lrrr ~]$ pkg info p5-Net-DNS p5-Net-DNS-1.01 Name : p5-Net-DNS Version : 1.01 Installed on : Mon Jul 20 13:06:30 CEST 2015 Origin : dns/p5-Net-DNS Architecture : freebsd:10:* Prefix : /usr/local Categories : perl5 net ipv6 dns Licenses : MIT Maintainer : perl@FreeBSD.org WWW : http://search.cpan.org/dist/Net-DNS/ Comment : Perl5 interface to the DNS resolver, and dynamic updates Options : GOST : off IDN : on IPV6 : on SSHFP : on Annotations : Flat size : 827KiB Description : Net::DNS is a collection of Perl modules to interface with the Domain Name System (DNS) resolver. It allows the programmer to perform queries that are beyond the capabilities of gethostbyname and gethostbyaddr. There are also methods for dealing with creating and parsing dynamic updates packets. WWW: http://search.cpan.org/dist/Net-DNS/ [ph@lrrr ~]$ pkg info perl5 perl5-5.20.2_5 Name : perl5 Version : 5.20.2_5 Installed on : Wed Jul 1 22:23:26 CEST 2015 Origin : lang/perl5.20 Architecture : freebsd:10:x86:64 Prefix : /usr/local Categories : perl5 lang devel Licenses : GPLv1 or ART10 Maintainer : perl@FreeBSD.org WWW : http://www.perl.org/ Comment : Practical Extraction and Report Language Options : DEBUG : off GDBM : off MULTIPLICITY : on PERL_64BITINT : on PERL_MALLOC : off PTHREAD : on SITECUSTOMIZE : off THREADS : on Shared Libs provided: libperl.so.5.20 Annotations : cpe : cpe:2.3:a:perl:perl:5.20.2:::::freebsd10:x64:5 Flat size : 49.0MiB Description : Perl is a language that combines some of the features of C, sed, awk and shell. See the manual page for more hype. There are also many books published by O'Reilly & Assoc. See pod/perlbook.pod for more information. WWW: http://www.perl.org/
Assign correctly. Note: using "category/port" in issue titles will automatically assign issues and/or add cc to the respective port maintainers.
Seems like this bug is something that's been identified many years ago by the Debian project, https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=752845#45
Created attachment 159121 [details] patch Here's an attempt to patch this. Can someone who uses postfix and this port test if it works ?
(In reply to Kurt Jaeger from comment #3) Thanks for the patch. I did already try that though. According to the log entry from policyd-weight it seems that the new API doesn't return needed data. Jul 23 21:37:30 <mail.info> lrrr postfix/policyd-weight[87034]: decided action=PREPEND X-policyd-weight: passed - too many local DNS-errors in bl.spamcop. net lookups; <client=e-mailfilter02.sunet.se[192.36.171.202]> <helo=e-mailfilter02.sunet.se> <from=echo-reply@sunet.se> <to=XXXX@YYYYY.ZZ>; delay: 13s
(In reply to Patrik Hildingsson from comment #4) Here's a debug run of policyd-weight with the new API 22:04:16 info: child: spawned Use of uninitialized value $action in string eq at /usr/local/bin/policyd-weight line 1505, <GEN7> line 1. Use of uninitialized value $action in string eq at /usr/local/bin/policyd-weight line 1505, <GEN7> line 2. Use of uninitialized value $action in string eq at /usr/local/bin/policyd-weight line 1505, <GEN7> line 3. Use of uninitialized value $action in string eq at /usr/local/bin/policyd-weight line 1505, <GEN7> line 4. Use of uninitialized value $action in string eq at /usr/local/bin/policyd-weight line 1505, <GEN7> line 5. Use of uninitialized value $action in string eq at /usr/local/bin/policyd-weight line 1505, <GEN7> line 6. Use of uninitialized value $action in string eq at /usr/local/bin/policyd-weight line 1505, <GEN7> line 7. Use of uninitialized value $action in string eq at /usr/local/bin/policyd-weight line 1505, <GEN7> line 8. Use of uninitialized value $action in string eq at /usr/local/bin/policyd-weight line 1505, <GEN7> line 9. Use of uninitialized value $action in string eq at /usr/local/bin/policyd-weight line 1505, <GEN7> line 10. Use of uninitialized value $action in string eq at /usr/local/bin/policyd-weight line 1505, <GEN7> line 11. Use of uninitialized value $action in string eq at /usr/local/bin/policyd-weight line 1505, <GEN7> line 12. Use of uninitialized value $action in string eq at /usr/local/bin/policyd-weight line 1505, <GEN7> line 13. Use of uninitialized value $action in string eq at /usr/local/bin/policyd-weight line 1505, <GEN7> line 14. Use of uninitialized value $action in string eq at /usr/local/bin/policyd-weight line 1505, <GEN7> line 15. Use of uninitialized value $action in string eq at /usr/local/bin/policyd-weight line 1505, <GEN7> line 16. Use of uninitialized value $action in string eq at /usr/local/bin/policyd-weight line 1505, <GEN7> line 17. Use of uninitialized value $action in string eq at /usr/local/bin/policyd-weight line 1505, <GEN7> line 18. Use of uninitialized value $action in string eq at /usr/local/bin/policyd-weight line 1505, <GEN7> line 19. Use of uninitialized value $action in string eq at /usr/local/bin/policyd-weight line 1505, <GEN7> line 20. Use of uninitialized value $action in string eq at /usr/local/bin/policyd-weight line 1505, <GEN7> line 21. Use of uninitialized value $action in string eq at /usr/local/bin/policyd-weight line 1505, <GEN7> line 22. Use of uninitialized value $action in string eq at /usr/local/bin/policyd-weight line 1505, <GEN7> line 23. Use of uninitialized value $action in string eq at /usr/local/bin/policyd-weight line 1505, <GEN7> line 24. Use of uninitialized value $action in string eq at /usr/local/bin/policyd-weight line 1505, <GEN7> line 25. 22:04:16 warning: cache_query: $csock couln't be created: connect: No such file or directory, calling spawn_cache() 22:04:16 info: rbl_lookup: sending: 202.171.36.192.pbl.spamhaus.org, 28523 22:04:16 info: cache spawned 22:04:16 info: cache: PTIME: 10800, TEMP_PTIME: 86400 22:04:16 info: rbl_lookup: dropped: out:202.171.36.192.pbl.spamhaus.org vs in:Net::DNS::DomainName=HASH(0x80461d780), out:28523 vs in:28523 22:04:18 info: rbl_lookup: sending: 202.171.36.192.pbl.spamhaus.org, 28523 22:04:18 info: rbl_lookup: dropped: out:202.171.36.192.pbl.spamhaus.org vs in:Net::DNS::DomainName=HASH(0x804607e70), out:28523 vs in:28523 22:04:20 info: rbl_lookup: sending: 202.171.36.192.pbl.spamhaus.org, 28523 22:04:20 info: rbl_lookup: dropped: out:202.171.36.192.pbl.spamhaus.org vs in:Net::DNS::DomainName=HASH(0x80461db58), out:28523 vs in:28523 22:04:20 info: rbl_lookup: sending: 202.171.36.192.sbl-xbl.spamhaus.org, 12964 22:04:20 info: rbl_lookup: dropped: out:202.171.36.192.sbl-xbl.spamhaus.org vs in:Net::DNS::DomainName=HASH(0x804607e70), out:12964 vs in:12964 22:04:22 info: rbl_lookup: sending: 202.171.36.192.sbl-xbl.spamhaus.org, 12964 22:04:22 info: rbl_lookup: dropped: out:202.171.36.192.sbl-xbl.spamhaus.org vs in:Net::DNS::DomainName=HASH(0x8045fd0a8), out:12964 vs in:12964 22:04:24 info: rbl_lookup: sending: 202.171.36.192.sbl-xbl.spamhaus.org, 12964 22:04:24 info: rbl_lookup: dropped: out:202.171.36.192.sbl-xbl.spamhaus.org vs in:Net::DNS::DomainName=HASH(0x804607e40), out:12964 vs in:12964 22:04:24 info: rbl_lookup: sending: 202.171.36.192.bl.spamcop.net, 19781 22:04:24 info: rbl_lookup: dropped: out:202.171.36.192.bl.spamcop.net vs in:Net::DNS::DomainName=HASH(0x8045fd0a8), out:19781 vs in:19781 22:04:26 info: rbl_lookup: sending: 202.171.36.192.bl.spamcop.net, 19781 22:04:26 info: rbl_lookup: dropped: out:202.171.36.192.bl.spamcop.net vs in:Net::DNS::DomainName=HASH(0x8045fd708), out:19781 vs in:19781 22:04:28 info: rbl_lookup: sending: 202.171.36.192.bl.spamcop.net, 19781 22:04:28 info: rbl_lookup: dropped: out:202.171.36.192.bl.spamcop.net vs in:Net::DNS::DomainName=HASH(0x80461d780), out:19781 vs in:19781 22:04:28 info: decided action=PREPEND X-policyd-weight: passed - too many local DNS-errors in bl.spamcop.net lookups; <instance=157bf.55b148c0.55fe9.0> <c lient=e-mailfilter02.sunet.se[192.36.171.202]> <helo=e-mailfilter02.sunet.se> <from=echo-reply@sunet.se> <to=XXXX@YYYYYY.ZZ>; delay: 12s
Why don't take ready patch and use it? http://bazaar.launchpad.net/~ubuntu-branches/debian/sid/policyd-weight/sid/view/head:/debian/patches/10_replace_net_dns_dn_expand.patch moreover it's really fun to use such outdated software. Instead of find and use modern ones, everyone prefer to be necromancers. Araise a dead piece of the perl code!
(In reply to Andrej Zverev from comment #6) I don't think that dn_expand_PP() is available in Net-DNS 1.01. I did try look for that earlier in the module, without success. Are you suggesting replacing policyd-weight?
(In reply to Patrik Hildingsson from comment #7) Can you in this case try to patch it like this (by hand): #my ($dn, $offset) = Net::DNS::Packet::dn_expand(\$qb, 0); my ($decoded, $offset) = decode Net::DNS::DomainName(\$qb); my $dn = $decoded->name; And yes, if this outdated tool can be replaced this is should be done.
(In reply to Andrej Zverev from comment #8) I can confirm that it works now with your patch. Thank you Andrej and everyone involved. I will start to look at replacement software though, such as postscreen(8).
(In reply to Patrik Hildingsson from comment #9) If you need some complex solution, try look at http://rspamd.com And thank you for testing.
(In reply to Andrej Zverev from comment #10) Please commit or mark port (postfix-policyd-weight) broken?
A commit references this bug: Author: ohauer Date: Sun Sep 27 11:47:12 UTC 2015 New revision: 398039 URL: https://svnweb.freebsd.org/changeset/ports/398039 Log: - fix with latest NET::DNS - re-assign Maintainer to ports@ (I do no longer use this port) PR: 201753 Submitted by: Patrik Hildingsson, pi@ Changes: head/mail/postfix-policyd-weight/Makefile head/mail/postfix-policyd-weight/files/patch-policyd-weight
A commit references this bug: Author: pi Date: Fri Dec 11 21:14:28 UTC 2015 New revision: 403560 URL: https://svnweb.freebsd.org/changeset/ports/403560 Log: mail/postfix-policyd-weight: Fix with new Net::DNS version - Fix bug that re-appeared after Net::DNS was updated to most recent version PR: 201753, 205253 Submitted by: Herbert J. Skuhra <h.skuhra@gmail.com> Changes: head/mail/postfix-policyd-weight/Makefile head/mail/postfix-policyd-weight/files/patch-policyd-weight