diff -U4 -r exim-4.63/src/acl.c exim-4.63+data-accept-message/src/acl.c --- exim-4.63/src/acl.c 2006-07-31 15:19:48.000000000 +0100 +++ exim-4.63+data-accept-message/src/acl.c 2006-08-26 14:04:41.000000000 +0100 @@ -3006,8 +3006,9 @@ If there isn't a log message set, we make it the same as the user message. */ if (((rc == FAIL_DROP)? FAIL : rc) == msgcond[verb] || (verb == ACL_DISCARD && rc == OK) || + (where == ACL_WHERE_DATA && rc == OK) || (where == ACL_WHERE_QUIT)) { uschar *expmessage; @@ -3022,17 +3023,25 @@ if (verb == ACL_WARN) *log_msgptr = *user_msgptr = NULL; if (user_message != NULL) { - acl_verify_message = old_user_msgptr; + /* If the verb is "accept" or "require" in the DATA ACL, the previous + message should not be used as the acl_verify_message. */ + + if (where == ACL_WHERE_DATA && rc == OK) + acl_verify_message = NULL; + else + acl_verify_message = old_user_msgptr; + expmessage = expand_string(user_message); if (expmessage == NULL) { if (!expand_string_forcedfail) 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) { @@ -3206,8 +3215,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) @@ -3328,9 +3338,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 && @@ -3439,8 +3451,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) @@ -3466,8 +3480,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; } Only in exim-4.63+data-accept-message/src: acl.c.orig diff -U4 -r exim-4.63/src/receive.c exim-4.63+data-accept-message/src/receive.c --- exim-4.63/src/receive.c 2006-07-31 15:19:48.000000000 +0100 +++ exim-4.63+data-accept-message/src/receive.c 2006-08-26 14:05:04.000000000 +0100 @@ -1278,8 +1278,9 @@ /* Final message to give to SMTP caller */ uschar *smtp_reply = NULL; +uschar *user_msg = NULL; /* Working header pointers */ header_line *h, *next; @@ -2929,9 +2930,9 @@ them. */ if (acl_smtp_data != NULL && recipients_count > 0) { - uschar *user_msg, *log_msg; + uschar *log_msg; rc = acl_check(ACL_WHERE_DATA, NULL, acl_smtp_data, &user_msg, &log_msg); add_acl_headers(US"DATA"); if (rc == DISCARD) { @@ -3484,8 +3485,10 @@ { if (fake_response != OK) smtp_respond((fake_response == DEFER)? US"450" : US"550", 3, TRUE, fake_response_text); + else if (user_msg != NULL) + smtp_printf("250 OK id=%s %s\r\n", message_id, user_msg); else smtp_printf("250 OK id=%s\r\n", message_id); if (host_checking) fprintf(stdout, Only in exim-4.63+data-accept-message/src: receive.c.orig