Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 538902 - mail-filter/policyd-weight-0.1.15.2-r1 - Warning: child: err: Undefined subroutine &main::dn_expand called at /usr/libexec/postfix/policyd-weight line
Summary: mail-filter/policyd-weight-0.1.15.2-r1 - Warning: child: err: Undefined subro...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 2 votes (vote)
Assignee: Net-Mail Packages
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2015-02-05 09:29 UTC by Joerg Neikes
Modified: 2018-01-23 09:46 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
10_replace_net_dns_dn_expand.patch (10_replace_net_dns_dn_expand.patch,680 bytes, patch)
2015-02-05 09:34 UTC, Joerg Neikes
Details | Diff
10_replace_net_dns_dn_expand Net-DNS version 1.40 (10_replace_net_dns_dn_expand.patch,691 bytes, patch)
2016-04-18 09:11 UTC, Joerg Neikes
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joerg Neikes 2015-02-05 09:29:21 UTC
I just put the right solution here.
Debian only uses a quick fix that works.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=752845#50
Message #50 received at 752845@bugs.debian.org (full text, mbox, reply):
From: Werner Detter <werner@aloah-from-hell.de>
To: Willem Toorop <willem@nlnetlabs.nl>, 752845@bugs.debian.org
Subject: Re: Bug#752845: decode Net::DNS::DomainName
Date: Wed, 02 Jul 2014 20:57:35 +0200

Hi Willem, 

thanks for your answer/reply on this issue and pointing out the "offical"
replacement for "dn_expand()". In the long run it probably would make sense
using Net::DNS::DomainName::decode but this requires some more changes to 
policyd-weight. I've replaced obsolete "dh_expand()" function with 
"Net::DNS::Packet::dn_expand_PP()" which fixes problems in policyd-weight
for the latest libnet-dns-perl package.

Cheers,
Werner




Reproducible: Always

Steps to Reproduce:
1. start policyd
2. start postfix include 
3. get the:
mail postfix/policyd-weight[pid]: warning: child: err: Undefined subroutine &main::dn_expand called at /usr/libexec/postfix/policyd-weight line 3591, <GEN19> line 23.


Expected Results:  
Works without error.

Patch from debian added in manually.

http://launchpadlibrarian.net/179887012/policyd-weight_0.1.15.2-7_0.1.15.2-8.diff.gz
Comment 1 Joerg Neikes 2015-02-05 09:34:11 UTC
Created attachment 395576 [details, diff]
10_replace_net_dns_dn_expand.patch

Added the patch from debian to the running version.
Comment 2 Kim B. Sindalsen 2015-04-13 18:19:49 UTC
I just encountered this after a reboot of my server.
([policyd-weight] warning: child: err: Undefined subroutine &main::dn_expand called at /usr/libexec/postfix/policyd-weight line 3591, <GEN25> line 27._)

Seems like the patch does fix the issue.


Perl v5.20.2
perl-core/libnet 1.270.0
dev-perl/Net-DNS 0.740.0
policyd-weight 0.1.15.2-r1
Comment 3 Stefan Briesenick (RETIRED) gentoo-dev 2015-06-11 13:36:31 UTC
ping. please fix.
Comment 4 Stefan Briesenick (RETIRED) gentoo-dev 2015-06-15 12:04:33 UTC
I would like to add another issue, which could be fixed within a revbump:

please comment out or remove this line in /etc/policyd-weight.conf

#   'rhsbl.ahbl.org',              4,        0,        'AHBL',

ahbl.org is down but answers every request with "true". So you will have all Mails marked as spam... :-/
Comment 5 Joerg Neikes 2015-12-30 16:24:07 UTC
Now same thing with dev-perl/Net-DNS-1.40.0.ebuild

No *dn_expand* in
/usr/lib64/perl5/vendor_perl/5.22.1/x86_64-linux/Net/DNS/Packet.pm

Please use 

emerge =dev-perl/Net-DNS-0.810.0

and all works again.


Seems the 1.40 must be blocked to work with policyd-weight.
Comment 6 Joerg Neikes 2015-12-30 16:28:24 UTC

echo "=dev-perl/Net-DNS-1.40" >> /etc/portage/package.mask
Comment 7 Sven Wehner 2016-04-09 19:16:41 UTC
Please note that, as of April 2nd, Net-DNS-1.40.0 became stable on all architectures, and on the same day the old version has been removed.

Extract from ${PORTDIR}/dev-perl/Net-DNS/ChangeLog:
--- snip ---
  02 Apr 2016; Agostino Sarubbo <ago@gentoo.org> Net-DNS-1.40.0.ebuild:
  alpha/amd64/arm/hppa/ia64/ppc64/ppc/sparc/x86 stable, (ALLARCHES policy) wrt
  bug #578652
  [...]

  02 Apr 2016; Andreas K. Hüttel <dilfridge@gentoo.org>
  -Net-DNS-0.740.0.ebuild, -files/Net-DNS-0.64-ar.patch,
  -files/Net-DNS-0.68-ar.patch:
  Remove old
  [...]
--- snap ---

This might make Joerg Neikes' last two comments obsolete, because there is only version 1.40.0.

I read the provided patch and checked Net-DNS source code, but found that even the "new" "dn_expand_PP()" seems to be removed as well.
Use the following command to view the changes of revision 1186:
  svn diff -r 1186 "http://www.net-dns.org/svn/net-dns/trunk/lib/Net/DNS/Packet.pm"
