-/* $Cambridge: exim/src/src/smtp_in.c,v 1.6 2004/12/16 15:11:47 tom Exp $ */
+/* $Cambridge: exim/src/src/smtp_in.c,v 1.10 2005/01/13 16:22:42 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
*************************************************/
-/* Copyright (c) University of Cambridge 1995 - 2004 */
+/* Copyright (c) University of Cambridge 1995 - 2005 */
/* See the file NOTICE for conditions of use and distribution. */
/* Functions for handling an incoming SMTP call. */
acl_warn_headers = NULL;
queue_only_policy = FALSE;
deliver_freeze = FALSE; /* Can be set by ACL */
-#ifdef WITH_CONTENT_SCAN
fake_reject = FALSE; /* Can be set by ACL */
+#ifdef WITH_CONTENT_SCAN
no_mbox_unspool = FALSE; /* Can be set by ACL */
#endif
submission_mode = FALSE; /* Can be set by ACL */
int i, ptr;
uschar *p, *s, *ss;
+/* If we are running in the test harness, and the incoming call is from
+127.0.0.2 (sic), have a short delay. This makes it possible to test handling of
+input sent too soon (before the banner is output). */
+
+if (running_in_test_harness &&
+ sender_host_address != NULL &&
+ Ustrcmp(sender_host_address, "127.0.0.2") == 0)
+ sleep(1);
+
+/* Default values for certain variables */
+
helo_seen = esmtp = helo_accept_junk = FALSE;
count_nonmail = TRUE_UNSET;
synprot_error_count = unknown_command_count = nonmail_command_count = 0;
if (select(fileno(smtp_in) + 1, (SELECT_ARG2_TYPE *)&fds, NULL, NULL,
&tzero) > 0)
{
+ int rc = read(fileno(smtp_in), smtp_inbuffer, in_buffer_size);
+ if (rc > 150) rc = 150;
+ smtp_inbuffer[rc] = 0;
log_write(0, LOG_MAIN|LOG_REJECT, "SMTP protocol violation: "
"synchronization error (input sent without waiting for greeting): "
- "rejected connection from %s", host_and_ident(TRUE));
+ "rejected connection from %s input=\"%s\"", host_and_ident(TRUE),
+ string_printing(smtp_inbuffer));
smtp_printf("554 SMTP synchronization error\r\n");
return FALSE;
}