7 /* address resolving, client interface
11 /* void tok822_resolve(addr, reply)
13 /* RESOLVE_REPLY *reply;
15 /* void tok822_resolve_from(sender, addr, reply)
16 /* const char *sender;
18 /* RESOLVE_REPLY *reply;
20 /* tok822_resolve() takes an address token tree and finds out the
21 /* transport to deliver via, the next-hop host on that transport,
22 /* and the recipient relative to that host.
24 /* tok822_resolve_from() allows the caller to specify sender context
25 /* that will be used to look up sender-dependent relayhost information.
27 /* resolve_clnt(3) basic resolver client interface
31 /* The Secure Mailer license must be distributed with this software.
34 /* IBM T.J. Watson Research
36 /* Yorktown Heights, NY 10598, USA
43 /* Utility library. */
50 #include "resolve_clnt.h"
53 /* tok822_resolve - address rewriting interface */
55 void tok822_resolve_from(const char *sender
, TOK822
*addr
,
58 VSTRING
*intern_form
= vstring_alloc(100);
60 if (addr
->type
!= TOK822_ADDR
)
61 msg_panic("tok822_resolve: non-address token type: %d", addr
->type
);
64 * Internalize the token tree and ship it to the resolve service.
65 * Shipping string forms is much simpler than shipping parse trees.
67 tok822_internalize(intern_form
, addr
->head
, TOK822_STR_DEFL
);
68 resolve_clnt_query_from(sender
, vstring_str(intern_form
), reply
);
70 msg_info("tok822_resolve: from=%s addr=%s -> chan=%s, host=%s, rcpt=%s",
72 vstring_str(intern_form
), vstring_str(reply
->transport
),
73 vstring_str(reply
->nexthop
), vstring_str(reply
->recipient
));
75 vstring_free(intern_form
);