diff -U4 -r exim-4.67/src/acl.c exim-4.67+data-accept-message/src/acl.c --- exim-4.67/src/acl.c 2007-04-17 14:06:39.000000000 +0100 +++ exim-4.67+data-accept-message/src/acl.c 2007-06-02 17:30:02.000000000 +0100 @@ -3124,10 +3124,10 @@ However, the value of an existing message is available in $acl_verify_message during expansions. */ if (verb == ACL_WARN || - (rc == OK && (verb == ACL_ACCEPT || verb == ACL_DISCARD))) - *log_msgptr = *user_msgptr = NULL; + (rc == OK && (verb == ACL_ACCEPT || verb == ACL_DISCARD || verb == ACL_REQUIRE))) + if (verb == ACL_WARN) *log_msgptr = *user_msgptr = NULL; if (user_message != NULL) { acl_verify_message = old_user_msgptr; @@ -3138,8 +3138,9 @@ log_write(0, LOG_MAIN|LOG_PANIC, "failed to expand ACL message \"%s\": %s", user_message, expand_string_message); } else if (expmessage[0] != 0) *user_msgptr = expmessage; + else *user_msgptr = NULL; } if (log_message != NULL) { @@ -3313,8 +3314,9 @@ int fd = -1; acl_block *acl = NULL; uschar *acl_name = US"inline ACL"; uschar *ss; +BOOL require_message = FALSE; /* Catch configuration loops */ if (level > 20) @@ -3435,9 +3437,11 @@ int cond; int basic_errno = 0; BOOL endpass_seen = FALSE; - *log_msgptr = *user_msgptr = NULL; + *log_msgptr = NULL; + /* If a "require" verb returned a message (only set when processing a DATA ACL), don't reset it. */ + if (!require_message) *user_msgptr = NULL; acl_temp_details = FALSE; if (where == ACL_WHERE_QUIT && acl->verb != ACL_ACCEPT && @@ -3546,8 +3550,10 @@ break; case ACL_REQUIRE: if (cond != OK) return cond; + /* If this is a DATA ACL, the message needs to be preserved. */ + if (where == ACL_WHERE_DATA) require_message = (*user_msgptr != NULL ? TRUE : FALSE); break; case ACL_WARN: if (cond == OK) @@ -3573,8 +3579,9 @@ /* We have reached the end of the ACL. This is an implicit DENY. */ HDEBUG(D_acl) debug_printf("end of %s: implicit DENY\n", acl_name); +if (require_message) *user_msgptr = NULL; return FAIL; }