Logging-only patch for 8BITMIME; bug 817.
[exim.git] / src / src / smtp_in.c
index 4789fbae0a2eb8ac8d73a755aaa87009e33e5d1e..e3746d99db3147db7e316e6c2f7359dc9d112b5e 100644 (file)
@@ -1037,10 +1037,11 @@ store_reset(reset_point);
 recipients_list = NULL;
 rcpt_count = rcpt_defer_count = rcpt_fail_count =
   raw_recipients_count = recipients_count = recipients_list_max = 0;
-cancel_cutthrough_connection();
+cancel_cutthrough_connection("smtp reset");
 message_linecount = 0;
 message_size = -1;
 acl_added_headers = NULL;
+acl_removed_headers = NULL;
 queue_only_policy = FALSE;
 rcpt_smtp_response = NULL;
 rcpt_smtp_response_same = TRUE;
@@ -3319,10 +3320,20 @@ while (done <= 0)
         some sites want the action that is provided. We recognize both "8BITMIME"
         and "7BIT" as body types, but take no action. */
         case ENV_MAIL_OPT_BODY:
-          if (accept_8bitmime &&
-              (strcmpic(value, US"8BITMIME") == 0 ||
-               strcmpic(value, US"7BIT") == 0) )
-            break;
+          if (accept_8bitmime) {
+            if (strcmpic(value, US"8BITMIME") == 0) {
+              body_8bitmime = 8;
+            } else if (strcmpic(value, US"7BIT") == 0) {
+              body_8bitmime = 7;
+            } else {
+              body_8bitmime = 0;
+              done = synprot_error(L_smtp_syntax_error, 501, NULL,
+                US"invalid data for BODY");
+              goto COMMAND_LOOP;
+            }
+            DEBUG(D_receive) debug_printf("8BITMIME: %d\n", body_8bitmime);
+           break;
+          }
           arg_error = TRUE;
           break;
 
@@ -3991,7 +4002,7 @@ while (done <= 0)
         break;
 
         /* It is perhaps arguable as to which exit ACL should be called here,
-        but as it is probably a situtation that almost never arises, it
+        but as it is probably a situation that almost never arises, it
         probably doesn't matter. We choose to call the real QUIT ACL, which in
         some sense is perhaps "right". */