diff -urN src.orig/globals.c src/globals.c --- src.orig/globals.c 2004-09-09 18:02:23.000000000 +0300 +++ src/globals.c 2004-09-09 18:07:57.000000000 +0300 @@ -2,7 +2,7 @@ * Exim - an Internet mail transport agent * *************************************************/ -/* Copyright (c) University of Cambridge 1995 - 2004 */ +/* Copyright (c) University of Cambridge 1995 - 2003 */ /* See the file NOTICE for conditions of use and distribution. */ /* All the global variables are defined together in this one module, so @@ -78,7 +78,7 @@ #endif #ifdef LOOKUP_PGSQL -uschar *pgsql_servers = NULL; +uschar *pgsql_servers = NULL; #endif #ifdef SUPPORT_MOVE_FROZEN_MESSAGES @@ -98,7 +98,6 @@ const pcre *regex_STARTTLS = NULL; uschar *tls_advertise_hosts = NULL; /* This is deliberate */ uschar *tls_certificate = NULL; -uschar *tls_crl = NULL; uschar *tls_dhparam = NULL; BOOL tls_offered = FALSE; BOOL tls_on_connect = FALSE; @@ -160,7 +159,6 @@ uschar *acl_smtp_helo = NULL; uschar *acl_smtp_mail = NULL; uschar *acl_smtp_mailauth = NULL; -uschar *acl_smtp_mime = NULL; uschar *acl_smtp_rcpt = NULL; uschar *acl_smtp_starttls = NULL; uschar *acl_smtp_vrfy = NULL; @@ -181,7 +179,6 @@ US"EHLO or HELO", US"MAIL", US"MAILAUTH", - US"MIME", US"RCPT", US"STARTTLS", US"VRFY", @@ -195,7 +192,6 @@ 550, /* HELO/EHLO */ 550, /* MAIL */ 0, /* MAILAUTH; not relevant */ - 550, /* MIME */ 550, /* RCPT */ 550, /* STARTTLS */ 252, /* VRFY */ @@ -298,7 +294,9 @@ uschar *auth_defer_msg = US"reason not recorded"; uschar *auth_defer_user_msg = US""; int auto_thaw = 0; -uschar *av_scanner = US"sophie:/var/run/sophie"; +uschar *av_scanner1 = US"sophie:/var/run/sophie"; +uschar *av_scanner2 = NULL; +uschar *av_scanner3 = NULL; BOOL background_daemon = TRUE; uschar *base62_chars= @@ -306,14 +304,6 @@ uschar *bi_command = NULL; uschar *big_buffer = NULL; int big_buffer_size = BIG_BUFFER_SIZE; -#ifdef BRIGHTMAIL -uschar *bmi_alt_location = NULL; -uschar *bmi_base64_verdict = NULL; -uschar *bmi_config_file = US"/opt/brightmail/etc/brightmail.cfg"; -int bmi_deliver = 1; -int bmi_run = 0; -uschar *bmi_verdicts = NULL; -#endif int body_linecount = 0; uschar *bounce_message_file = NULL; uschar *bounce_message_text = NULL; @@ -341,7 +331,7 @@ uschar *config_filename = NULL; int config_lineno = 0; uschar *config_main_filelist = US CONFIGURE_FILE - "\0<-----------Space to patch configure_filename->"; + "\0<-----------Space to patch configure_filename->"; uschar *config_main_filename = NULL; int connection_max_messages= -1; uschar *continue_hostname = NULL; @@ -452,7 +442,7 @@ gid_t exim_gid = EXIM_GID; BOOL exim_gid_set = TRUE; /* This gid is always set */ uschar *exim_path = US BIN_DIRECTORY "/exim" - "\0<---------------Space to patch exim_path->"; + "\0<---------------Space to patch exim_path->"; uid_t exim_uid = EXIM_UID; BOOL exim_uid_set = TRUE; /* This uid is always set */ uschar *exiscan_version_string = US"??"; @@ -563,57 +553,43 @@ tree_node *localpartlist_anchor= NULL; int localpartlist_count = 0; uschar *log_buffer = NULL; -unsigned int log_extra_selector = LX_default; uschar *log_file_path = US LOG_FILE_PATH - "\0<--------------Space to patch log_file_path->"; - -/* Those log options with L_xxx identifiers have values less than 0x800000 and -are the ones that get put into log_write_selector. They can be used in calls to -log_write() to test for the bit. The options with LX_xxx identifiers have -values greater than 0x80000000 and are put int log_extra_selector (without the -top bit). They are never used in calls to log_write(), but are tested -independently. This separation became necessary when the number of log -selectors was getting close to filling a 32-bit word. */ - + "\0<--------------Space to patch log_file_path->"; bit_table log_options[] = { { US"address_rewrite", L_address_rewrite }, { US"all", L_all }, { US"all_parents", L_all_parents }, - { US"arguments", LX_arguments }, + { US"arguments", L_arguments }, { US"connection_reject", L_connection_reject }, { US"delay_delivery", L_delay_delivery }, - { US"deliver_time", LX_deliver_time }, - { US"delivery_size", LX_delivery_size }, + { US"delivery_size", L_delivery_size }, { US"dnslist_defer", L_dnslist_defer }, { US"etrn", L_etrn }, { US"host_lookup_failed", L_host_lookup_failed }, - { US"incoming_interface", LX_incoming_interface }, - { US"incoming_port", LX_incoming_port }, + { US"incoming_interface", L_incoming_interface }, + { US"incoming_port", L_incoming_port }, { US"lost_incoming_connection", L_lost_incoming_connection }, - { US"outgoing_port", LX_outgoing_port }, { US"queue_run", L_queue_run }, - { US"queue_time", LX_queue_time }, - { US"received_recipients", LX_received_recipients }, - { US"received_sender", LX_received_sender }, - { US"rejected_header", LX_rejected_header }, - { US"rejected_headers", LX_rejected_header }, + { US"received_recipients", L_received_recipients }, + { US"received_sender", L_received_sender }, + { US"rejected_header", L_rejected_header }, + { US"rejected_headers", L_rejected_header }, { US"retry_defer", L_retry_defer }, - { US"return_path_on_delivery", LX_return_path_on_delivery }, - { US"sender_on_delivery", LX_sender_on_delivery }, + { US"sender_on_delivery", L_sender_on_delivery }, { US"size_reject", L_size_reject }, { US"skip_delivery", L_skip_delivery }, - { US"smtp_confirmation", LX_smtp_confirmation }, + { US"smtp_confirmation", L_smtp_confirmation }, { US"smtp_connection", L_smtp_connection }, { US"smtp_incomplete_transaction", L_smtp_incomplete_transaction }, { US"smtp_protocol_error", L_smtp_protocol_error }, { US"smtp_syntax_error", L_smtp_syntax_error }, - { US"subject", LX_subject }, - { US"tls_cipher", LX_tls_cipher }, - { US"tls_peerdn", LX_tls_peerdn } + { US"subject", L_subject }, + { US"tls_cipher", L_tls_cipher }, + { US"tls_peerdn", L_tls_peerdn } }; int log_options_count = sizeof(log_options)/sizeof(bit_table); -unsigned int log_write_selector= L_default; +unsigned int log_selector = L_default; uschar *log_selector_string = NULL; FILE *log_stderr = NULL; BOOL log_testing_mode = FALSE; @@ -645,25 +621,8 @@ uschar *message_size_limit = US"50M"; uschar message_subdir[2] = { 0, 0 }; uschar *message_reference = NULL; -uschar *mime_anomaly_level = NULL; -uschar *mime_anomaly_text = NULL; -uschar *mime_boundary = NULL; -uschar *mime_charset = NULL; -uschar *mime_content_description = NULL; -uschar *mime_content_disposition = NULL; -uschar *mime_content_id = NULL; -unsigned int mime_content_size = 0; -uschar *mime_content_transfer_encoding = NULL; -uschar *mime_content_type = NULL; -uschar *mime_decoded_filename = NULL; -uschar *mime_filename = NULL; -int mime_is_multipart = 0; -int mime_is_coverletter = 0; -int mime_is_rfc822 = 0; -int mime_part_count = -1; uid_t *never_users = NULL; -BOOL no_mbox_unspool = FALSE; uid_t original_euid; gid_t originator_gid; @@ -677,7 +636,7 @@ BOOL parse_found_group = FALSE; uschar *percent_hack_domains = NULL; uschar *pid_file_path = US PID_FILE_PATH - "\0<--------------Space to patch pid_file_path->"; + "\0<--------------Space to patch pid_file_path->"; uschar *pipelining_advertise_hosts = US"*"; BOOL preserve_message_logs = FALSE; uschar *primary_hostname = NULL; @@ -786,9 +745,6 @@ NULL, /* driver name */ NULL, /* address_data */ -#ifdef BRIGHTMAIL - NULL, /* bmi_rule */ -#endif NULL, /* cannot_route_message */ NULL, /* condition */ NULL, /* current_directory */ @@ -817,11 +773,6 @@ NULL, /* transport_name */ TRUE, /* address_test */ -#ifdef BRIGHTMAIL - FALSE, /* bmi_deliver_alternate */ - FALSE, /* bmi_deliver_default */ - FALSE, /* bmi_dont_deliver */ -#endif TRUE, /* expn */ FALSE, /* caseful_local_part */ FALSE, /* check_local_user */ @@ -912,7 +863,7 @@ BOOL smtp_authenticated = FALSE; uschar *smtp_banner = US"$primary_hostname ESMTP " "Exim $version_number $tod_full" - "\0<---------------Space to patch smtp_banner->"; + "\0<---------------Space to patch smtp_banner->"; BOOL smtp_batched_input = FALSE; BOOL smtp_check_spool_space = TRUE; uschar *smtp_command_argument = NULL; @@ -953,7 +904,7 @@ uschar *spam_score_int = NULL; BOOL split_spool_directory = FALSE; uschar *spool_directory = US SPOOL_DIRECTORY - "\0<--------------Space to patch spool_directory->"; + "\0<--------------Space to patch spool_directory->"; int string_datestamp_offset= -1; BOOL strip_excess_angle_brackets = FALSE; BOOL strip_trailing_dot = FALSE; @@ -1081,9 +1032,8 @@ uschar *warn_message_file = NULL; uschar *warnmsg_delay = NULL; uschar *warnmsg_recipients = NULL; -BOOL write_rejectlog = TRUE; -uschar *version_copyright = US"Copyright (c) University of Cambridge 2004"; +uschar *version_copyright = US"Copyright (c) University of Cambridge 2003"; uschar *version_date = US"?"; uschar *version_cnumber = US"????"; uschar *version_string = US"?"; diff -urN src.orig/globals.h src/globals.h --- src.orig/globals.h 2004-09-09 18:02:25.000000000 +0300 +++ src/globals.h 2004-09-09 18:07:57.000000000 +0300 @@ -2,7 +2,7 @@ * Exim - an Internet mail transport agent * *************************************************/ -/* Copyright (c) University of Cambridge 1995 - 2004 */ +/* Copyright (c) University of Cambridge 1995 - 2003 */ /* See the file NOTICE for conditions of use and distribution. */ /* Almost all the global variables are defined together in this one header, so @@ -62,7 +62,6 @@ extern const pcre *regex_STARTTLS; /* For recognizing STARTTLS settings */ extern uschar *tls_advertise_hosts; /* host for which TLS is advertised */ extern uschar *tls_certificate; /* Certificate file */ -extern uschar *tls_crl; /* CRL File */ extern uschar *tls_dhparam; /* DH param file */ extern BOOL tls_offered; /* Server offered TLS */ extern BOOL tls_on_connect; /* For older MTAs that don't STARTTLS */ @@ -102,7 +101,6 @@ extern uschar *acl_smtp_helo; /* ACL run after HELO/EHLO */ extern uschar *acl_smtp_mail; /* ACL run after MAIL */ extern uschar *acl_smtp_mailauth; /* ACL run after MAIL AUTH */ -extern uschar *acl_smtp_mime; /* ACL run after DATA, before acl_smtp_data, for each MIME part */ extern uschar *acl_smtp_rcpt; /* ACL run after RCPT */ extern uschar *acl_smtp_starttls; /* ACL run after STARTTLS */ extern uschar *acl_smtp_vrfy; /* ACL run after VRFY */ @@ -137,21 +135,15 @@ extern uschar *auth_defer_msg; /* Error message for log */ extern uschar *auth_defer_user_msg; /* Error message for user */ extern int auto_thaw; /* Auto-thaw interval */ -extern uschar *av_scanner; /* AntiVirus scanner to use for the malware condition */ +extern uschar *av_scanner1; /* AntiVirus scanner to use for the malware condition */ +extern uschar *av_scanner2; /* AntiVirus scanner to use for the malware condition */ +extern uschar *av_scanner3; /* AntiVirus scanner to use for the malware condition */ extern BOOL background_daemon; /* Set FALSE to keep in foreground */ extern uschar *base62_chars; /* Table of base-62 characters */ extern uschar *bi_command; /* Command for -bi option */ extern uschar *big_buffer; /* Used for various temp things */ extern int big_buffer_size; /* Current size (can expand) */ -#ifdef BRIGHTMAIL -extern uschar *bmi_alt_location; /* expansion variable that contains the alternate location for the rcpt (available during routing) */ -extern uschar *bmi_base64_verdict; /* expansion variable with base-64 encoded verdict string (available during routing) */ -extern uschar *bmi_config_file; /* Brightmail config file */ -extern int bmi_deliver; /* Flag that determines if the message should be delivered to the rcpt (available during routing) */ -extern int bmi_run; /* Flag that determines if message should be run through Brightmail server */ -extern uschar *bmi_verdicts; /* BASE64-encoded verdicts with recipient lists */ -#endif extern int body_linecount; /* Line count in body */ extern uschar *bounce_message_file; /* Template file */ extern uschar *bounce_message_text; /* One-liner */ @@ -340,11 +332,10 @@ extern tree_node *localpartlist_anchor;/* Tree of defined localpart lists */ extern int localpartlist_count; /* Number defined */ extern uschar *log_buffer; /* For constructing log entries */ -extern unsigned int log_extra_selector;/* Bit map of logging options other than used by log_write() */ extern uschar *log_file_path; /* If unset, use default */ extern bit_table log_options[]; /* Table of options */ extern int log_options_count; /* Size of table */ -extern unsigned int log_write_selector;/* Bit map of logging options for log_write() */ +extern unsigned int log_selector; /* Bit map of logging options */ extern uschar *log_selector_string; /* As supplied in the config */ extern FILE *log_stderr; /* Copy of stderr for log use, or NULL */ extern BOOL log_testing_mode; /* TRUE in various testing modes */ @@ -377,25 +368,8 @@ extern uschar *message_size_limit; /* As it says */ extern uschar message_subdir[]; /* Subdirectory for messages */ extern uschar *message_reference; /* Reference for error messages */ -extern uschar *mime_anomaly_level; -extern uschar *mime_anomaly_text; -extern uschar *mime_boundary; -extern uschar *mime_charset; -extern uschar *mime_content_description; -extern uschar *mime_content_disposition; -extern uschar *mime_content_id; -extern unsigned int mime_content_size; -extern uschar *mime_content_transfer_encoding; -extern uschar *mime_content_type; -extern uschar *mime_decoded_filename; -extern uschar *mime_filename; -extern int mime_is_multipart; -extern int mime_is_coverletter; -extern int mime_is_rfc822; -extern int mime_part_count; extern uid_t *never_users; /* List of uids never to be used */ -extern BOOL no_mbox_unspool; /* don't unspool exiscan files */ extern optionlist optionlist_auths[]; /* These option lists are made */ extern int optionlist_auths_size; /* global so that readconf can */ @@ -627,7 +601,6 @@ extern uschar *warn_message_file; /* Template for warning messages */ extern uschar *warnmsg_delay; /* String form of delay time */ extern uschar *warnmsg_recipients; /* Recipients of warning message */ -extern BOOL write_rejectlog; /* Control of reject logging */ extern uschar *version_copyright; /* Copyright notice */ extern uschar *version_date; /* Date of compilation */ diff -urN src.orig/malware.c src/malware.c --- src.orig/malware.c 2004-09-09 18:02:37.000000000 +0300 +++ src/malware.c 2004-09-09 18:07:57.000000000 +0300 @@ -27,13 +27,13 @@ /* Routine to check whether a system is big- or litte-endian. Ripped from http://www.faqs.org/faqs/graphics/fileformats-faq/part4/section-7.html Needed for proper kavdaemon implementation. Sigh. */ -#define BIG_MY_ENDIAN 0 -#define LITTLE_MY_ENDIAN 1 +#define BIG_ENDIAN 0 +#define LITTLE_ENDIAN 1 int test_byte_order(void); int test_byte_order() { short int word = 0x0001; char *byte = (char *) &word; - return(byte[0] ? LITTLE_MY_ENDIAN : BIG_MY_ENDIAN); + return(byte[0] ? LITTLE_ENDIAN : BIG_ENDIAN); } uschar malware_name_buffer[256]; @@ -42,7 +42,8 @@ int malware(uschar **listptr) { int sep = 0; uschar *list = *listptr; - uschar *av_scanner_work = av_scanner; + /* uschar *av_scanner_work = av_scanner; */ + uschar *av_scanner_work; uschar *scanner_name; uschar scanner_name_buffer[16]; uschar *malware_regex; @@ -51,6 +52,7 @@ unsigned long long mbox_size; FILE *mbox_file; int roffset; + int malware_offset = 1; const pcre *re; const uschar *rerror; @@ -101,6 +103,9 @@ /* Do not scan twice. */ if (malware_ok == 0) { + av_scanner_work = av_scanner1; + while (av_scanner_work != "" && av_scanner_work != NULL) { + /* find the scanner type from the av_scanner option */ if ((scanner_name = string_nextinlist(&av_scanner_work, &sep, scanner_name_buffer, @@ -179,7 +184,7 @@ spool_directory, message_id, message_id); /* calc file size */ - drweb_fd = open(CS scanrequest, O_RDONLY); + drweb_fd = open(scanrequest, O_RDONLY); if (drweb_fd == -1) { log_write(0, LOG_MAIN|LOG_PANIC, "malware acl condition: drweb: can't open spool file %s: %s", @@ -418,7 +423,7 @@ } /* get errorcode from one nibble */ - if (test_byte_order() == LITTLE_MY_ENDIAN) { + if (test_byte_order() == LITTLE_ENDIAN) { kav_rc = tmpbuf[0] & 0x0F; } else { @@ -458,7 +463,7 @@ Ustrcpy(malware_name_buffer,"unknown"); malware_name = malware_name_buffer; - if (test_byte_order() == LITTLE_MY_ENDIAN) { + if (test_byte_order() == LITTLE_ENDIAN) { report_flag = tmpbuf[1]; } else { @@ -953,7 +958,23 @@ /* set "been here, done that" marker */ malware_ok = 1; - }; + + + + /* Loop through malwarescanners */ + switch (malware_offset) + { + case 1: malware_offset = 2; + av_scanner_work = av_scanner2; + break; + case 2: malware_offset = 3; + av_scanner_work = av_scanner3; + break; + } + + if (malware_name != NULL || malware_offset == 3) break; + }; /* while av_scanner_work != "" */ +}; /* if malware_ok) /* match virus name against pattern (caseless ------->----------v) */ if ( (malware_name != NULL) && @@ -996,6 +1017,7 @@ break; } } + return 0; } int mksd_read_lines (int sock, uschar *av_buffer, int av_buffer_size) diff -urN src.orig/readconf.c src/readconf.c --- src.orig/readconf.c 2004-09-09 18:06:36.000000000 +0300 +++ src/readconf.c 2004-09-09 18:07:57.000000000 +0300 @@ -2,7 +2,7 @@ * Exim - an Internet mail transport agent * *************************************************/ -/* Copyright (c) University of Cambridge 1995 - 2004 */ +/* Copyright (c) University of Cambridge 1995 - 2003 */ /* See the file NOTICE for conditions of use and distribution. */ /* Functions for reading the configuration file, and for displaying @@ -141,7 +141,6 @@ { "acl_smtp_helo", opt_stringptr, &acl_smtp_helo }, { "acl_smtp_mail", opt_stringptr, &acl_smtp_mail }, { "acl_smtp_mailauth", opt_stringptr, &acl_smtp_mailauth }, - { "acl_smtp_mime", opt_stringptr, &acl_smtp_mime }, { "acl_smtp_rcpt", opt_stringptr, &acl_smtp_rcpt }, #ifdef SUPPORT_TLS { "acl_smtp_starttls", opt_stringptr, &acl_smtp_starttls }, @@ -153,11 +152,10 @@ { "allow_utf8_domains", opt_bool, &allow_utf8_domains }, { "auth_advertise_hosts", opt_stringptr, &auth_advertise_hosts }, { "auto_thaw", opt_time, &auto_thaw }, - { "av_scanner", opt_stringptr, &av_scanner }, + { "av_scanner1", opt_stringptr, &av_scanner1 }, + { "av_scanner2", opt_stringptr, &av_scanner2 }, + { "av_scanner3", opt_stringptr, &av_scanner3 }, { "bi_command", opt_stringptr, &bi_command }, -#ifdef BRIGHTMAIL - { "bmi_config_file", opt_stringptr, &bmi_config_file }, -#endif { "bounce_message_file", opt_stringptr, &bounce_message_file }, { "bounce_message_text", opt_stringptr, &bounce_message_text }, { "bounce_return_body", opt_bool, &bounce_return_body }, @@ -338,7 +336,6 @@ #ifdef SUPPORT_TLS { "tls_advertise_hosts", opt_stringptr, &tls_advertise_hosts }, { "tls_certificate", opt_stringptr, &tls_certificate }, - { "tls_crl", opt_stringptr, &tls_crl }, { "tls_dhparam", opt_stringptr, &tls_dhparam }, { "tls_privatekey", opt_stringptr, &tls_privatekey }, { "tls_remember_esmtp", opt_bool, &tls_remember_esmtp }, @@ -353,8 +350,7 @@ { "untrusted_set_sender", opt_stringptr, &untrusted_set_sender }, { "uucp_from_pattern", opt_stringptr, &uucp_from_pattern }, { "uucp_from_sender", opt_stringptr, &uucp_from_sender }, - { "warn_message_file", opt_stringptr, &warn_message_file }, - { "write_rejectlog", opt_bool, &write_rejectlog } + { "warn_message_file", opt_stringptr, &warn_message_file } }; static int optionlist_config_size = @@ -2365,7 +2361,6 @@ numberp points to the current number for this tree max the maximum number permitted s the text of the option line, starting immediately after the name - of the list type tname the name of the list type, for messages Returns: nothing @@ -2375,17 +2370,10 @@ read_named_list(tree_node **anchorp, int *numberp, int max, uschar *s, uschar *tname) { -BOOL forcecache = FALSE; uschar *ss; tree_node *t; namedlist_block *nb = store_get(sizeof(namedlist_block)); -if (Ustrncmp(s, "_cache", 6) == 0) - { - forcecache = TRUE; - s += 6; - } - if (!isspace(*s)) log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN, "unrecognized configuration line"); @@ -2416,9 +2404,9 @@ nb->cache_data = NULL; /* Check the string for any expansions; if any are found, mark this list -uncacheable unless the user has explicited forced caching. */ +uncacheable. */ -if (!forcecache && Ustrchr(nb->string, '$') != NULL) nb->number = -1; +if (Ustrchr(nb->string, '$') != NULL) nb->number = -1; }