You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by bu...@bugzilla.spamassassin.org on 2012/11/23 18:54:09 UTC

[Bug 6867] New: rule-qa only looks at localized time in masscheck results files, gets "no time found, ignored" if non-C locale in use

https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6867

            Bug ID: 6867
           Summary: rule-qa only looks at localized time in masscheck
                    results files, gets "no time found, ignored" if non-C
                    locale in use
           Product: Spamassassin
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Masses
          Assignee: dev@spamassassin.apache.org
          Reporter: jhardin@impsec.org
    Classification: Unclassified

Created attachment 5113
  --> https://issues.apache.org/SpamAssassin/attachment.cgi?id=5113&action=edit
fall back to Date: header if timestamp in "mass-check results" line cannot be
parsed

The header from a masscheck result file run in a non-C-ish locale:

# mass-check results from masscheck@xxxxxx, on czw, 22 lis 2012, 12:07:20 UTC
# M:SA version 3.4.0-r1406273
# SVN revision: 1412451
# Date: 20121122T120720Z
# Perl version: 5.012004 on i686-linux
# Switches: '--cache "--cachedir=~/cache-mass" "--hamlog=ham-xxxxx-ham.log"
"--spamlog=spam-xxxx-spam.log" -j 1 --progress "ham:dir:/xxx/
xxx/xxxx/2*"'

reports-from-logs only looks for the dtm in the "mass-check results from" line,
using a hardcoded C-like date format, but mass-check generates that date using
whatever locale is in use. If the locale is not C-ish and thus not parseable
using the hardcoded format, rule-qa will emit "no time found, ignored" and will
ignore the results file completely.

rule-qa should use only, or at least fall back to, the fixed-format Date: line.

Proposed fallback patch attached.

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

[Bug 6867] rule-qa only looks at localized time in masscheck results files, gets "no time found, ignored" if non-C locale in use

Posted by bu...@bugzilla.spamassassin.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6867

John Hardin <jh...@impsec.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from John Hardin <jh...@impsec.org> ---
Execute: Commit
Modified:
/home/jhardin/develop/spamassassin/svn/trunk/masses/rule-qa/reports-from-logs
Committed revision 1425396.

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

[Bug 6867] rule-qa only looks at localized time in masscheck results files, gets "no time found, ignored" if non-C locale in use

Posted by bu...@bugzilla.spamassassin.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6867

Kevin A. McGrail <km...@pccc.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kmcgrail@pccc.com

--- Comment #1 from Kevin A. McGrail <km...@pccc.com> ---
Your idea seems in-line with the Comment TO-DO above. Other than editing that
comment, seems like a worthwhile plan though I don't know the input format
exactly to know if your parsing will work.

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

[Bug 6867] rule-qa only looks at localized time in masscheck results files, gets "no time found, ignored" if non-C locale in use

Posted by bu...@bugzilla.spamassassin.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6867

John Hardin <jh...@impsec.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jhardin@impsec.org

--- Comment #2 from John Hardin <jh...@impsec.org> ---
(In reply to comment #1)
> Your idea seems in-line with the Comment TO-DO above. Other than editing
> that comment, seems like a worthwhile plan

I think that comment is more directed at setting $dateline{$file} than
$time{$file} so I don't feel that altering the comment is appropriate for this
particular change. I would need to dig more deeply to understand how
$dateline{$file} is being used before changing any of that coding or that
comment.

> though I don't know the input
> format exactly to know if your parsing will work.

mass-check sets the Date: value using this:

  my $isowhen = strftime("%Y%m%dT%H%M%SZ", gmtime(time)); # better

Which is an invariant locale-independent format.

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