tedious per host_address checks. Note that at this stage smtp_accept_count
contains the count of *other* connections, not including this one. */
-if (max_for_this_host > 0 && smtp_accept_count >= max_for_this_host)
+if ( smtp_slots
+ && max_for_this_host > 0 && smtp_accept_count >= max_for_this_host)
{
int host_accept_count = 0;
int other_host_count = 0; /* keep a count of non matches to optimise */
arrange to unset the selector in the subprocess.
jgh 2023/08/08 :- moved this logging in from the parent process, just
- pre-fork. There was a claim back from 2004 that smtp_accept_count could have
- become out-of-date by the time the child could log it, and I can't see how
- that could happen. */
+ pre-fork. There was a claim back from 4.21 (when it was moved from
+ smtp_start_session()) that smtp_accept_count could have become out-of-date by
+ the time the child could log it, and I can't see how that could happen. */
if (LOGGING(smtp_connection))
{
save_log_selector &= ~L_smtp_connection;
else if (LOGGING(connection_id))
log_write(L_smtp_connection, LOG_MAIN, "SMTP connection from %Y "
- "Ci=%lu (TCP/IP connection count = %d)", whofrom, connection_id, smtp_accept_count);
+ "Ci=%lu (TCP/IP connection count = %d)",
+ whofrom, connection_id, smtp_accept_count);
else
log_write(L_smtp_connection, LOG_MAIN, "SMTP connection from %Y "
"(TCP/IP connection count = %d)", whofrom, smtp_accept_count);
if (pid < 0)
never_error(US"daemon: accept process fork failed", US"Fork failed", errno);
-else
+else if (smtp_slots)
{
for (int i = 0; i < smtp_accept_max; ++i)
if (smtp_slots[i].pid <= 0)
if (smtp_slots)
{
int i;
- for (i = 0; i < smtp_accept_max; i++)
- if (smtp_slots[i].pid == pid)
+ smtp_slot * sp;
+ for (i = 0, sp = smtp_slots; i < smtp_accept_max; i++, sp++)
+ if (sp->pid == pid)
{
- if (smtp_slots[i].host_address)
- store_free(smtp_slots[i].host_address);
- smtp_slots[i] = empty_smtp_slot;
+ if (sp->host_address)
+ store_free(sp->host_address);
+ *sp = empty_smtp_slot;
if (--smtp_accept_count < 0) smtp_accept_count = 0;
DEBUG(D_any) debug_printf("%d SMTP accept process%s now running\n",
smtp_accept_count, smtp_accept_count == 1 ? "" : "es");
h->dnssec = *ptr == '2' ? DS_YES
: *ptr == '1' ? DS_NO
: DS_UNK;
- ptr++;
addr->host_used = h;
}
- else ptr++;
+ ptr++;
continue_flags = 0;
+#ifndef DISABLE_TLS
if (testflag(addr, af_cert_verified)) continue_flags |= CTF_CV;
+# ifdef SUPPORT_DANE
if (testflag(addr, af_dane_verified)) continue_flags |= CTF_DV;
+# endif
+# ifndef DISABLE_TLS_RESUME
if (testflag(addr, af_tls_resume)) continue_flags |= CTF_TR;
-
+# endif
+#endif
/* Finished with this address */
addr = addr->next;
{
uschar * ptr;
+#ifndef DISABLE_TLS
/* The certificate verification status goes into the flags, in A0 */
if (tls_out.certificate_verified) setflag(addr, af_cert_verified);
-#ifdef SUPPORT_DANE
+# ifdef SUPPORT_DANE
if (tls_out.dane_verified) setflag(addr, af_dane_verified);
-#endif
-#ifndef DISABLE_TLS_RESUME
+# endif
+# ifndef DISABLE_TLS_RESUME
if (tls_out.resumption & RESUME_USED) setflag(addr, af_tls_resume);
-#endif
+# endif
/* Use an X item only if there's something to send */
-#ifndef DISABLE_TLS
if (addr->cipher)
{
ptr = big_buffer + sprintf(CS big_buffer, "%.128s", addr->cipher) + 1;
case ERRNO_SMTPCLOSED:
/* If the peer closed the TCP connection after end-of-data, but before
- we could send QUIT, do TLS close, etc - call it a message error.
- Otherwise, if all the recipients have been dealt with, call a close no
- error at all; each address_item should have a suitable result already
- (2xx: PENDING_OK, 4xx: DEFER, 5xx: FAIL) */
+ we could send QUIT, do TLS close, etc - it is a message error.
+ If not, and all the recipients have been dealt with, call such a close
+ no error at all; each address_item should have a suitable result already
+ (2xx: PENDING_OK, 4xx: DEFER, 5xx: FAIL).
+ Otherwise, it is a non-message error. */
if (!(message_error = Ustrncmp(smtp_command,"end ",4) == 0))
{