X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/b0e63c7efdc2133c61545b051042d3617ecd2bbd..90bd3832bc0ff090ac5e37dfc66b30cabb9cfc1a:/src/src/verify.c diff --git a/src/src/verify.c b/src/src/verify.c index 194e9a76a..78923651c 100644 --- a/src/src/verify.c +++ b/src/src/verify.c @@ -368,6 +368,7 @@ if (addr->transport == cutthrough.addr.transport) host_af = Ustrchr(host->address, ':') ? AF_INET6 : AF_INET; + GET_OPTION("interface"); if ( !smtp_get_interface(tf->interface, host_af, addr, &interface, US"callout") || !smtp_get_port(tf->port, addr, &port, US"callout") @@ -579,10 +580,14 @@ else with a random local part, ensure that such a local part is available. If not, log the fact, but carry on without randomising. */ - if (options & vopt_callout_random && callout_random_local_part) - if (!(random_local_part = expand_string(callout_random_local_part))) + if (options & vopt_callout_random) + { + GET_OPTION("callout_random_local_part"); + if ( callout_random_local_part + && !(random_local_part = expand_string(callout_random_local_part))) log_write(0, LOG_MAIN|LOG_PANIC, "failed to expand " "callout_random_local_part: %s", expand_string_message); + } /* Compile regex' used by client-side smtp */ @@ -660,6 +665,7 @@ coding means skipping this whole loop and doing the append separately. */ deliver_domain = addr->domain; transport_name = addr->transport->name; + GET_OPTION("interface"); if ( !smtp_get_interface(tf->interface, host_af, addr, &interface, US"callout") || !smtp_get_port(tf->port, addr, &port, US"callout") @@ -823,7 +829,7 @@ tls_retry_connection: /* Remember when we last did a random test */ new_domain_record.random_stamp = time(NULL); - if (smtp_write_mail_and_rcpt_cmds(sx, &yield) == 0) + if (smtp_write_mail_and_rcpt_cmds(sx, &yield) == sw_mrc_ok) switch(addr->transport_return) { case PENDING_OK: /* random was accepted, unfortunately */ @@ -891,33 +897,34 @@ tls_retry_connection: done = FALSE; switch(smtp_write_mail_and_rcpt_cmds(sx, &yield)) { - case 0: switch(addr->transport_return) /* ok so far */ - { - case PENDING_OK: done = TRUE; - new_address_record.result = ccache_accept; - break; - case FAIL: done = TRUE; - yield = FAIL; - *failure_ptr = US"recipient"; - new_address_record.result = ccache_reject; - break; - default: break; - } - break; + case sw_mrc_ok: + switch(addr->transport_return) /* ok so far */ + { + case PENDING_OK: done = TRUE; + new_address_record.result = ccache_accept; + break; + case FAIL: done = TRUE; + yield = FAIL; + *failure_ptr = US"recipient"; + new_address_record.result = ccache_reject; + break; + default: break; + } + break; - case -1: /* MAIL response error */ - *failure_ptr = US"mail"; - if (errno == 0 && sx->buffer[0] == '5') - { - setflag(addr, af_verify_nsfail); - if (from_address[0] == 0) - new_domain_record.result = ccache_reject_mfnull; - } - break; - /* non-MAIL read i/o error */ - /* non-MAIL response timeout */ - /* internal error; channel still usable */ - default: break; /* transmit failed */ + case sw_mrc_bad_mail: /* MAIL response error */ + *failure_ptr = US"mail"; + if (errno == 0 && sx->buffer[0] == '5') + { + setflag(addr, af_verify_nsfail); + if (from_address[0] == 0) + new_domain_record.result = ccache_reject_mfnull; + } + break; + /* non-MAIL read i/o error */ + /* non-MAIL response timeout */ + /* internal error; channel still usable */ + default: break; /* transmit failed */ } } @@ -955,7 +962,7 @@ tls_retry_connection: sx->completed_addr = FALSE; sx->avoid_option = OPTION_SIZE; - if( smtp_write_mail_and_rcpt_cmds(sx, &yield) == 0 + if( smtp_write_mail_and_rcpt_cmds(sx, &yield) == sw_mrc_ok && addr->transport_return == PENDING_OK ) done = TRUE;