Bug 6409 - Plugin TextCat Breaks SpamAssassin on Win2003
Summary: Plugin TextCat Breaks SpamAssassin on Win2003
Status: RESOLVED WORKSFORME
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Plugins (show other bugs)
Version: 3.3.1
Hardware: PC Windows 2003
: P2 normal
Target Milestone: Undefined
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-14 13:08 UTC by mpapet
Modified: 2011-10-29 01:53 UTC (History)
2 users (show)



Attachment Type Modified Status Actions Submitter/CLA Status

Note You need to log in before you can comment on or make changes to this bug.
Description mpapet 2010-04-14 13:08:39 UTC
Attempts to use SpamAssassin on Win2003 break with plugin TextCat on Strawberry Perl.

Steps to recreate
1. install strawberry perl
2. cpan install Mail::SpamAssassin
3. A default install has all the conf and shared files in c:\strawberry\perl\site\

sa-learn is broken and spamc is broken by this issue. I did not try other applications.

It produces a number of errors:

textcat: languages filename not defined

textcat: no language models loaded

Digging around in the plugin, it looks like it cannot find the path to the languages file.  In Win2003+Strawberry Perl it's c:\strawberry\perl\site\usr\share\spamassassin\language

Attempts to force the path eliminate the "languages filename not defined" error, but still the plugin reports "no language models loaded" with a properly configured language file.

If you hare having the same problem, a very quick and dirty hack follows.
  if (! @nm) {
    warn "textcat: no language models loaded\n";
	if ($^O eq 'MSWin32') {
    $ngram->{"language"} = "en";
     push (@nm, $ngram);
     warn "forced load of en because TextCat doesn't work on Win32 \n";
	}
	} else {
    dbg("textcat: loaded " . scalar(@nm) . " language models");
  }
}
Comment 1 Daniel Lemke 2010-04-15 02:43:13 UTC
Are you sure this is a problem regarding Textcat or may it be possible that something else is corrupted with your Perl distribution?

Did you turn on debug flag and investigated if there were any other serious warnings like failing plugins or so?

I wasn't able to reproduce it since I use ActivePerl, so this is what output from 3.3.1 looks for me:

Apr 15 08:37:33.761 [3984] dbg: plugin: loading Mail::SpamAssassin::Plugin::TextCat from @INC
Apr 15 08:37:33.772 [3984] dbg: textcat: loading languages file...
Apr 15 08:37:33.822 [3984] dbg: textcat: loaded 73 language models
[...]
Apr 15 08:37:34.511 [3984] dbg: plugin: Mail::SpamAssassin::Plugin::TextCat=HASH(0x53402c0) implements 'extract_metadata', priority 0
Apr 15 08:37:34.511 [3984] dbg: message: ---- MIME PARSER START ----
Apr 15 08:37:34.511 [3984] dbg: message: parsing normal part
Apr 15 08:37:34.512 [3984] dbg: message: ---- MIME PARSER END ----
Apr 15 08:37:34.512 [3984] dbg: message: no encoding detected
Apr 15 08:37:34.512 [3984] dbg: textcat: classifying, skipping: yi sco lv is bs sl la ga sa eu et rm cy eo fy gd lt
Apr 15 08:37:34.534 [3984] dbg: textcat: can't determine language uniquely enough
Apr 15 08:37:34.534 [3984] dbg: textcat: X-Languages: "", X-Languages-Length: 3411



Daniel
Comment 2 Kevin A. McGrail 2011-10-29 01:53:51 UTC
Closing as Daniel could not replicate with no feedback from the original reporter.