Bug 1794 - Code submission - Not a Bug
Summary: Code submission - Not a Bug
Status: RESOLVED FIXED
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Tools (show other bugs)
Version: unspecified
Hardware: Other Linux
: P5 enhancement
Target Milestone: 2.60
Assignee: Duncan Findlay
URL: http://www.computechnv.com/downloads/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-04-17 12:53 UTC by Brad Rathbun
Modified: 2003-04-27 15:48 UTC (History)
1 user (show)



Attachment Type Modified Status Actions Submitter/CLA Status
Perl script for stats package text/plain None Brad Rathbun [NoCLA]
Cleanup of stats script with Getopt::Long support, POD docs, strict/warn clean text/plain None Bob Apthorpe [HasCLA]

Note You need to log in before you can comment on or make changes to this bug.
Description Brad Rathbun 2003-04-17 12:53:33 UTC
I am submitting a stats package for possible inclusion in the next release. 
Reports useful info on what SpamAssassin's been up to.
Comment 1 Brad Rathbun 2003-04-17 12:54:21 UTC
Created attachment 896 [details]
Perl script for stats package
Comment 2 Duncan Findlay 2003-04-21 15:30:28 UTC
Brad, in order for us to consider this for inclusion in the SpamAssassin
tarball, there are some licensing issues that need to be cleared up. Firstly, it
is necessary that this script be under a dual PAL/GPL license. We would probably
require you to agree to our CONTRIB_CERT which is available at:
http://www.spamassassin.org/dist/CONTRIB_CERT

Secondly, the script doesn't work with the latest CVS and has a few warnings.
Scalar value @ARGV[0] better written as $ARGV[0] at
/home/daf/downloads/sastats.pl line 79.
Scalar value @ARGV[0] better written as $ARGV[0] at
/home/daf/downloads/sastats.pl line 288.
Name "main::oldfh" used only once: possible typo at
/home/daf/downloads/sastats.pl line 192.

and then,
Argument "" isn't numeric in numeric eq (==) at sastats.pl line 106, <LOG> line 4.
Argument "" isn't numeric in numeric eq (==) at sastats.pl line 106, <LOG> line 4.
Argument "4.0)" isn't numeric in addition (+) at sastats.pl line 135, <LOG> line 4.
Argument "4.0)" isn't numeric in addition (+) at sastats.pl line 135, <LOG> line 8.
Argument "4.0)" isn't numeric in addition (+) at sastats.pl line 135, <LOG> line 24.
etc. etc.

Chances are the format of the log files have changed since you wrote this. It
would also be nice if the configuration options could be done by command line
option, using Getopt::Long or something similar.

Thanks for your interest... this script looks promising.
Comment 3 Duncan Findlay 2003-04-21 15:33:09 UTC
and i'll take this bug
Comment 4 Bob Apthorpe 2003-04-21 20:28:25 UTC
Created attachment 906 [details]
Cleanup of stats script with Getopt::Long support, POD docs, strict/warn clean
Comment 5 Duncan Findlay 2003-04-21 20:39:58 UTC
Thanks for your help, Bob, but the licensing issue still remains... I now need
_both_ of you to agree to the CONTRIB_CERT (preferably by GPG/PGP signed e-mail)
to spamassassin-devel@lists.sourceforge.net.

Thanks.
Comment 6 Bob Apthorpe 2003-04-21 21:58:21 UTC
Ok, my CONTRIB_CERT should be in. Sorry for the awkward flopping around and 
any toes inadvertently stepped on.

I made a first-pass refactoring to add Getopt::Long support, and clean up some 
of the date formatting code (POSIX::strftime is your friend.) It runs clean 
under -w and 'use strict;'. I also added POD docs, --usage and --help options, 
tweaked some of the formatting (mostly eliminating tabs and adjusting format 
specifiers), and converted 'nonspam' to 'ham' to be more consistent with our 
terminology and added the obligatory 'ham' = 'nonspam' note in the report. 
Oops.

I've tested this against 2.53 but not against CVS. Let me know how this looks.
Comment 7 Brad Rathbun 2003-04-22 08:49:18 UTC
Subject: Re:  Code submission - Not a Bug

Thanks for the help. My toes are just fine. Didn't have time just now to
clean it up properly. I just thought it would be useful to someone else and
submitted it. My Perl coding skills are coming along, but aren't all the way
up to snuff yet!