The output includes:
--- snip ---
-sub dn_expand {
[...]
-}
-
-sub dn_expand_PP {
[...]
-}
--- snap ---
So the Net-DNS authors removed both methods...
(Please note that Gentoo's 1.40 seems to be the official version 1.04, revision 1442.)

Could anyone, who has been using it, please check if the patch attached by Joerg Neikes still works? Thanks in advance!


Regarding another solution:
On https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=752845 Willem Toorop writes that "Net::DNS::DomainName::decode is the 'official' replacement for
Net::DNS::Packet::dn_expand". To which Werner Detter replied: "In the long run it probably would make sense using Net::DNS::DomainName::decode but this requires some more changes to policyd-weight."
Comment 8 Joerg Neikes 2016-04-18 09:11:31 UTC
Created attachment 431096 [details, diff]
10_replace_net_dns_dn_expand Net-DNS version 1.40

Patch from debian 1.5.2-11 Version used:

https://sources.debian.net/src/policyd-weight/0.1.15.2-11/debian/patches/10_replace_net_dns_dn_expand.patch/

Fix to be used with version =dev-perl/Net-DNS-1.40.0.

Thanks to James Cloos and Werner Detter.
Comment 9 Joerg Neikes 2016-04-18 09:34:02 UTC
(In reply to Joerg Neikes from comment #8)
> Created attachment 431096 [details, diff] [details, diff]
> 10_replace_net_dns_dn_expand Net-DNS version 1.40
> 
> Patch from debian 1.5.2-11 Version used:
> 
> https://sources.debian.net/src/policyd-weight/0.1.15.2-11/debian/patches/
> 10_replace_net_dns_dn_expand.patch/
> 
> Fix to be used with version =dev-perl/Net-DNS-1.40.0.
> 
> Thanks to James Cloos and Werner Detter.

New patch works for me.
Mails are working after restart with:

=mail-filter/policyd-weight-0.1.15.2-r1
=dev-perl/Net-DNS-1.40.0

(It could be interesting to apply the other patches as wall but this is out of topic.)

Regards,

Joeg
Comment 10 Tomasz Bielaszewski 2016-04-27 14:27:04 UTC
(In reply to Joerg Neikes from comment #9)
> (In reply to Joerg Neikes from comment #8)
> > Created attachment 431096 [details, diff] [details, diff] [details, diff]
> > 10_replace_net_dns_dn_expand Net-DNS version 1.40
> > 
> > Patch from debian 1.5.2-11 Version used:
> > 
> > https://sources.debian.net/src/policyd-weight/0.1.15.2-11/debian/patches/
> > 10_replace_net_dns_dn_expand.patch/
> > 
> > Fix to be used with version =dev-perl/Net-DNS-1.40.0.
> > 
> > Thanks to James Cloos and Werner Detter.
> 
> New patch works for me.
> Mails are working after restart with:
> 
> =mail-filter/policyd-weight-0.1.15.2-r1
> =dev-perl/Net-DNS-1.40.0
> 
> (It could be interesting to apply the other patches as wall but this is out
> of topic.)
> 
> Regards,
> 
> Joeg

I'd like to confirm that the bug exists and that this patch works for me as well.
I'd like to see this pushed to portage quickly, because without it the package is unusable.

Regars,

Tomek
Comment 11 Kim B. Sindalsen 2016-05-05 11:11:19 UTC
Confirming new patch works for Net-DNS version 1.40.
Comment 12 Stefan Briesenick (RETIRED) gentoo-dev 2016-07-12 14:35:34 UTC
PING!

please add this patch asap. Old Net::DNS is not in portage anymore, so this one is fully broken.
Comment 13 Stefan Briesenick (RETIRED) gentoo-dev 2016-11-04 11:51:23 UTC
PING again.

this bug hurts. Please fix. thanks!

btw: Debian (jessie) has further fixes. It would be nice to just grab the Debian patches and include them.

https://packages.debian.org/de/jessie/policyd-weight
http://http.debian.net/debian/pool/main/p/policyd-weight/policyd-weight_0.1.15.2-10.debian.tar.xz
Comment 14 Krzysztof Tomczyk 2018-01-23 06:40:50 UTC
PING one more time
 10_replace_net_dns_dn_expand.patch - this patch works! Could someone add it to ebuild. It's really hurting on reinstall of policyd-weight. Thanks
Comment 15 Larry the Git Cow gentoo-dev 2018-01-23 09:46:23 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bedf62d073373d69db75bc352380f84ca898403c

commit bedf62d073373d69db75bc352380f84ca898403c
Author:     Thomas Deutschmann <whissi@gentoo.org>
AuthorDate: 2018-01-23 09:45:48 +0000
Commit:     Thomas Deutschmann <whissi@gentoo.org>
CommitDate: 2018-01-23 09:46:01 +0000

    mail-filter/policyd-weight: Rev bump
    
    Ebuild changes:
    ===============
    - We are now using similar patch set like Debian.
    
    - EAPI bumped to EAPI=6.
    
    Closes: https://bugs.gentoo.org/536580
    Closes: https://bugs.gentoo.org/538902
    Package-Manager: Portage-2.3.20, Repoman-2.3.6

 mail-filter/policyd-weight/Manifest                |  1 +
 .../policyd-weight/files/policyd-weight.init.d-r2  | 31 ++++++++++++
 .../policyd-weight/files/policyd-weight.tmpfile    |  1 +
 .../policyd-weight-0.1.15.2-r2.ebuild              | 59 ++++++++++++++++++++++
 4 files changed, 92 insertions(+)