static int qmgr_resolve_one(QMGR_MESSAGE *message, RECIPIENT *recipient, const char *addr, RESOLVE_REPLY *reply) { #define QMGR_REDIRECT(rp, tp, np) do { \ (rp)->flags = 0; \ vstring_strcpy((rp)->transport, (tp)); \ vstring_strcpy((rp)->nexthop, (np)); \ } while (0) if ((message->tflags & DEL_REQ_FLAG_MTA_VRFY) == 0) resolve_clnt_query_from(message->sender, addr, reply); else resolve_clnt_verify_from(message->sender, addr, reply); if (reply->flags & RESOLVE_FLAG_FAIL) { QMGR_REDIRECT(reply, MAIL_SERVICE_RETRY, "4.3.0 address resolver failure"); return (0); } else if (reply->flags & RESOLVE_FLAG_ERROR) { QMGR_REDIRECT(reply, MAIL_SERVICE_ERROR, "5.1.3 bad address syntax"); return (0); } else { return (0); } }
void tok822_resolve_from(const char *sender, TOK822 *addr, RESOLVE_REPLY *reply) { VSTRING *intern_form = vstring_alloc(100); if (addr->type != TOK822_ADDR) msg_panic("tok822_resolve: non-address token type: %d", addr->type); /* * Internalize the token tree and ship it to the resolve service. * Shipping string forms is much simpler than shipping parse trees. */ tok822_internalize(intern_form, addr->head, TOK822_STR_DEFL); resolve_clnt_query_from(sender, vstring_str(intern_form), reply); if (msg_verbose) msg_info("tok822_resolve: from=%s addr=%s -> chan=%s, host=%s, rcpt=%s", sender, vstring_str(intern_form), vstring_str(reply->transport), vstring_str(reply->nexthop), vstring_str(reply->recipient)); vstring_free(intern_form); }