Problem with installing Perl modules for SpamAssassin

hansmiddelhoek

Verified User
Joined
Apr 26, 2005
Messages
40
Location
Netherlands
We always install the required Perl modules for SPamAssassin with cpan, according to http://help.directadmin.com/item.php?id=36 In Debian 8.0 I had trouble getting it to work. It was because of 2 modules, Mail::SPF and LWP::protocol::https (I'm not sure if this is required for SpamAssassin to be honest, maybe it's a dependency of another module, but we explicitly installed it).

Error for Mail::SPF
Code:
Running install for module 'Mail::SPF'
Checksum for /root/.cpan/sources/authors/id/J/JM/JMEHNLE/mail-spf/Mail-SPF-v2.9.0.tar.gz ok
Configuring J/JM/JMEHNLE/mail-spf/Mail-SPF-v2.9.0.tar.gz with Build.PL
Created MYMETA.yml and MYMETA.json
Creating new 'Build' script for 'Mail-SPF' version 'v2.9.0'
  JMEHNLE/mail-spf/Mail-SPF-v2.9.0.tar.gz
  /usr/bin/perl Build.PL --installdirs site -- OK
Running Build for J/JM/JMEHNLE/mail-spf/Mail-SPF-v2.9.0.tar.gz
Building Mail-SPF
  JMEHNLE/mail-spf/Mail-SPF-v2.9.0.tar.gz
  ./Build -- OK
Running Build test
t/00.00-class-misc.t .......... ok
t/00.01-class-util.t .......... ok
t/00.02-class-request.t ....... ok
t/00.03-class-result.t ........ ok
t/00.04-class-server.t ........ 1/23 Unknown error on DNS 'A' lookup of 'example.com' (EDNSError) at /root/.cpan/build/Mail-SPF-v2.9.0-uqkllj/blib/lib/Mail/SPF/Server.pm line 573.
# Looks like you planned 23 tests but ran 19.
# Looks like your test exited with 255 just after 19.
t/00.04-class-server.t ........ Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 4/23 subtests
t/00.05-class-macrostring.t ... ok
t/00.99-class-misc.t .......... ok
t/10.00-rfc4408.t ............. # Test case 'helo-domain-literal' result:
# Expected: 'none'
#      Got: 'temperror'
t/10.00-rfc4408.t ............. 1/344
#   Failed test 'Test case 'helo-domain-literal' result'
#   at t/Mail-SPF-Test-lib.pm line 91.
domain label truncated at /usr/local/lib/x86_64-linux-gnu/perl/5.20.2/Net/DNS/Question.pm line 80.
# Test case 'toolonglabel' result:
# Expected: 'none'
#      Got: 'temperror'

#   Failed test 'Test case 'toolonglabel' result'
#   at t/Mail-SPF-Test-lib.pm line 91.
# Test case description: DNS labels limited to 63 chars.
# Test case 'nolocalpart' result:
# Expected: 'fail'
#      Got: 'temperror'

#   Failed test 'Test case 'nolocalpart' result'
#   at t/Mail-SPF-Test-lib.pm line 91.
# Test case 'longlabel' result:
# Expected: 'fail'
#      Got: 'temperror'

#   Failed test 'Test case 'longlabel' result'
#   at t/Mail-SPF-Test-lib.pm line 91.
# Test case description: DNS labels limited to 63 chars.
Bailout called.  Further testing stopped:  Uncaught error: empty domain label at /usr/local/share/perl/5.20.2/Error.pm line 40.
FAILED--Further testing stopped: Uncaught error: empty domain label at /usr/local/share/perl/5.20.2/Error.pm line 40.
  JMEHNLE/mail-spf/Mail-SPF-v2.9.0.tar.gz
  ./Build test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports JMEHNLE/mail-spf/Mail-SPF-v2.9.0.tar.gz

And for LWP:protocol:https
Code:
PERL_DL_NONLAZY=1 "/usr/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/apache.t ....... 1/5
#   Failed test at t/apache.t line 15.

#   Failed test at t/apache.t line 18.
#                   'Can't connect to www.apache.org:443 (certificate verify failed)
#
# LWP::Protocol::https::Socket: SSL connect attempt failed error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed at /usr/local/share/perl/5.20.2/LWP/Protocol/http.pm line 47.
# '
#     doesn't match '(?^:Apache Software Foundation)'
t/apache.t ....... 4/5 # Looks like you failed 2 tests of 5.
t/apache.t ....... Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/5 subtests
t/https_proxy.t .. 1/56 # creating cert for direct.ssl.access
# creating cert for direct.ssl.access
# creating cert for foo
# creating cert for bar
# creating cert for foo
# creating cert for foo
# creating cert for bar
# creating cert for bar
t/https_proxy.t .. ok