I just sent a signed CONTRIB_CERT  as well, so we should be good to go.

-----------------------------------------
Brad


> Ok, my CONTRIB_CERT should be in. Sorry for the awkward flopping around
and
> any toes inadvertently stepped on.
>
> I made a first-pass refactoring to add Getopt::Long support, and clean up
some
> of the date formatting code (POSIX::strftime is your friend.) It runs
clean
> under -w and 'use strict;'. I also added POD docs, --usage and --help
options,
> tweaked some of the formatting (mostly eliminating tabs and adjusting
format
> specifiers), and converted 'nonspam' to 'ham' to be more consistent with
our
> terminology and added the obligatory 'ham' = 'nonspam' note in the report.
> Oops.
>
> I've tested this against 2.53 but not against CVS. Let me know how this
looks.

Comment 8 Duncan Findlay 2003-04-22 21:02:00 UTC
Anyways... now that we've got your CONTRIB_CERTs, I've started doing some work
to clean up the code even more.

I intend to fix up the date parsing a little bit (making it even more elegant!),
and I've fixed the whole option parsing thing. In doing so, I've removed the
--owner option, as I think most will agree that's a somewhat pointless option. I
have no problem with giving credit where credit is due, and I feel the manpage
is sufficient for the author's name... if you really want your name in the
output somewhere, let me know.... (After all that's been happening on
debian-devel@lists.debian.org recently, I'm really sick of this issue...)

I'll try to fix this up and commit it tomorrow.
Comment 9 Bob Apthorpe 2003-04-22 21:40:30 UTC
FWIW, the option processing routine is something I've been using for a few 
years, mostly in a corporate setting. --owner came about because tracing 
accountability was difficult in our organization; nobody in California took 
responsibility for their code and it was inconvenient for us in Texas to find 
who owned what, not being able to chat up the right people in the hall; call 
it leading by example. The intent was less related to ego and more about 
taking responsibility; regardless, I have no idea about debian-devel so don't 
take --owner as a continuation of that. --owner is disposable, as are 
--verbose and --debug as they don't currently do anything.
Comment 10 Duncan Findlay 2003-04-22 22:18:55 UTC
Subject: Re:  Code submission - Not a Bug

I assumed it wasn't an egotistical thing. There's a big flamewar going
on right now on debian-devel@lists.debian.org because someone removed
a pageworth of credits and sponsors from the output of mkreiserfs or
something like that, so I figured I'd better ask :-)

Comment 11 Brad Rathbun 2003-04-23 09:01:39 UTC
Subject: Re:  Code submission - Not a Bug

I certainly don't care, either. Knock yourself out. I contributed it for the
good of the community, not for fame and fortune. I certainly don't think
that particular hack was worthy of too much of my ego, anyway! If you'd like
to substantially reduce the comment block at the top, that wouldn't hurt my
feelings, either.

Use it, abuse it, mangle it, whatever. At least I was finally able to
contribute something back to my favorite project!

-----------------------------------------
Brad


>
> I assumed it wasn't an egotistical thing. There's a big flamewar going
> on right now on debian-devel@lists.debian.org because someone removed
> a pageworth of credits and sponsors from the output of mkreiserfs or
> something like that, so I figured I'd better ask :-)

Comment 12 James F. Hranicky 2003-04-23 09:25:37 UTC
Subject: Re: [SAdev]  Code submission - Not a Bug

On Wed, 23 Apr 2003 09:01:39 -0700 (PDT)
bugzilla-daemon@hughes-family.org wrote:

> Use it, abuse it, mangle it, whatever. At least I was finally able to
> contribute something back to my favorite project!

Speaking of which, is anyone interested in my bogus local address patch?
Should I submit a report?

If not, I'll just maintain it locally.

----------------------------------------------------------------------
| Jim Hranicky, Senior SysAdmin                   UF/CISE Department |
| E314D CSE Building                            Phone (352) 392-1499 |
| jfh@cise.ufl.edu                      http://www.cise.ufl.edu/~jfh |
----------------------------------------------------------------------

Comment 13 Duncan Findlay 2003-04-27 23:48:42 UTC
Checked into the tools/ directory of the tree. This is significantly different
from the 2 versions already posted here. (Requires Date::Manip)

Closing.

Bugs in the new sa-stats.pl can be filed directly as new bugs. This has not been
(well) tested.

Thanks for the code submission.