summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPhil Pennock <pdp@exim.org>2011-08-27 16:01:01 -0700
committerPhil Pennock <pdp@exim.org>2011-08-27 16:01:01 -0700
commit9e949f00f404d3672b1ecd7c1bfd5e8927a3301d (patch)
tree9e548746dcd7865c699191178f106804f86c4593 /src
parente12f8c3248614077e92c7ba23386e1f36d570c8f (diff)
$av_failed variable set when av_scanner deferred
Patch from John Horne. Fixes bug 1078
Diffstat (limited to 'src')
-rw-r--r--src/src/expand.c3
-rw-r--r--src/src/globals.c1
-rw-r--r--src/src/globals.h1
-rw-r--r--src/src/malware.c7
4 files changed, 11 insertions, 1 deletions
diff --git a/src/src/expand.c b/src/src/expand.c
index 8dfd7a8ad..fb6d6922b 100644
--- a/src/src/expand.c
+++ b/src/src/expand.c
@@ -387,6 +387,9 @@ static var_entry var_table[] = {
{ "authenticated_id", vtype_stringptr, &authenticated_id },
{ "authenticated_sender",vtype_stringptr, &authenticated_sender },
{ "authentication_failed",vtype_int, &authentication_failed },
+#ifdef WITH_CONTENT_SCAN
+ { "av_failed", vtype_int, &av_failed },
+#endif
#ifdef EXPERIMENTAL_BRIGHTMAIL
{ "bmi_alt_location", vtype_stringptr, &bmi_alt_location },
{ "bmi_base64_tracker_verdict", vtype_stringptr, &bmi_base64_tracker_verdict },
diff --git a/src/src/globals.c b/src/src/globals.c
index 92525e8d8..a5516b91d 100644
--- a/src/src/globals.c
+++ b/src/src/globals.c
@@ -348,6 +348,7 @@ uschar *auth_defer_user_msg = US"";
uschar *auth_vars[AUTH_VARS];
int auto_thaw = 0;
#ifdef WITH_CONTENT_SCAN
+BOOL av_failed = FALSE;
uschar *av_scanner = US"sophie:/var/run/sophie"; /* AV scanner */
#endif
diff --git a/src/src/globals.h b/src/src/globals.h
index 4e395e81e..4ed3950df 100644
--- a/src/src/globals.h
+++ b/src/src/globals.h
@@ -184,6 +184,7 @@ extern uschar *auth_defer_user_msg; /* Error message for user */
extern uschar *auth_vars[]; /* $authn variables */
extern int auto_thaw; /* Auto-thaw interval */
#ifdef WITH_CONTENT_SCAN
+extern BOOL av_failed; /* TRUE if the AV process failed */
extern uschar *av_scanner; /* AntiVirus scanner to use for the malware condition */
#endif
diff --git a/src/src/malware.c b/src/src/malware.c
index c7cd0bcca..864564ffc 100644
--- a/src/src/malware.c
+++ b/src/src/malware.c
@@ -69,17 +69,22 @@ Returns: Exim message processing code (OK, FAIL, DEFER, ...)
int malware(uschar **listptr) {
uschar scan_filename[1024];
BOOL fits;
+ int ret;
fits = string_format(scan_filename, sizeof(scan_filename),
CS"%s/scan/%s/%s.eml", spool_directory, message_id, message_id);
if (!fits)
{
+ av_failed = TRUE;
log_write(0, LOG_MAIN|LOG_PANIC,
"malware filename does not fit in buffer [malware()]");
return DEFER;
}
- return malware_internal(listptr, scan_filename, FALSE);
+ ret = malware_internal(listptr, scan_filename, FALSE);
+ if (ret == DEFER) av_failed = TRUE;
+
+ return ret;
}