Test Summary Report
-------------------
t/apache.t     (Wstat: 512 Tests: 5 Failed: 2)
  Failed tests:  1, 3
  Non-zero exit status: 2
Files=2, Tests=61,  3 wallclock secs ( 0.06 usr  0.00 sys +  0.96 cusr  0.06 csys =  1.08 CPU)
Result: FAIL
Failed 1/2 test programs. 2/61 subtests failed.
Makefile:854: recipe for target 'test_dynamic' failed
make: *** [test_dynamic] Error 255
  MSCHILLI/LWP-Protocol-https-6.06.tar.gz
  /usr/bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports MSCHILLI/LWP-Protocol-https-6.06.tar.gz

I could install both by entering the cpan shell and install the modules with notest argument:
[cdoe]
# cpan
Terminal does not support AddHistory.

cpan shell -- CPAN exploration and modules installation (v2.05)
Enter 'h' for help.

cpan[1]> notest install LWP::protocol::https

cpan[1]> notest install Mail::SPF
[/code]

I'm not sure (yet) if SpamAssassin runs without problems. It could be installed without problems but maybe some tests will fail.
 
Hello,

I guess you may ignore the failed tests:

...
Can't connect to www.apache.org:443 (certificate verify failed)
Unknown error on DNS 'A' lookup of 'example.com'
...
 
Yes, I think so too, but the module didn't get installed. Therefore I needed to install it with notest parameter. At first I thought it had something to do with internet connectivity or DNS, but everything is fine, I can reach different site all over the world and DNS is working fine. We didn't have this problem with Debian 7 (wheezy).
 
I did not have a chance to work with Debian 8 as of yet. So I don't have anything to add.
But I do confirm I had no those issues with Debian 6, 7 the same as you.
 
Tristan. This probably also has to do with issues in NET::DNS versions of CPAN. The issue is occuring with versions from above somethingn like 0.78 and is only fixed in version 1.04.
 
Thanks Richard, already running Net-DNS-1.04 over here though. Thinking now it might also be fixed by downgrading to the stock Debian version?
 
Can't help you there. I'm not running Debian so I don't know if it might be fixed in stock versions.
 
I recently installed a Debian 7 box and with these packages you don't need to bother with any cpan stuff

apt-get install libhttp-date-perl libnetaddr-ip-perl libnet-dns-perl libhtml-parser-perl libdigest-sha1-perl perl-base perl-modules
 
That might be a way more elegant solution Arieh, maybe time to update:

http://help.directadmin.com/item.php?id=36

for Debian users? According to Debian, these are the suggested perl library packages for SpamAssassin 3.4.1 in Debian testing:
Code:
libarchive-tar-perl
libhtml-parser-perl
libhttp-date-perl
libnet-dns-perl
libnetaddr-ip-perl
libsocket6-perl
libsys-hostname-long-perl
libwww-perl
libio-socket-inet6-perl
libmail-spf-perl
libsys-syslog-perl
libcompress-zlib-perl
libdbi-perl
libencode-detect-perl
libio-socket-ssl-perl
libmail-dkim-perl

So for Debian 8 it would be:
Code:
apt-get install libhtml-parser-perl libhttp-date-perl libnet-dns-perl libnetaddr-ip-perl libsocket6-perl libsys-hostname-long-perl libwww-perl libio-socket-inet6-perl libmail-spf-perl libsys-syslog-perl libdbi-perl libencode-detect-perl libio-socket-ssl-perl libmail-dkim-perl razor libio-socket-ip-perl libnet-patricia-perl

For Debian 7 it would be:
Code:
apt-get install libarchive-tar-perl libhtml-parser-perl libhttp-date-perl libnet-dns-perl libnetaddr-ip-perl libsocket6-perl libsys-hostname-long-perl libwww-perl libio-socket-inet6-perl libmail-spf-perl libsys-syslog-perl libcompress-zlib-perl libdbi-perl libencode-detect-perl libio-socket-ssl-perl libmail-dkim-perl razor libio-socket-ip-perl libcompress-zlib-perl libnet-patricia-perl

And for Debian 6:
Code:
apt-get install libarchive-tar-perl libhtml-parser-perl libnet-dns-perl libnetaddr-ip-perl libsocket6-perl libsys-hostname-long-perl libwww-perl libio-socket-inet6-perl libmail-spf-perl libsys-syslog-perl libcompress-zlib-perl libdbi-perl libencode-detect-perl libio-socket-ssl-perl libmail-dkim-perl razor libcompress-zlib-perl libnet-patricia-perl
 
Last edited:
Installing a new Debian 7, I needed to do the line for Debian 8. I guess things are updated for Debian 7 or something.
 
Back
Top