http://bugzilla.spamassassin.org/show_bug.cgi?id=3107

           Summary: Bayes Learner cannot read from mbox files
           Product: Spamassassin
           Version: 2.63
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: Learner
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


Running:

> sa-learn --ham --no-rebuild --mbox ~/MAIL/verified-ham

Generates:

> Learned from 0 message(s) (0 message(s) examined).

After reading the Wiki on problems with using Bayes in SA, trying everything in
the suggestions, I decided to debug the code.  I found what I think is a mistake
in the parsing of mbox type mailboxes.  On lines 531 and 595 of
ArchiveIterator.pm are the lines:

        if (substr($_,0,5) eq "From ") {

      last if substr($_,0,5) eq "From ";

which has as a result that no messages are found because the substring that is
contained in an mbox mail message if "From:" not "From ".

Thus, the fix is simple:

511c511
<
---
>
516a517
>     my $nhead = 0;
529c530,531
<       if (substr($_,0,5) eq "From ") {
---
>
>       if (substr($_,0,5) eq "From:") {
593c595
<       last if substr($_,0,5) eq "From ";
---
>       last if substr($_,0,5) eq "From:";



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

Reply via email to