Search the FAQ Archives

3 - A - B - C - D - E - F - G - H - I - J - K - L - M
N - O - P - Q - R - S - T - U - V - W - X - Y - Z
faqs.org - Internet FAQ Archives

ph (cso nameserver) Frequently Asked Questions (FAQ)
Section - 1.4 How do I enable phquery for fuzzy mail addressing?

( Single Page )
[ Usenet FAQs | Web FAQs | Documents | RFC Index | Schools ]


Top Document: ph (cso nameserver) Frequently Asked Questions (FAQ)
Previous Document: 1.3 How do I create a ph database?
Next Document: 1.5 Can I run multiple databases on different ports?
See reader questions & answers on this topic! - Help others by sharing your knowledge
(contributed by Sverre Froyen, modified by Noel Hunter)

Fuzzy addressing is done by the program "phquery", part of the ph client
distribution.  Fuzzy addressing allows users to send mail based on a
person's real name, rather than their login ID.  Phquery performs the
conversion from the real name to an email address, using the ph database. 
Adding phquery is complicated, and you must be very careful or you will
disrupt incoming mail.  If possible, try it out on a non-production system
first. 

For phquery to work, alias must be at least "Indexed:Lookup:Public" in
prod.cnf.  Default is also good to add.  Ditto for the callsign and name
fields (Paul Pomes). 

To make it work, first compile phquery on your machine.  It's part of the
ph client distribution available from the main ftp archive (see 1.3,
below). 

After compiling it, you want to make sure that it works correctly by
running it in debug mode. Type, e.g.,

phquery -d -f your-address test-name < /dev/null

If it works, you are ready to install it by changing you sendmail
configuration file to route incoming messages through phquery.  How you do
this will vary with each version of Unix, but here is a sample. 

On most Unix systems, the file to alter is sendmail.cf.  Here are diffs of
how it was done on one system: 

Adding the phquery mailer:

*** 235,240 ****
--- 239,248 ----
  Mlocal,       P=/bin/mail, F=flsSDFMmnP, S=10, R=20, A=mail -d $u
  Mprog,        P=/bin/sh,   F=lsDFMeuP,  S=10, R=20, A=sh -c $u

+ # Phquery specification
+
+ MPH,  P=/etc/phquery, F=DFMhnmur, A=phquery $u
+
  S10
  # None needed.

***************

Adding the rule to invoke phquery:

*** 353,364 ****
--- 361,376 ----
  # Handle special cases.....
  R@                    $#local $:$n                    handle <> form

+ # Invoke phquery to resolve names addressed to domain (sverre)
+ R$+<@LOCAL>           $#PH $@$w $:$1
+
  # resolve the local hostname to "LOCAL".
  R$*<$*$=w.LOCAL>$*    $1<$2LOCAL>$4                   thishost.LOCAL
  R$*<$*$=w.uucp>$*     $1<$2LOCAL>$4                   thishost.uucp
  R$*<$*$=w>$*          $1<$2LOCAL>$4                   thishost

***************

Note that I had to add the phquery rule before the local hostname gets
resolved to LOCAL.  After this point there is no way to distinguish mail
to the domain from mail to the local host and a mail loop will result.
Also make sure that From: line contains the hostname and not just the
domain name.  Our mailer used just the domainname and I had a wonderful
mail loop bouncing mail with another site because phquery could not
resolve MAILER_DAEMON.  You can check your sendmail.cf file by running
sendmail (by hand) with the -bt option, i.e.,

/usr/lib/sendmail -bt -C new-configuration file

and asking it to invoke the various rules, type for instance

4,0 some-address

and it will show how rules 4 and 0 treats the address.

***************

AN ARCHIVE of sendmail.cf diff files is maintained at:

http://www.camelcity.com/~noel/usenet/phquery-diffs/

You can use these diffs to make changes to your sendmail.cf file. 
Currently, only two diffs are available: 

sendmailV8 (UCB Sendmail Version 8)
sunos52    (SUN OS Version 5.2)

For IDA sendmail, the phquery program is now part of the qi distribution on 
uiarchive (see Subject: 1.1 Where do I get the ph / cso software?)

If you have phquery working, PLEASE send us a diff by executing the command:

diff -c sendmail.cf.clean sendmail.cf

(provided your original file is sendmail.cf.clean).  Then mail the output
of the command, along with the output of "uname -a" to noel@camelcity.com. 

User Contributions:

Comment about this article, ask questions, or add new information about this topic:

CAPTCHA




Top Document: ph (cso nameserver) Frequently Asked Questions (FAQ)
Previous Document: 1.3 How do I create a ph database?
Next Document: 1.5 Can I run multiple databases on different ports?

Single Page

[ Usenet FAQs | Web FAQs | Documents | RFC Index ]

Send corrections/additions to the FAQ Maintainer:
noel@camelcity.com (PH FAQ Coordinators)





Last Update March 27 2014 @ 02:12 PM