Bug 3754 - [review] sa-learn: successful return code though file not found
Summary: [review] sa-learn: successful return code though file not found
Status: RESOLVED FIXED
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Learner (show other bugs)
Version: SVN Trunk (Latest Devel Version)
Hardware: All All
: P5 minor
Target Milestone: 3.1.2
Assignee: SpamAssassin Developer Mailing List
URL: http://bugs.debian.org/cgi-bin/bugrep...
Whiteboard: ready
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-06 09:26 UTC by Duncan Findlay
Modified: 2006-04-03 20:45 UTC (History)
0 users



Attachment Type Modified Status Actions Submitter/CLA Status
suggested patch patch None Theo Van Dinter [HasCLA]

Note You need to log in before you can comment on or make changes to this bug.
Description Duncan Findlay 2004-09-06 09:26:19 UTC
Package: spamassassin
Version: 2.63-1
Severity: minor

Hi,

the subject says it all...

sa-learn --spam --mbox /does/not/exist ; echo $?

will demonstrate it.

Eduard.
Comment 1 Bob Menschel 2005-04-07 21:07:33 UTC
Confirmed. Code within ArchiveIterator.pm does subroutine return with code
indicating success or failure on opening file, but failure code does not
translate to non-zero program exit code. This does not allow the calling cron
job to notify user of a problem (expected mail(s) to learn wasn't learned). 
Comment 2 Theo Van Dinter 2006-03-15 03:47:36 UTC
Created attachment 3413 [details]
suggested patch

wow, this bug's been around a while...

so here's a patch that implements a fix.  it's a little bit of a kluge, because
there's no direct way to pass an error opening a file back up to sa-learn at
the moment, and changing APIs to do it really isn't my first choice.
Comment 3 Daryl C. W. O'Shea 2006-03-31 01:50:49 UTC
+1
Comment 4 Justin Mason 2006-04-03 11:43:30 UTC
+1
Comment 5 Theo Van Dinter 2006-04-04 03:45:37 UTC
Committed revision 391215.

:)