-e option suggestion with doc update

David Relson relson at osagesoftware.com
Sun Oct 6 21:27:58 CEST 2002


Matthias,

Since '-e' and '-p' only apply when classifying messages, i.e. don't apply 
when using '-s', '-n', '-S', or '-N', i.e. when solely updating word lists, 
I'd move the code for setting exitcode a bit earlier in main.c to the "if 
(register_type==REG_NONE) { ... }" block.  In that block, bogofilter() 
returns the value for variable "status".  Since bogofilter() only returns 
RC_SPAM and RC_NONSPAM, i.e. 0 and 1, we can ignore the value of "status" 
when using "nonspam_exits_0".  The code for setting "exitcode" becomes:

@@ -152,8 +159,12 @@
  	    if (fflush(stdout) || ferror(stdout)) exit(2);
  	}

-	exitcode = status;
-    } else {
+	if (nonspam_exits_0 && passthrough)
+	    exitcode = 0;
+	else
+	    exitcode = status;
+    }
+    else {
  	register_messages(STDIN_FILENO, register_type);
      }


Alternatively, it could be written as:

	exitcode = (nonspam_exits_0 && passthrough) ? 0 : status;

Cheers!

David



More information about the bogofilter-dev mailing list