diff -U4 -r exim-4.66/src/acl.c exim-4.66+data-accept-message/src/acl.c --- exim-4.66/src/acl.c 2007-01-08 14:25:36.000000000 +0000 +++ exim-4.66+data-accept-message/src/acl.c 2007-02-11 11:16:38.000000000 +0000 @@ -3075,10 +3075,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; @@ -3089,8 +3089,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) { @@ -3264,8 +3265,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) @@ -3386,9 +3388,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 && @@ -3497,8 +3501,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) @@ -3524,8 +3530,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; }