Unable to setup spamassassin

xuancong6000

Verified User
Joined
Oct 12, 2012
Messages
79
I try to enable spamassassin from this link: http://help.directadmin.com/item.php?id=36 but I can't
It had an error:
Code:
[root@server ~]# cd /usr/local/directadmin/scripts
[root@server scripts]# ./spam.sh
File already exists:    Mail-SpamAssassin-3.3.2.tar.gz
Can't locate ExtUtils/MakeMaker.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at Makefile.PL line 8.
BEGIN failed--compilation aborted at Makefile.PL line 8.
make: *** No targets specified and no makefile found.  Stop.
make: *** No rule to make target `install'.  Stop.
Cannot find /usr/bin/sa-update after install. Check for errors above.


Cannot find /usr/bin/spamd.  Check above for errors or missing perl modules.
If needed, use cpan to install the missing modules, eg:
  cpan -i Archive::Tar Digest::SHA Mail::SPF IP::Country Net::Ident IO::Socket::INET6 Compress::Zlib Mail::DKIM LWP::UserAgent HTTP::Date Encode::Detect ExtUtils::MakeMaker NetAddr::IP Mail::SpamAssassin::Plugin::Razor2 Razor2::Client::Agent IO::Socket::SSL DBI

Press enter to answer [yes] if it asks you to install dependencies (it will prepend them to the queue)
Answer no if it asks: Are you ready for manual configuration? [yes] no

[root@server scripts]# export PERL_EXTUTILS_AUTOINSTALL="--defaultdeps"
[root@server scripts]# cpan -i Archive::Tar Digest::SHA Mail::SPF IP::Country Net::Ident IO::Socket::INET6 Compress::Zlib Mail::DKIM LWP::UserAgent HTTP::Date Encode::Detect ExtUtils::MakeMaker NetAddr::IP Mail::SpamAssassin::Plugin::Razor2 Razor2::Client::Agent IO::Socket::SSL DBI
-bash: cpan: command not found
could you help me fix it thanks
 
The article you linked to is outdated regarding some things. You shold instead install SpamAssassin with Custombuild, the other things in the article you can do.

Custombuild 1.1 and 1.2 FAQ: http://www.directadmin.com/forum/showthread.php?t=29824

CustomBuild 2.0 FAQ: http://www.directadmin.com/forum/showthread.php?t=44743

To install SpamAssassin using custombuild, you do this:

First edit this file: /usr/local/directadmin/options.conf - change spamassassin=no to be spamassassin=yes

Then do this:
Code:
cd /usr/local/directadmin/custombuild
./build update
./build spamassassin
 
The article you linked to is outdated regarding some things. You shold instead install SpamAssassin with Custombuild, the other things in the article you can do.

Custombuild 1.1 and 1.2 FAQ: http://www.directadmin.com/forum/showthread.php?t=29824

CustomBuild 2.0 FAQ: http://www.directadmin.com/forum/showthread.php?t=44743

To install SpamAssassin using custombuild, you do this:

First edit this file: /usr/local/directadmin/options.conf - change spamassassin=no to be spamassassin=yes

Then do this:
Code:
cd /usr/local/directadmin/custombuild
./build update
./build spamassassin
I do that but it error:
Code:
[root@server custombuild]# ./build spamassassin
File already exists:    Mail-SpamAssassin-3.3.2.tar.gz
MD5 Checksum on Mail-SpamAssassin-3.3.2.tar.gz passed.
Installing spamassassin 3.3.2...
Found /usr/local/directadmin/custombuild/Mail-SpamAssassin-3.3.2.tar.gz
Extracting ...
Done.
Configuring SpamAssassin 3.3.2...
NOTE: settings for "make test" are now controlled using "t/config.dist". 
See that file if you wish to customise what tests are run, and how.

checking module dependencies and their versions...

***************************************************************************
ERROR: the required Net::DNS module is not installed,
minimum required version is 0.34.

  Used for all DNS-based tests (SBL, XBL, SpamCop, DSBL, etc.),
  perform MX checks, and is also used when manually reporting spam to
  SpamCop.

  You need to make sure the Net::DNS version is sufficiently up-to-date:

  - version 0.34 or higher on Unix systems
  - version 0.46 or higher on Windows systems


***************************************************************************
ERROR: the required NetAddr::IP module is not installed,
minimum required version is 4.000.

  Used in determining which DNS tests are to be done for each of
  the header's received fields, and used by AWL plugin for extracting network
  address from an IPv6 addresses (and from IPv4 address on nondefault mask).


***************************************************************************
ERROR: the required Archive::Tar module is not installed,
minimum required version is 1.23.

  The "sa-update" program requires this module to access tar update
  archive files.


***************************************************************************
ERROR: the required IO::Zlib module is not installed,
minimum required version is 1.04.

  The "sa-update" program requires this module to access compressed
  update archive files.


***************************************************************************
NOTE: the optional Digest::SHA1 module is not installed.

  The Digest::SHA1 module is required by the Razor2 plugin.


***************************************************************************
NOTE: the optional Mail::SPF module is not installed.

  Used to check DNS Sender Policy Framework (SPF) records to fight email
  address forgery and make it easier to identify spams.


***************************************************************************
NOTE: the optional IP::Country module is not installed.

  Used by the RelayCountry plugin (not enabled by default) to determine
  the domain country codes of each relay in the path of an email.


***************************************************************************
NOTE: the optional Razor2 module is not installed,
minimum required version is 2.61.

  Used to check message signatures against Vipul's Razor collaborative
  filtering network. Razor has a large number of dependencies on CPAN
  modules. Feel free to skip installing it, if this makes you nervous;
  SpamAssassin will still work well without it.

  More info on installing and using Razor can be found
  at http://wiki.apache.org/spamassassin/InstallingRazor .


***************************************************************************
NOTE: the optional Net::Ident module is not installed.

  If you plan to use the --auth-ident option to spamd, you will need
  to install this module.


***************************************************************************
NOTE: the optional IO::Socket::INET6 module is not installed.

  This is required if the first nameserver listed in your IP
  configuration or /etc/resolv.conf file is available only via an
  IPv6 address. Also used by a DCC plugin to access dccifd over network.


***************************************************************************
NOTE: the optional IO::Socket::SSL module is not installed.

  If you wish to use SSL encryption to communicate between spamc and
  spamd (the --ssl option to spamd), you need to install this
  module. (You will need the OpenSSL libraries and use the
  ENABLE_SSL="yes" argument to Makefile.PL to build and run an SSL
  compatibile spamc.)


***************************************************************************
NOTE: the optional Mail::DKIM module is not installed,
minimum required version is 0.31, recommended version is 0.37 or higher.

  If this module is installed and the DKIM plugin is enabled,
  SpamAssassin will perform DKIM signature verification when DKIM-Signature
  header fields are present in the message headers, and check ADSP rules
  (e.g. anti-phishing) when a mail message does not contain a valid author
  domain signature. Version 0.37 or later is needed to fully support ADSP.


***************************************************************************
NOTE: the optional DBI module is not installed.

  If you intend to use SpamAssassin with an SQL database backend for
  user configuration data, Bayes storage, or other storage, you will need
  to have these installed; both the basic DBI module and the DBD driver for
  your database.


***************************************************************************
NOTE: the optional Encode::Detect module is not installed.

  If you plan to use the normalize_charset config setting to detect
  charsets and convert them into Unicode, you will need to install
  this module.

REQUIRED module missing: Net::DNS
REQUIRED module missing: NetAddr::IP
REQUIRED module missing: Archive::Tar
REQUIRED module missing: IO::Zlib
optional module missing: Digest::SHA1
optional module missing: Mail::SPF
optional module missing: IP::Country
optional module missing: Razor2
optional module missing: Net::Ident
optional module missing: IO::Socket::INET6
optional module missing: IO::Socket::SSL
optional module missing: Mail::DKIM
optional module missing: DBI
optional module missing: Encode::Detect

warning: some functionality may not be available,
please read the above report before continuing!

Done Configuration.
Trying to make SpamAssassin...
make: *** No targets specified and no makefile found.  Stop.

If needed, use cpan to install the missing modules, eg:
  cpan -i Archive::Tar Digest::SHA Mail::SPF IP::Country Net::Ident IO::Socket::INET6 Compress::Zlib Mail::DKIM LWP::UserAgent HTTP::Date Encode::Detect ExtUtils::MakeMaker

Press enter to answer [yes] if it asks you to install dependencies (it will prepend them to the queue)
Answer no if it asks: Are you ready for manual configuration? [yes] no


*** The make has failed, would you like to try to make again? (y,n):
please help me:(
 
This seems to be the problem:

Code:
If needed, use cpan to install the missing modules, eg:
  cpan -i Archive::Tar Digest::SHA Mail::SPF IP::Country Net::Ident IO::Socket::INET6 Compress::Zlib Mail::DKIM LWP::UserAgent HTTP::Date Encode::Detect ExtUtils::MakeMaker

But I suspect you might not have installed exim too? If not, please install exim using custombuild:

Code:
cd /usr/local/directadmin/custombuild
./build exim

Then install all the missing modules. First install all of them that is available in yum, then use cpan to install the rest of them.

When your are finish installing exim and spamassassin, then edit the file etc/exim.conf and find the these lines:

Code:
#spamcheck_director:
#  driver = accept
#  condition = "${if and { \
#			{!def:h_X-Spam-Flag:} \
#			{!eq {$received_protocol}{spam-scanned}} \
#			{!eq {$received_protocol}{local}} \
#			{exists{/home/${lookup{$domain}lsearch{/etc/virtual/domainowners}{$value}}/.spamassassin/user_prefs}} \
#			{<{$message_size}{500k}} \
#		} {1}{0}}"
#  retry_use_local_part
#  transport = spamcheck
#  no_verify

Then uncomment those lines by removing # from the start of every line, and save changes. Then restart exim.
 
it still error when I finished install exim
Code:
[root@server custombuild]# ./build spamassassin
File already exists:    Mail-SpamAssassin-3.3.2.tar.gz
MD5 Checksum on Mail-SpamAssassin-3.3.2.tar.gz passed.
Installing spamassassin 3.3.2...
Found /usr/local/directadmin/custombuild/Mail-SpamAssassin-3.3.2.tar.gz
Extracting ...
Done.
Configuring SpamAssassin 3.3.2...
NOTE: settings for "make test" are now controlled using "t/config.dist". 
See that file if you wish to customise what tests are run, and how.

checking module dependencies and their versions...

***************************************************************************
ERROR: the required Net::DNS module is not installed,
minimum required version is 0.34.

  Used for all DNS-based tests (SBL, XBL, SpamCop, DSBL, etc.),
  perform MX checks, and is also used when manually reporting spam to
  SpamCop.

  You need to make sure the Net::DNS version is sufficiently up-to-date:

  - version 0.34 or higher on Unix systems
  - version 0.46 or higher on Windows systems


***************************************************************************
ERROR: the required NetAddr::IP module is not installed,
minimum required version is 4.000.

  Used in determining which DNS tests are to be done for each of
  the header's received fields, and used by AWL plugin for extracting network
  address from an IPv6 addresses (and from IPv4 address on nondefault mask).


***************************************************************************
ERROR: the required Archive::Tar module is not installed,
minimum required version is 1.23.

  The "sa-update" program requires this module to access tar update
  archive files.


***************************************************************************
ERROR: the required IO::Zlib module is not installed,
minimum required version is 1.04.

  The "sa-update" program requires this module to access compressed
  update archive files.


***************************************************************************
NOTE: the optional Digest::SHA1 module is not installed.

  The Digest::SHA1 module is required by the Razor2 plugin.


***************************************************************************
NOTE: the optional Mail::SPF module is not installed.

  Used to check DNS Sender Policy Framework (SPF) records to fight email
  address forgery and make it easier to identify spams.


***************************************************************************
NOTE: the optional IP::Country module is not installed.

  Used by the RelayCountry plugin (not enabled by default) to determine
  the domain country codes of each relay in the path of an email.


***************************************************************************
NOTE: the optional Razor2 module is not installed,
minimum required version is 2.61.

  Used to check message signatures against Vipul's Razor collaborative
  filtering network. Razor has a large number of dependencies on CPAN
  modules. Feel free to skip installing it, if this makes you nervous;
  SpamAssassin will still work well without it.

  More info on installing and using Razor can be found
  at http://wiki.apache.org/spamassassin/InstallingRazor .


***************************************************************************
NOTE: the optional Net::Ident module is not installed.

  If you plan to use the --auth-ident option to spamd, you will need
  to install this module.


***************************************************************************
NOTE: the optional IO::Socket::INET6 module is not installed.

  This is required if the first nameserver listed in your IP
  configuration or /etc/resolv.conf file is available only via an
  IPv6 address. Also used by a DCC plugin to access dccifd over network.


***************************************************************************
NOTE: the optional IO::Socket::SSL module is not installed.

  If you wish to use SSL encryption to communicate between spamc and
  spamd (the --ssl option to spamd), you need to install this
  module. (You will need the OpenSSL libraries and use the
  ENABLE_SSL="yes" argument to Makefile.PL to build and run an SSL
  compatibile spamc.)


***************************************************************************
NOTE: the optional Mail::DKIM module is not installed,
minimum required version is 0.31, recommended version is 0.37 or higher.

  If this module is installed and the DKIM plugin is enabled,
  SpamAssassin will perform DKIM signature verification when DKIM-Signature
  header fields are present in the message headers, and check ADSP rules
  (e.g. anti-phishing) when a mail message does not contain a valid author
  domain signature. Version 0.37 or later is needed to fully support ADSP.


***************************************************************************
NOTE: the optional DBI module is not installed.

  If you intend to use SpamAssassin with an SQL database backend for
  user configuration data, Bayes storage, or other storage, you will need
  to have these installed; both the basic DBI module and the DBD driver for
  your database.


***************************************************************************
NOTE: the optional Encode::Detect module is not installed.

  If you plan to use the normalize_charset config setting to detect
  charsets and convert them into Unicode, you will need to install
  this module.

REQUIRED module missing: Net::DNS
REQUIRED module missing: NetAddr::IP
REQUIRED module missing: Archive::Tar
REQUIRED module missing: IO::Zlib
optional module missing: Digest::SHA1
optional module missing: Mail::SPF
optional module missing: IP::Country
optional module missing: Razor2
optional module missing: Net::Ident
optional module missing: IO::Socket::INET6
optional module missing: IO::Socket::SSL
optional module missing: Mail::DKIM
optional module missing: DBI
optional module missing: Encode::Detect

warning: some functionality may not be available,
please read the above report before continuing!

Done Configuration.
Trying to make SpamAssassin...
make: *** No targets specified and no makefile found.  Stop.

If needed, use cpan to install the missing modules, eg:
  cpan -i Archive::Tar Digest::SHA Mail::SPF IP::Country Net::Ident IO::Socket::INET6 Compress::Zlib Mail::DKIM LWP::UserAgent HTTP::Date Encode::Detect ExtUtils::MakeMaker

Press enter to answer [yes] if it asks you to install dependencies (it will prepend them to the queue)
Answer no if it asks: Are you ready for manual configuration? [yes] no


*** The make has failed, would you like to try to make again? (y,n):
 
If you have exactly the same error notice, do the following as root:
yum install perl-Net-DNS
or otherwise install Net::DNS via cpan.
 
Back
Top