SA Bugzilla – Bug 1904
Bytes.pm continues to be problematic with Perl 5.005.03
Last modified: 2003-05-18 06:27:56 UTC
bytes.pm doesn't exist with Perl 5.005.03. There have been numerous fixes and changes made but as of 2.53 and 2.54, IF you happen to run spamd while your CWD is /usr/src/Mail-SpamAssassin-2.5X, it will try and use the lib dir which has use bytes instead of the blib dir. Suggest using: no strict; eval("use bytes") if ($inc{bytes.pm}); use strict; Instead of all the various lib, blib, @INC mods. Additionally, the new routine in 2.54 for mkdir spam_conf_dir doesn't have a umask on it and this bombs on perl 5.005.03. A quick fix that I believe fixes everything is diff -u Mail-SpamAssassin-2.54-Fix/spamd/spamd.raw Mail-SpamAssassin- 2.54/spamd/spamd.raw --- Mail-SpamAssassin-2.54-Fix/spamd/spamd.raw Mon May 12 19:22:02 2003 +++ Mail-SpamAssassin-2.54/spamd/spamd.raw Mon May 12 15:15:36 2003 @@ -872,7 +872,7 @@ my $spam_conf_dir = $dir . '/.spamassassin'; #needed for AWL, Bayes, etc. if ( ! -d $spam_conf_dir ) { - if ( mkdir($spam_conf_dir,0700) ) + if ( mkdir $spam_conf_dir ) { logmsg "info: created $spam_conf_dir for $username."; }
we don't support running SA out of the source directory. If you want to test it without making it the sitewide choice, put it into another location for testing.
Sorry, I believe I was unclear below. Let's say you untar the source, you make it, you make install it. Now, without changing dirs (hence, leaving your CWD the same), you try and run it from /usr/local or /etc/rc.d/init.d even, it will bomb because the @INC includes $CWD/lib which then trys to do a use Bytes.pm. On older versions of Perl, this fails. There have been numerous changes to the INC, etc and the parsing of the lib to blib to solve this but the spamassassin should either do a change of the working directory to a standard place or, in my opinion, eval the inclusion of Bytes.pm as below: no strict; eval("use bytes") if ($inc{bytes.pm}); use strict; Sorry for the lack of clarity previously.
yes, don't do that. as I said, running SA out of the source directory isn't supported. we spent a lot of time figuring out that the eval doesn't do what you'd expect which is why we don't do that. for 2.60 we're likely to just drop 5.005 support, making the bytes.pm business obsolete.