On 1/10/2013 6:41 AM, Tom Hendrikx wrote:
Hi,

I was trying to detect various error conditions during spamc execution
based on its exit code, which, according to its manpage, should be easy
using something -x / --no-safe-fallback.

$ spamc --full -no-safe-fallback --port=12345 < message.eml; echo $?

This nicely reports an exit code of 69 (where nothing is actually
listing on that port).

However, checking for maxsize issues does not work:

$ spamc --full --no-safe-fallback --max-size=10 < message.eml; echo $?

This reports an exit code of 0. Checking the source code [1] tells me
that the exit code is suppressed on purpose, but the bugreport
referenced in the source code [2] doesn't explain why EX_TOOBIG should
be suppressed.

So either the code has an issue, or the man page (as EX_TOOBIG can never
happen but it is documented). I'd rather see the code fixed, unless
there is a compelling reason not too which I failed to understand.

Kind regards,
        Tom

[1]
http://svn.apache.org/viewvc/spamassassin/trunk/spamc/spamc.c?view=markup (line
1050)
[2] https://issues.apache.org/SpamAssassin/show_bug.cgi?id=5412
My best guess, it exits that way so that the mail that is larger than the scan limit is still accepted by MTAs and continues along the process.

Suggest you look at bug 6717 perhaps and see if you can work up a patch to give the behavior you would like.


Regards,
KAM

Reply via email to