PHQUERY(8L) 1989 PHQUERY(8L) NNAAMMEE phquery - fuzzy address resolver backend for sendmail SSYYNNOOPPSSIISS pphhqquueerryy [ --dd ] [ --ii ] [ --ll ] [ --pp ] [ --xx _s_e_r_v_i_c_e__t_y_p_e ] [ --ff _f_r_o_m__a_d_d_r_e_s_s ] address [ address2 ] ... DDEESSCCRRIIPPTTIIOONN _P_h_q_u_e_r_y relies on the _q_i(8) people name server to resolve fuzzy addresses, e.g., those sent to _j_p-_m_o_r_g_a_n@_u_i_u_c._e_d_u, _J_o_h_n-_M_o_r_g_a_n@_u_i_u_c._e_d_u, or _k_a_9_w_g_n@_u_i_u_c._e_d_u. The local portion of the address (left of the "@") may be either a _p_h(1) alias (jp-morgan), name (John-Morgan), or amateur radio callsign (ka9wgn) field. N.B., _p_h only guarantees the uniqueness of the alias field. Should there be two or more John-Morgan s in the ph data- base, _p_h_q_u_e_r_y will return an error message suggesting alter- natives. Also note that while ph names have blanks, sending a blank embedded in a mail address, no matter what quoting is done, is likely to be zapped by some intervening mail system. Therefore blanks in full name addresses should be replaced with dashes ("-"). Thus "John Morgan" becomes John-Morgan. _P_h_q_u_e_r_y is not meant to be invoked directly by users. Instead _s_e_n_d_m_a_i_l(8) will invoke it as a non-final mailer for addresses that have a remote portion of _u_i_u_c._e_d_u. See the NOTES section below for a quick sendmail.cf hack that will enable _p_h_q_u_e_r_y alias resolution to be done locally instead on on the machines MX'ed for _u_i_u_c._e_d_u. The call sequence runs as follows: Sendmail resolves one or more addresses in a message from, say _j_o_e@_c_h_i_c_a_g_o._e_d_u to _s_o_m_e_o_n_e@_u_i_u_c._e_d_u. Sendmail invokes _p_h_q_u_e_r_y as phquery -f joe@chicago.edu someone The text of the mail message is read by _p_h_q_u_e_r_y on the stan- dard input. _P_h_q_u_e_r_y consults the network _q_i(8) server to locate the email address _d_o_d_a@_u_x_1._c_s_o._u_i_u_c._e_d_u for the alias _s_o_m_e_o_n_e. The header line "X-PH: V@host.domain" is added to the mail message where _h_o_s_t._d_o_m_a_i_n is the host where _p_h_q_u_e_r_y did the translation. Sendmail is then invoked again to transport the message to its destination. --dd Turn on debugging statements, disable removal of temp Printed 3/2/93 13 1 PHQUERY(8L) 1989 PHQUERY(8L) files, and don't vfork/execve sendmail for error or mail delivery. Enabling debug also disables _s_y_s_l_o_g(3) statements unless re-enabled by a subsequent --ll. --ii Issue a usage and copyright statement. --ll Enable use of _s_y_s_l_o_g(3) routines to record signicant events using the LOG_MAIL facility. --xx _s_e_r_v_i_c_e__n_a_m_e Look up the single alias _s_e_r_v_i_c_e__n_a_m_e and send the mes- sage to the email address returned. This feature at UIUC supports outgoing email to facsimile. --ff _A_d_d_r_e_s_s Use _A_d_d_r_e_s_s as the From: address in the forwarded mail and as the recipient for any error messages. If not specified, _p_h_q_u_e_r_y will use the contents of the From: field in the message header block instead. --rr A synonym for --ff. --pp If set, all error returns are copied to Postmaster. NNOOTTEESS A vanilla sendmail site can use the syntax _s_o_m_e-_o_n_e@_u_i_u_c._e_d_u provided at least one of the following is true: a) the sendmail uses MX records, b) it has a mailhost or smarterhost relay that does use MX records, c) the rules below have been put into their sendmail.cf file. Macro M is defined to be the domain for which mail is to be accepted for. At UIUC, it is simply DMuiuc.edu To invoke _p_h_q_u_e_r_y locally, add the following rule to ruleset 0 just prior to selecting the local mailer: R$+@$M $#PH $@$w $:$1 And define the PH mailer as follows: MPH, P=/usr/local/libdata/mail/phquery, F=DFMhnmur, A=phquery $u If the IDA sendmail is used, then the steps are slightly more involved. Assuming again that the domain is uiuc.edu, proceed as follows. 1) Add phquery support to sendmail.cf: Printed 3/2/93 13 2 PHQUERY(8L) 1989 PHQUERY(8L) cd sendmail/ida/cf Add the lines below to the m4 file for your machine define(ALTERNATENAMES, uiuc.edu) define(MAILERTABLE, LIBDIR/mailertable) Build the sendmail.cf file and install it in the standard location. 2) Assuming LIBDIR was defined in the Makefile as /usr/local/libdata/mail, the next steps are cd /usr/local/libdata/mail cat > mailertable PH!your.host.domain uiuc.edu ^D cat > Makefile mailertable.dir: mailertable ./dbm -L make mailertable mailertable ^D Type 'make' and restart the sendmail daemon. SSEEEE AALLSSOO _s_e_n_d_m_a_i_l(8) BBUUGGSS Undoubtably. Please send comments and suggestions to ppaauull-- ppoommeess@@uuiiuucc..eedduu. N.B., the --pp option sends copies of failed mail to Postmas- ter. While usually a discreet person, it would still not be wise to discuss sensitive topics via email. This is useful advice at any time. AAUUTTHHOORR Paul Pomes, UIUC-CSO Printed 3/2/93 13 3