[Exim] Exim+SA: spamc non-0 exit when spamd is down = transp…

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Rich, WhidbeyNet NOC
Fecha:  
A: exim-users
Asunto: [Exim] Exim+SA: spamc non-0 exit when spamd is down = transport_filter panic
Hi list,

We've been testing SpamAssassin 2.43 with Exim 4.10 and 4.12, using a
slightly modified version of:

http://dman.ddts.net/~dman/config_docs/exim4_spamassassin.html

When spamd is running; spamc returns a 0 exitcode, and the message is
scanned and delivered. When spamd is not running, spamc (from
"libspamc.c"), returns an EX_UNAVAILABLE exitcode (69), even though
spamc would have safe-failed fine by outputting the unscanned message.

The area of focus from our configuration is:

----8<---- Exim Config Snippet ----8<----
spamassassin_transport:
    driver = pipe
    command = /usr/local/sbin/exim/exim -oMr spam-scanned -bS
    use_bsmtp = true
    transport_filter = /usr/local/bin/spamc -u ${local_part}
    home_directory = "/tmp"
    current_directory = "/tmp"
    user = exim
    group = eximgrp
    log_output = true
    return_fail_output = true
    return_path_add = false
    message_prefix =
    message_suffix =
    headers_add = "X_Spam-Scanned: Yn1ghjJ5jy78gjk"
    headers_remove = X-Spam-Flag : X-Spam-Status : X-Spam-Level
----8<---- Exim Config Snippet ----8<----


Evidently, a non-0 exit code in a transport_filter means the filter
failed utterly. In the "pipe" driver, it's too bad you can't set an
"ignore_status" or "temp_errors" for a transport_filter. Those options
only effect the "command" itself. So, spamc is causing Exim to freeze
the message:

----8<---- Exim Debug Snippet ----8<----
waiting for filter process
(Here, spamc tries to connect to spamd. It cannot.)
filter process returned 69
waiting for writing process
end of filtering transport writing: yield=0
errno=-24 more_errno=69
search_tidyup called
spamassassin_transport transport returned PANIC for richs@???
post-process richs@??? (9)
LOG: MAIN
<richs@???>: spamassassin_transport transport_output: An error
was detected while processing a file of BSMTP input
LOG: MAIN PANIC
== richs@??? R=spamassassin_router T=spamassasin_transport
defer (-24): Filter process failure
----8<---- Exim Debug Snippet ----8<----

We need it to be delivered, just unscanned, if spamd dies. This is the
same problem brought up last month:

http://www.exim.org/mailman/htdig/exim-users/Week-of-Mon-20021125/046735
.html

There was apparently no solution given from either list.

One solution could be to modify "libspamc.c" to EX_OK if it can't
connect to spamd. Since spamc has a safe-fail mechanism, shouldn't that
be fine?

Another solution might be to modify Exim to apply "temp_errors" to the
transport_filter command. Wouldn't that be best, for the same reasons
"temp_errors" is used for the main pipe "command"?

There's bound to be other solutions. Has someone already solved this?
How do you keep your mail flowing, when spamd dies, besides bandaids
like process checkers? Maybe I'm all wrong about this.

Rich Sandberg
richs@???