--- exim-4.14/src/exiscan.c.orig Mon Mar 17 16:55:31 2003 +++ exim-4.14/src/exiscan.c Mon Mar 17 17:55:32 2003 @@ -38,6 +38,7 @@ // extra global variables uschar return_message[RETURN_MESSAGE_LEN]; // the return message to exim +uschar log_message[RETURN_MESSAGE_LEN]; // the message to be logged uschar msg_subject[SUBJECT_LEN]; // the message's subject (if we find one) uschar unpackdir[PATH_SIZE]; // the temporary directory with the unwrapped message uschar completefilepath[PATH_SIZE]; // the mbox-style message file @@ -82,6 +83,7 @@ // basic sanity things generate_retmsg(return_message, RETURN_MESSAGE_LEN, NULL, US DEFAULT_NOTHING_DONE, NULL); + generate_retmsg(log_message, RETURN_MESSAGE_LEN, NULL, US DEFAULT_NOTHING_DONE, NULL); Ustrcpy(msg_subject, CS DEFAULT_NO_SUBJECT); retcode = LOCAL_SCAN_ACCEPT; *return_text = return_message; @@ -96,20 +98,23 @@ case 1: // already scanned retcode = LOCAL_SCAN_ACCEPT; - generate_retmsg(return_message, RETURN_MESSAGE_LEN, NULL, US ERROR_ALREADY_SCANNED, info); - exiscan_log(LOG_MAIN, EXISCAN_LOG_INFORMATIONAL, return_message); + generate_retmsg(return_message, RETURN_MESSAGE_LEN, NULL, US ERROR_EXT_ALREADY_SCANNED, info); + generate_retmsg(log_message, RETURN_MESSAGE_LEN, NULL, US ERROR_INT_ALREADY_SCANNED, info); + exiscan_log(LOG_MAIN, EXISCAN_LOG_INFORMATIONAL, log_message); break; case -2: // temporary errors (disk full etc.) retcode = LOCAL_SCAN_TEMPREJECT; - generate_retmsg(return_message, RETURN_MESSAGE_LEN, NULL, US ERROR_TEMPORARY_PROBLEM, info); - exiscan_log(LOG_MAIN, EXISCAN_LOG_CRITICAL, return_message); + generate_retmsg(return_message, RETURN_MESSAGE_LEN, NULL, US ERROR_EXT_TEMPORARY_PROBLEM, info); + generate_retmsg(log_message, RETURN_MESSAGE_LEN, NULL, US ERROR_INT_TEMPORARY_PROBLEM, info); + exiscan_log(LOG_MAIN, EXISCAN_LOG_CRITICAL, log_message); break; case -1: // hard error from the MIME parser exiscan_add_header(MIME_HEADER,info); - generate_retmsg(return_message, RETURN_MESSAGE_LEN, exiscan_expand(exiscan_demime_rejectmsg,US"exiscan_demime_rejectmsg"), US ERROR_BROKEN_MIME, info); - exiscan_log(LOG_MAIN, EXISCAN_LOG_INFORMATIONAL, return_message); + generate_retmsg(return_message, RETURN_MESSAGE_LEN, exiscan_expand(exiscan_demime_rejectmsg,US"exiscan_demime_rejectmsg"), US ERROR_EXT_BROKEN_MIME, info); + generate_retmsg(log_message, RETURN_MESSAGE_LEN, NULL, US ERROR_INT_BROKEN_MIME, info); + exiscan_log(LOG_MAIN, EXISCAN_LOG_INFORMATIONAL, log_message); if ( exiscan_do_action(US"demime",exiscan_expand(exiscan_demime_action,US"exiscan_demime_action"), &retcode) ) goto EXIT_EXISCAN; // go on with checks if pass was requested default: @@ -124,15 +129,17 @@ case 1: // virus found exiscan_add_header(AV_HEADER,info); - generate_retmsg(return_message, RETURN_MESSAGE_LEN, exiscan_expand(exiscan_av_rejectmsg,US"exiscan_av_rejectmsg"), US ERROR_CONTAINS_VIRUS, info); - exiscan_log(LOG_MAIN, EXISCAN_LOG_INFORMATIONAL, return_message); + generate_retmsg(return_message, RETURN_MESSAGE_LEN, exiscan_expand(exiscan_av_rejectmsg,US"exiscan_av_rejectmsg"), US ERROR_EXT_CONTAINS_VIRUS, info); + generate_retmsg(log_message, RETURN_MESSAGE_LEN, NULL, US ERROR_INT_CONTAINS_VIRUS, info); + exiscan_log(LOG_MAIN, EXISCAN_LOG_INFORMATIONAL, log_message); if ( exiscan_do_action(US"av",exiscan_expand(exiscan_av_action,US"exiscan_av_action"), &retcode) ) goto EXIT_EXISCAN; break; case 2: // error retcode = LOCAL_SCAN_TEMPREJECT; - generate_retmsg(return_message, RETURN_MESSAGE_LEN, NULL, US ERROR_TEMPORARY_PROBLEM, info); - exiscan_log(LOG_MAIN, EXISCAN_LOG_CRITICAL, return_message); + generate_retmsg(return_message, RETURN_MESSAGE_LEN, NULL, US ERROR_EXT_TEMPORARY_PROBLEM, info); + generate_retmsg(log_message, RETURN_MESSAGE_LEN, NULL, US ERROR_INT_TEMPORARY_PROBLEM, info); + exiscan_log(LOG_MAIN, EXISCAN_LOG_CRITICAL, log_message); goto EXIT_EXISCAN; break; }; @@ -147,15 +154,17 @@ case 1: // extension found exiscan_add_header(EXTENSION_HEADER,info); - generate_retmsg(return_message, RETURN_MESSAGE_LEN, exiscan_expand(exiscan_extension_rejectmsg,US"exiscan_extension_rejectmsg"), US ERROR_CONTAINS_FILE, info); - exiscan_log(LOG_MAIN, EXISCAN_LOG_INFORMATIONAL, return_message); + generate_retmsg(return_message, RETURN_MESSAGE_LEN, exiscan_expand(exiscan_extension_rejectmsg,US"exiscan_extension_rejectmsg"), US ERROR_EXT_CONTAINS_FILE, info); + generate_retmsg(log_message, RETURN_MESSAGE_LEN, NULL, US ERROR_INT_CONTAINS_FILE, info); + exiscan_log(LOG_MAIN, EXISCAN_LOG_INFORMATIONAL, log_message); if ( exiscan_do_action(US"extension",exiscan_expand(exiscan_extension_action,US"exiscan_extension_action"), &retcode) ) goto EXIT_EXISCAN; break; case 2: // error retcode = LOCAL_SCAN_TEMPREJECT; - generate_retmsg(return_message, RETURN_MESSAGE_LEN, NULL, US ERROR_TEMPORARY_PROBLEM, info); - exiscan_log(LOG_MAIN, EXISCAN_LOG_CRITICAL, return_message); + generate_retmsg(return_message, RETURN_MESSAGE_LEN, NULL, US ERROR_EXT_TEMPORARY_PROBLEM, info); + generate_retmsg(log_message, RETURN_MESSAGE_LEN, NULL, US ERROR_INT_TEMPORARY_PROBLEM, info); + exiscan_log(LOG_MAIN, EXISCAN_LOG_CRITICAL, log_message); goto EXIT_EXISCAN; break; }; @@ -171,15 +180,17 @@ case 1: // regex found exiscan_add_header(REGEX_HEADER,info); - generate_retmsg(return_message, RETURN_MESSAGE_LEN, exiscan_expand(exiscan_regex_rejectmsg,US"exiscan_regex_rejectmsg"), US ERROR_CONTAINS_REGEX, info); - exiscan_log(LOG_MAIN, EXISCAN_LOG_INFORMATIONAL, return_message); + generate_retmsg(return_message, RETURN_MESSAGE_LEN, exiscan_expand(exiscan_regex_rejectmsg,US"exiscan_regex_rejectmsg"), US ERROR_EXT_CONTAINS_REGEX, info); + generate_retmsg(log_message, RETURN_MESSAGE_LEN, NULL, US ERROR_INT_CONTAINS_REGEX, info); + exiscan_log(LOG_MAIN, EXISCAN_LOG_INFORMATIONAL, log_message); if ( exiscan_do_action(US"regex",exiscan_expand(exiscan_regex_action, US"exiscan_regex_action"), &retcode) ) goto EXIT_EXISCAN; break; case 2: // error retcode = LOCAL_SCAN_TEMPREJECT; - generate_retmsg(return_message, RETURN_MESSAGE_LEN, NULL, US ERROR_TEMPORARY_PROBLEM, info); - exiscan_log(LOG_MAIN, EXISCAN_LOG_CRITICAL, return_message); + generate_retmsg(return_message, RETURN_MESSAGE_LEN, NULL, US ERROR_EXT_TEMPORARY_PROBLEM, info); + generate_retmsg(log_message, RETURN_MESSAGE_LEN, NULL, US ERROR_INT_TEMPORARY_PROBLEM, info); + exiscan_log(LOG_MAIN, EXISCAN_LOG_CRITICAL, log_message); goto EXIT_EXISCAN; break; }; @@ -227,15 +238,17 @@ exiscan_add_header(US"Subject",newsubject); }; - generate_retmsg(return_message, RETURN_MESSAGE_LEN, exiscan_expand(exiscan_spamd_rejectmsg,US"exiscan_spamd_rejectmsg"), US ERROR_CONTAINS_SPAM, info); - exiscan_log(LOG_MAIN, EXISCAN_LOG_INFORMATIONAL, return_message); + generate_retmsg(return_message, RETURN_MESSAGE_LEN, exiscan_expand(exiscan_spamd_rejectmsg,US"exiscan_spamd_rejectmsg"), US ERROR_EXT_CONTAINS_SPAM, info); + generate_retmsg(log_message, RETURN_MESSAGE_LEN, NULL, US ERROR_INT_CONTAINS_SPAM, info); + exiscan_log(LOG_MAIN, EXISCAN_LOG_INFORMATIONAL, log_message); if ( exiscan_do_action(US"spamd",exiscan_expand(exiscan_spamd_action,US"exiscan_spamd_action"), &retcode) ) goto EXIT_EXISCAN; break; case 2: // error, we just log it but let the message past retcode = LOCAL_SCAN_ACCEPT; - generate_retmsg(return_message, RETURN_MESSAGE_LEN, NULL, US ERROR_TEMPORARY_PROBLEM, info); - exiscan_log(LOG_MAIN, EXISCAN_LOG_CRITICAL, return_message); + generate_retmsg(return_message, RETURN_MESSAGE_LEN, NULL, US ERROR_EXT_TEMPORARY_PROBLEM, info); + generate_retmsg(log_message, RETURN_MESSAGE_LEN, NULL, US ERROR_INT_TEMPORARY_PROBLEM, info); + exiscan_log(LOG_MAIN, EXISCAN_LOG_CRITICAL, log_message); break; }; };