- if (done && pm_mailfrom)
- {
- /* Could possibly shift before main verify, just above, and be ok
- for cutthrough. But no way to handle a subsequent rcpt, so just
- refuse any */
- cancel_cutthrough_connection("postmaster verify");
- HDEBUG(D_acl|D_v) debug_printf("Cutthrough cancelled by presence of postmaster verify\n");
-
- done =
- smtp_write_command(&sx.outblock, FALSE, "RSET\r\n") >= 0 &&
- smtp_read_response(&sx.inblock, responsebuffer,
- sizeof(responsebuffer), '2', callout) &&
-
- smtp_write_command(&sx.outblock, FALSE,
- "MAIL FROM:<%s>\r\n", pm_mailfrom) >= 0 &&
- smtp_read_response(&sx.inblock, responsebuffer,
- sizeof(responsebuffer), '2', callout) &&
-
- /* First try using the current domain */
-
- ((
- smtp_write_command(&sx.outblock, FALSE,
- "RCPT TO:<postmaster@%.1000s>\r\n", rcpt_domain) >= 0 &&
- smtp_read_response(&sx.inblock, responsebuffer,
- sizeof(responsebuffer), '2', callout)
- )
-
- ||
-
- /* If that doesn't work, and a full check is requested,
- try without the domain. */
-
- (
- (options & vopt_callout_fullpm) != 0 &&
- smtp_write_command(&sx.outblock, FALSE,
- "RCPT TO:<postmaster>\r\n") >= 0 &&
- smtp_read_response(&sx.inblock, responsebuffer,
- sizeof(responsebuffer), '2', callout)
- ));
-
- /* Sort out the cache record */
-
- new_domain_record.postmaster_stamp = time(NULL);
-
- if (done)
- new_domain_record.postmaster_result = ccache_accept;
- else if (errno == 0 && responsebuffer[0] == '5')
- {
- *failure_ptr = US"postmaster";
- setflag(addr, af_verify_pmfail);
- new_domain_record.postmaster_result = ccache_reject;
- }
- }
- } /* Random not accepted */
- } /* MAIL FROM: accepted */
+ if (done && pm_mailfrom)
+ {
+ /* Could possibly shift before main verify, just above, and be ok
+ for cutthrough. But no way to handle a subsequent rcpt, so just
+ refuse any */
+ cancel_cutthrough_connection(TRUE, US"postmaster verify");
+ HDEBUG(D_acl|D_v) debug_printf_indent("Cutthrough cancelled by presence of postmaster verify\n");
+
+ done = smtp_write_command(sx, SCMD_FLUSH, "RSET\r\n") >= 0
+ && smtp_read_response(sx, sx->buffer, sizeof(sx->buffer), '2', callout);
+
+ if (done)
+ {
+ uschar * main_address = addr->address;
+
+ /*XXX oops, affixes */
+ addr->address = string_sprintf("postmaster@%.1000s", addr->domain);
+ addr->transport_return = PENDING_DEFER;
+
+ sx->from_addr = pm_mailfrom;
+ sx->first_addr = sx->sync_addr = addr;
+ sx->ok = FALSE;
+ sx->send_rset = TRUE;
+ sx->completed_addr = FALSE;
+ sx->avoid_option = OPTION_SIZE;
+
+ if( smtp_write_mail_and_rcpt_cmds(sx, &yield) == 0
+ && addr->transport_return == PENDING_OK
+ )
+ done = TRUE;
+ else
+ done = (options & vopt_callout_fullpm) != 0
+ && smtp_write_command(sx, SCMD_FLUSH,
+ "RCPT TO:<postmaster>\r\n") >= 0
+ && smtp_read_response(sx, sx->buffer,
+ sizeof(sx->buffer), '2', callout);
+
+ /* Sort out the cache record */
+
+ new_domain_record.postmaster_stamp = time(NULL);