http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5383

           Summary: compile_now() doesn't pre-load all necessary Perl
                    modules
           Product: Spamassassin
           Version: SVN Trunk (Latest Devel Version)
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P3
         Component: Libraries
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]


SA man page states:
  $f->compile_now (...)
    Compile all patterns, load all configuration files,
    and load all possibly-required Perl modules.

Depending on a version of SA, there is always a handful
of Perl modules which compile_now() fails to load, like
some plugins and their underlying modules, BayesStore::*,
NetAddr::IP, SA::Locker::* and the like.

In a normal (non-chrooted) environment this just means that
these modules will be loaded later by each child process (spamd,
amavisd), instead of being loaded by a master process before a
fork; which adds a slight performance penalty on each child startup.
It would be nice to avoid it (even with spamd), although is not crucial.

In a chrooted environment (optional in amavisd), this is more serious.
It implies that either the whole Perl lib hierarchy needs to be present
in a chroot jail (or at least the missing parts), or a master process
needs to pre-load missing modules manually before forking.

For every version of SA since the early 2.x, for amavisd-new I'm manually
preparing a list of missing modules and keeping it in the amavisd program,
which then preloads the remaining missing modules in a master process.
This hacking approach if getting unsightly long, and can't cope
cleanly with future versions of SA.

I'm proposing that the compile_now is enhanced to pre-load ALL the
required Perl modules, at least the ones directly needed by SA for
its current set of loaded plugins and selected bayes store etc.,
or some alternative API call be provided which can be invoked by
a master process just before forking. Certainy SA is in a better
position to know which plugins are being loaded, what is its
current bayes db backend, and what are its other components that
are not exercised by a sample message evaluated by compile_now.

I thing the SA 3.2 jump is a perfect place in time to introduce
this enhancement :)


As an illustration, here is a list of missing modules needed for SA320:

basic modules (non-plugins):

Mail::SpamAssassin::PersistentAddrList Mail::SpamAssassin::SQLBasedAddrList
Mail::SpamAssassin::Locker Mail::SpamAssassin::Locker::Flock
Mail::SpamAssassin::Locker::UnixNFSSafe Mail::SpamAssassin::BayesStore
Mail::SpamAssassin::BayesStore::DBM Mail::SpamAssassin::BayesStore::SQL
Mail::SpamAssassin::BayesStore::MySQL Mail::SpamAssassin::BayesStore::PgSQL
Mail::SpamAssassin::Bayes Mail::SpamAssassin::Bayes::CombineChi
Mail::SpamAssassin::PerMsgLearner
Mail::SpamAssassin::Locales (not sure about this one)

underlying missing Perl modules:

Net::DNS::RR::SOA Net::DNS::RR::NS Net::DNS::RR::MX
Net::DNS::RR::A Net::DNS::RR::AAAA Net::DNS::RR::PTR
Net::DNS::RR::CNAME Net::DNS::RR::TXT
NetAddr::IP NetAddr::IP::Util
auto::NetAddr::IP::Util::inet_n2dx auto::NetAddr::IP::Util::ipv6_n2d

(I'm not sure about the 'URI' Perl module, it used to be necessary
to pre-load its components, but apparently no longer is)

plugins:

Hashcash RelayCountry SPF URIDNSBL
AWL AccessDB AntiVirus AutoLearnThreshold DCC DomainKeys DKIM MIMEHeader
Pyzor Razor2 ReplaceTags SpamCop TextCat URIDetail WhiteListSubject
BodyEval DNSEval HTMLEval HeaderEval MIMEEval RelayEval URIEval WLBLEval
ASN Bayes BodyRuleBaseExtractor Check HTTPSMismatch OneLineBodyRuleType 
Rule2XSBody Shortcircuit VBounce

and their supporting modules if an associated plugin is loaded:

Razor2::Client::Agent IP::Country::Fast
Mail::DomainKeys Mail::DomainKeys::Message Mail::DomainKeys::Policy
Mail::DKIM Mail::DKIM::Verifier
Mail::SpamAssassin::Plugin::SPF

needed by SPF plugin:
Mail::SPF Mail::SPF::Query Mail::SPF::Mech Mail::SPF::Mech::A
Mail::SPF::Mech::All Mail::SPF::Mech::Exists Mail::SPF::Mech::IP4
Mail::SPF::Mech::IP6 Mail::SPF::Mech::Include Mail::SPF::Mech::MX
Mail::SPF::Mech::PTR Mail::SPF::Mod Mail::SPF::Mod::Exp
Mail::SPF::Mod::Redirect Mail::SPF::SenderIPAddrMech
Mail::SPF::v1::Record Mail::SPF::v2::Record

needed by DKIM and DomainKeys plugins:
Crypt::OpenSSL::RSA
auto::Crypt::OpenSSL::RSA::new_public_key
auto::Crypt::OpenSSL::RSA::new_key_from_parameters
auto::Crypt::OpenSSL::RSA::get_key_parameters
auto::Crypt::OpenSSL::RSA::import_random_seed
Digest::SHA


  Mark



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

Reply via email to