Added experimental features
[users/jgh/exim.git] / src / src / receive.c
index abde1ce9a6425e431105f096ff0129a28cd6971f..72554f719e400d6eb3a5204e70dbe8291f2b6a7a 100644 (file)
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/receive.c,v 1.4.2.2 2004/12/02 16:33:30 tom Exp $ */
+/* $Cambridge: exim/src/src/receive.c,v 1.4.2.4 2004/12/10 14:59:08 tom Exp $ */
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
@@ -470,6 +470,11 @@ if (recipients_count >= recipients_list_max)
 
 recipients_list[recipients_count].address = recipient;
 recipients_list[recipients_count].pno = pno;
+#ifdef EXPERIMENTAL_BRIGHTMAIL
+recipients_list[recipients_count].bmi_optin = bmi_current_optin;
+/* reset optin string pointer for next recipient */
+bmi_current_optin = NULL;
+#endif
 recipients_list[recipients_count++].errors_to = NULL;
 }
 
@@ -3095,6 +3100,14 @@ signal(SIGINT, SIG_IGN);
 
 deliver_firsttime = TRUE;
 
+#ifdef EXPERIMENTAL_BRIGHTMAIL
+if (bmi_run == 1) {
+  /* rewind data file */
+  lseek(data_fd, (long int)SPOOL_DATA_START_OFFSET, SEEK_SET);
+  bmi_verdicts = bmi_process_message(header_list, data_fd);
+};
+#endif
+
 /* Update the timstamp in our Received: header to account for any time taken by
 an ACL or by local_scan(). The new time is the time that all reception
 processing is complete. */
@@ -3385,11 +3398,7 @@ if (smtp_input)
       smtp_printf("250 OK id=%s\r\n", message_id);
 #else      
         if (fake_reject)
-          {
-            smtp_printf("550-FAKE_REJECT id=%s\r\n", message_id);
-            smtp_printf("550-Your message has been rejected but is being kept for evaluation.\r\n");
-            smtp_printf("550 If it was a legit message, it may still be delivered to the target recipient(s).\r\n");
-          }
+          smtp_respond(550,TRUE,fake_reject_text);
         else  
           smtp_printf("250 OK id=%s\r\n", message_id);      
 #endif     
@@ -3403,11 +3412,7 @@ if (smtp_input)
     else if (smtp_reply[0] != 0)
       {
         if (fake_reject && (smtp_reply[0] == '2'))
-        {
-          smtp_printf("550-FAKE_REJECT id=%s\r\n", message_id);
-          smtp_printf("550-Your message has been rejected but is being kept for evaluation.\r\n");
-          smtp_printf("550 If it was a legit message, it may still be delivered to the target recipient(s).\r\n");
-        }
+          smtp_respond(550,TRUE,fake_reject_text);
         else 
           smtp_printf("%.1024s\r\n", smtp_reply);
       };