#! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh 'phquery/Makefile.orig' <<'END_OF_FILE' X# Makefile for UIUC sendmail-related programs. X# X# Written by Paul Pomes, University of Illinois, Computing Services Office X# Copyright (c) 1991 by Paul Pomes and the University of Illinois Board X# of Trustees. X# X# Redistribution and use in source and binary forms, with or without X# modification, are permitted provided that the following conditions X# are met: X# 1. Redistributions of source code must retain the above copyright X# notice, this list of conditions and the following disclaimer. X# 2. Redistributions in binary form must reproduce the above copyright X# notice, this list of conditions and the following disclaimer in the X# documentation and/or other materials provided with the distribution. X# 3. All advertising materials mentioning features or use of this software X# must display the following acknowledgement: X# This product includes software developed by the University of X# Illinois, Urbana and its contributors. X# 4. Neither the name of the University nor the names of its contributors X# may be used to endorse or promote products derived from this software X# without specific prior written permission. X# X# THIS SOFTWARE IS PROVIDED BY THE TRUSTEES AND CONTRIBUTORS ``AS IS'' AND X# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE X# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE X# ARE DISCLAIMED. IN NO EVENT SHALL THE TRUSTEES OR CONTRIBUTORS BE LIABLE X# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL X# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS X# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) X# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT X# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY X# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF X# SUCH DAMAGE. X# X# Email: Paul-Pomes@uiuc.edu USMail: Paul Pomes X# ICBM: 40 06 47 N / 88 13 35 W University of Illinois - CSO X# 1304 West Springfield Avenue X# Urbana, Illinois, 61801-2910 X# @(#)$Id: Makefile,v 1.8 1992/05/05 18:28:52 paul Exp paul $ X X# .PREFIXES: ./RCS X.SUFFIXES: .0 .8 X X# QI_HOST The fully qualified domain name of the local qi/ph server X# QI_ALT The fully qualified domain name of the backup qi/ph server X# QISERVICE The name of the TCP service at port 105 in /etc/services. X# Usually "ns" or "csnet-ns" X# DOMAIN The domain name to append to Reply-To: aliases. This must X# be the same as DOMAINMASTER in sendmail.cf X# SYSLOG Syslog logging facility. X# SYSV Installation under System 5. X X# Reasonable defaults. A CPU type must usually be specified with ANSI C X# compilers in order to select the correct byte-ordering in . X# IT'S LIKELY THAT THE -Dvax BELOW WILL BE WRONG FOR YOUR MACHINE. XCC= cc -Dsun -O X#CC= gcc -Dvax -ansi -O2 XDEFS = -DQI_HOST=\"HOSTNAME\" \ X -DQI_ALT=\"HOSTNAME\" \ X -DQISERVICE=\"ns\" \ X -DDOMAIN=\"HOSTNAME\" \ X -DSYSLOG=LOG_MAIL \ X -DEXPAND_TO XCFLAGS = ${DEFS} XFFLAGS = ${DEFS} XPFLAGS = ${DEFS} XLFLAGS = XYFLAGS = XLDFLAGS= XLIBS = X XDESTBIN= /bin XDESTETC= /usr/local/etc XDESTLIB= /usr/lib/mail XCAT8DIR = /usr/local/man/cat8 XDOCDIR = /usr/local/doc X XHDRS = messages.h phquery.h XSRCS = dconn.c malloc.c phquery.c XOBJS = phquery.o # mktemp.o malloc.o XOTHERS = Makefile README phquery.8 XVERS = X X.8.0: X /usr/man/manroff $*.8 > $*.0 X Xall: phquery X X# If your /lib/libc.a doesn't have mkstemp(), copy ../support/mktemp.c to this X# directory and insert into the SRCS/OBJS list above. Also add mktemp.o below. Xphquery: ${OBJS} X $(CC) -o phquery ${CFLAGS} ${LDFLAGS} ${OBJS} $(LIBS) X Xinstall: phquery phquery.0 X install -s -o daemon -m 4511 phquery {DESTLIB}/phquery X install -c -m 444 phquery.0 ${CAT8DIR}/phquery.0 X Xuninstall: /tmp X rm -f ${DESTLIB}/phquery ${CAT8DIR}/phquery.0 X Xlint: ${HDRS} ${SRCS} X lint -chpb ${DEFS} phquery.c X Xshar: ${HDRS} ${SRCS} ${OTHERS} X shar ${HDRS} ${SRCS} ${OTHERS} > phquery.shar X Xtags: ${HDRS} ${SRCS} X ctags ${HDRS} ${SRCS} X Xclean: X @echo "Removing object and junk files." X rm -f phquery *.o core a.out make.log lint.out \ X Makefile.bak phquery.shar X Xclobber: X @echo "Removing read-only source files that have RCS parents." X @echo "Error code 1 indicates last file in SRCS list was not removed." X @echo "(Which is OK)" X make clean X -if [ `whoami` != root ]; then \ X for i in ${HDRS} ${SRCS}; do \ X if [ ! -w $$i ]; then \ X ( if [ -f $$i,v ]; then rm -f $$i; \ X elif [ -f RCS/$$i,v ]; then rm -f $$i; \ X fi ); \ X else echo $$i "writeable, not removed"; \ X fi; \ X done; \ X else echo "Running \"make clobber\" as root will zap ALL SRCS,\ X RCS'ed or not (not done)."; \ X fi X Xcompress: X make clean X @echo "Compressing source and RCS files." X find . -size +2 \( -name \*.h -o -name \*.c -o -name \*.f \ X -o -name \*.p -o -name \*.l -o -name \*.y -o -name \*,v \) \ X -exec compress {} \; X Xuncompress: X uncompressdir . X X# RCS stuff X Xci: ${HDRS} ${SRCS} X -ci $? X @touch ci X Xcoall: X co -l ${HDRS} ${SRCS} X Xupdate: X ci -sDist -u -f${VERS} ${HDRS} ${SRCS} X @touch ci X Xdepend: X mkdep ${DEFS} ${SRCS} X X# DO NOT DELETE THIS LINE -- mkdep uses it. X# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. X X# IF YOU PUT ANYTHING HERE IT WILL GO AWAY END_OF_FILE if test 5318 -ne `wc -c <'phquery/Makefile.orig'`; then echo shar: \"'phquery/Makefile.orig'\" unpacked with wrong size! fi # end of 'phquery/Makefile.orig' fi if test -f 'phquery/README' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'phquery/README'\" else echo shar: Extracting \"'phquery/README'\" \(704 characters\) sed "s/^X//" >'phquery/README' <<'END_OF_FILE' Xmalloc.c is included as a debugging aid from 4.3 BSD-tahoe. X Xphquery is a fuzzy address backend for sendmail. It relies on the Xpresence of a network QI (Query Interpreter) server. QI is a variant Xof the CSnet central name server. At UIUC it contains the campus Xphone book plus several other fields including the preferred Email Xaddress. phquery converts either a alias (guaranteed unique), Xfull-name, or amateur radio callsign into a email address. See the Xphquery man page and the man page for ph (QI client) in /net/ph X(via anon-FTP). X Xphquery should be installed as LIBDIR/phquery where LIBDIR is defined Xby the *.m4 files in ../ida/cf. The default is /usr/local/libdata/mail . X XPaul Pomes, CSO END_OF_FILE if test 704 -ne `wc -c <'phquery/README'`; then echo shar: \"'phquery/README'\" unpacked with wrong size! fi # end of 'phquery/README' fi if test -f 'phquery/README.TOO' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'phquery/README.TOO'\" else echo shar: Extracting \"'phquery/README.TOO'\" \(184 characters\) sed "s/^X//" >'phquery/README.TOO' <<'END_OF_FILE' XThe file ../Makefile configures Makefile from Makefile.orig. X XThe file sendmail.diffs show how to change SunOS 4.1.1 sendmail.cf Xto use phquery. X- Dan Kegel (dank@blacks.jpl.nasa.gov) END_OF_FILE if test 184 -ne `wc -c <'phquery/README.TOO'`; then echo shar: \"'phquery/README.TOO'\" unpacked with wrong size! fi # end of 'phquery/README.TOO' fi if test -f 'phquery/cdefs.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'phquery/cdefs.h'\" else echo shar: Extracting \"'phquery/cdefs.h'\" \(3074 characters\) sed "s/^X//" >'phquery/cdefs.h' <<'END_OF_FILE' X/* X * Copyright (c) 1991 The Regents of the University of California. X * All rights reserved. X * X * Redistribution and use in source and binary forms, with or without X * modification, are permitted provided that the following conditions X * are met: X * 1. Redistributions of source code must retain the above copyright X * notice, this list of conditions and the following disclaimer. X * 2. Redistributions in binary form must reproduce the above copyright X * notice, this list of conditions and the following disclaimer in the X * documentation and/or other materials provided with the distribution. X * 3. All advertising materials mentioning features or use of this software X * must display the following acknowledgement: X * This product includes software developed by the University of X * California, Berkeley and its contributors. X * 4. Neither the name of the University nor the names of its contributors X * may be used to endorse or promote products derived from this software X * without specific prior written permission. X * X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE X * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF X * SUCH DAMAGE. X * X * @(#)cdefs.h 7.6 (Berkeley) 5/4/91 X */ X X#ifndef _CDEFS_H_ X#define _CDEFS_H_ X X#if defined(__cplusplus) X#define __BEGIN_DECLS extern "C" { X#define __END_DECLS }; X#else X#define __BEGIN_DECLS X#define __END_DECLS X#endif X X/* X * The __CONCAT macro is used to concatenate parts of symbol names, e.g. X * with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo. X * The __CONCAT macro is a bit tricky -- make sure you don't put spaces X * in between its arguments. __CONCAT can also concatenate double-quoted X * strings produced by the __STRING macro, but this only works with ANSI C. X */ X#if defined(__STDC__) || defined(__cplusplus) X#define __P(protos) protos /* full-blown ANSI C */ X#define __CONCAT(x,y) x ## y X#define __STRING(x) #x X X#else /* !(__STDC__ || __cplusplus) */ X#define __P(protos) () /* traditional C preprocessor */ X#define __CONCAT(x,y) x/**/y X#define __STRING(x) "x" X X#ifdef __GNUC__ X#define const __const /* GCC: ANSI C with -traditional */ X#define inline __inline X#define signed __signed X#define volatile __volatile X X#else /* !__GNUC__ */ X#define const /* delete ANSI C keywords */ X#define inline X#define signed X#define volatile X#endif /* !__GNUC__ */ X#endif /* !(__STDC__ || __cplusplus) */ X X#endif /* !_CDEFS_H_ */ END_OF_FILE if test 3074 -ne `wc -c <'phquery/cdefs.h'`; then echo shar: \"'phquery/cdefs.h'\" unpacked with wrong size! fi # end of 'phquery/cdefs.h' fi if test -f 'phquery/dconn.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'phquery/dconn.c'\" else echo shar: Extracting \"'phquery/dconn.c'\" \(1520 characters\) sed "s/^X//" >'phquery/dconn.c' <<'END_OF_FILE' X/* dconn is the Decnet Connect program. The intention is that X** it will open a decnet socket (stream) and transfer stdin to that X** while everything from the connection goes to that. X** X** sendmail can then use that with an entry like X** X** MDsmtp, P=/usr/lib/mail/dconn, F=msDFMueXLR, S=13, R=24, E=\r\n, X** A=dconn #130 $h X** X** because there is no $u in the arguments, sendmail will talk smtp to it. X*/ X#include X#include X X#include X#include X#include X#include X X#define DEBUG 1 X Xextern int errno; Xint me; X Xbye (str, i) X int i; X char *str; X{ X if (DEBUG || i != 0) X printf ("%d: why %s, exit %d, errno=%d\r\n", X me, str, i, errno); X exit (i); X} X Xmain (argc, argv) X int argc; X char *argv[]; X X{ X register int dcr, i, j; X char *pnt; X static char fromdn[512], todn[512]; X char *index (); X X if (argc != 3) X bye ("not enuf args", 5); X X if ((pnt = index (argv[2], '.')) != (char *) NULL) X *pnt = '\0'; X dcr = dnet_conn (argv[2], argv[1], SOCK_STREAM, 0, 0, 0, 0); X X if (dcr == -1) X bye ("dnet_conn failed", 1); X X switch (me = fork ()) { X case 0: /* kid */ X close (1); X while ((i = read (0, todn, 512)) > 0) { X if (i != write (dcr, todn, i)) X bye ("write failed", 2); X } X bye (i); X case -1: /* Error */ X bye ("fork failed", 4); X default: /* parent! */ X close (0); X while ((j = read (dcr, fromdn, 512)) > 0) { X if (j != write (1, fromdn, j)) X bye ("2nd write failed", 3); X } X } X} END_OF_FILE if test 1520 -ne `wc -c <'phquery/dconn.c'`; then echo shar: \"'phquery/dconn.c'\" unpacked with wrong size! fi # end of 'phquery/dconn.c' fi if test -f 'phquery/malloc.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'phquery/malloc.c'\" else echo shar: Extracting \"'phquery/malloc.c'\" \(9831 characters\) sed "s/^X//" >'phquery/malloc.c' <<'END_OF_FILE' X#define DEBUG X#define RCHECK X/* X * Copyright (c) 1983 Regents of the University of California. X * All rights reserved. The Berkeley software License Agreement X * specifies the terms and conditions for redistribution. X */ X X#if defined(LIBC_SCCS) && !defined(lint) Xstatic char sccsid[] = "@(#)malloc.c 5.6 (Berkeley) 3/9/86"; X#endif LIBC_SCCS and not lint X X/* X * malloc.c (Caltech) 2/21/82 X * Chris Kingsley, kingsley@cit-20. X * X * This is a very fast storage allocator. It allocates blocks of a small X * number of different sizes, and keeps free lists of each size. Blocks that X * don't exactly fit are passed up to the next larger size. In this X * implementation, the available sizes are 2^n-4 (or 2^n-10) bytes long. X * This is designed for use in a virtual memory environment. X */ X X#include X X#define NULL 0 X X/* X * The overhead on a block is at least 4 bytes. When free, this space X * contains a pointer to the next free block, and the bottom two bits must X * be zero. When in use, the first byte is set to MAGIC, and the second X * byte is the size index. The remaining bytes are for alignment. X * If range checking is enabled then a second word holds the size of the X * requested block, less 1, rounded up to a multiple of sizeof(RMAGIC). X * The order of elements is critical: ov_magic must overlay the low order X * bits of ov_next, and ov_magic can not be a valid ov_next bit pattern. X */ Xunion overhead { X union overhead *ov_next; /* when free */ X struct { X u_char ovu_magic; /* magic number */ X u_char ovu_index; /* bucket # */ X#ifdef RCHECK X u_short ovu_rmagic; /* range magic number */ X u_int ovu_size; /* actual block size */ X#endif X } ovu; X#define ov_magic ovu.ovu_magic X#define ov_index ovu.ovu_index X#define ov_rmagic ovu.ovu_rmagic X#define ov_size ovu.ovu_size X}; X X#define MAGIC 0xef /* magic # on accounting info */ X#define RMAGIC 0x5555 /* magic # on range info */ X X#ifdef RCHECK X#define RSLOP sizeof (u_short) X#else X#define RSLOP 0 X#endif X X/* X * nextf[i] is the pointer to the next free block of size 2^(i+3). The X * smallest allocatable block is 8 bytes. The overhead information X * precedes the data area returned to the user. X */ X#define NBUCKETS 30 Xstatic union overhead *nextf[NBUCKETS]; Xextern char *sbrk(); X Xstatic int pagesz; /* page size */ Xstatic int pagebucket; /* page size bucket */ X X#ifdef MSTATS X/* X * nmalloc[i] is the difference between the number of mallocs and frees X * for a given block size. X */ Xstatic u_int nmalloc[NBUCKETS]; X#include X#endif X X#if defined(DEBUG) || defined(RCHECK) X#define ASSERT(p) if (!(p)) botch("p") X#include Xstatic Xbotch(s) X char *s; X{ X fprintf(stderr, "\r\nassertion botched: %s\r\n", s); X (void) fflush(stderr); /* just in case user buffered it */ X abort(); X} X#else X#define ASSERT(p) X#endif X Xchar * Xmalloc(nbytes) X unsigned nbytes; X{ X register union overhead *op; X register int bucket; X register unsigned amt, n; X X /* X * First time malloc is called, setup page size and X * align break pointer so all data will be page aligned. X */ X if (pagesz == 0) { X pagesz = n = getpagesize(); X op = (union overhead *)sbrk(0); X n = n - sizeof (*op) - ((int)op & (n - 1)); X if (n < 0) X n += pagesz; X if (n) { X if (sbrk(n) == (char *)-1) X return (NULL); X } X bucket = 0; X amt = 8; X while (pagesz > amt) { X amt <<= 1; X bucket++; X } X pagebucket = bucket; X } X /* X * Convert amount of memory requested into closest block size X * stored in hash buckets which satisfies request. X * Account for space used per block for accounting. X */ X if (nbytes <= (n = pagesz - sizeof (*op) - RSLOP)) { X#ifndef RCHECK X amt = 8; /* size of first bucket */ X bucket = 0; X#else X amt = 16; /* size of first bucket */ X bucket = 1; X#endif X n = -(sizeof (*op) + RSLOP); X } else { X amt = pagesz; X bucket = pagebucket; X } X while (nbytes > amt + n) { X amt <<= 1; X if (amt == 0) X return (NULL); X bucket++; X } X /* X * If nothing in hash bucket right now, X * request more memory from the system. X */ X if ((op = nextf[bucket]) == NULL) { X morecore(bucket); X if ((op = nextf[bucket]) == NULL) X return (NULL); X } X /* remove from linked list */ X nextf[bucket] = op->ov_next; X op->ov_magic = MAGIC; X op->ov_index = bucket; X#ifdef MSTATS X nmalloc[bucket]++; X#endif X#ifdef RCHECK X /* X * Record allocated size of block and X * bound space with magic numbers. X */ X op->ov_size = (nbytes + RSLOP - 1) & ~(RSLOP - 1); X op->ov_rmagic = RMAGIC; X *(u_short *)((caddr_t)(op + 1) + op->ov_size) = RMAGIC; X#endif X return ((char *)(op + 1)); X} X X/* X * Allocate more memory to the indicated bucket. X */ Xmorecore(bucket) X int bucket; X{ X register union overhead *op; X register int sz; /* size of desired block */ X int amt; /* amount to allocate */ X int nblks; /* how many blocks we get */ X X /* X * sbrk_size <= 0 only for big, FLUFFY, requests (about X * 2^30 bytes on a VAX, I think) or for a negative arg. X */ X sz = 1 << (bucket + 3); X#ifdef DEBUG X ASSERT(sz > 0); X#else X if (sz <= 0) X return; X#endif X if (sz < pagesz) { X amt = pagesz; X nblks = amt / sz; X } else { X amt = sz + pagesz; X nblks = 1; X } X op = (union overhead *)sbrk(amt); X /* no more room! */ X if ((int)op == -1) X return; X /* X * Add new memory allocated to that on X * free list for this hash bucket. X */ X nextf[bucket] = op; X while (--nblks > 0) { X op->ov_next = (union overhead *)((caddr_t)op + sz); X op = (union overhead *)((caddr_t)op + sz); X } X} X Xfree(cp) X char *cp; X{ X register int size; X register union overhead *op; X X if (cp == NULL) X return; X op = (union overhead *)((caddr_t)cp - sizeof (union overhead)); X#ifdef DEBUG X ASSERT(op->ov_magic == MAGIC); /* make sure it was in use */ X#else X if (op->ov_magic != MAGIC) X return; /* sanity */ X#endif X#ifdef RCHECK X ASSERT(op->ov_rmagic == RMAGIC); X ASSERT(*(u_short *)((caddr_t)(op + 1) + op->ov_size) == RMAGIC); X#endif X size = op->ov_index; X ASSERT(size < NBUCKETS); X op->ov_next = nextf[size]; /* also clobbers ov_magic */ X nextf[size] = op; X#ifdef MSTATS X nmalloc[size]--; X#endif X} X X/* X * When a program attempts "storage compaction" as mentioned in the X * old malloc man page, it realloc's an already freed block. Usually X * this is the last block it freed; occasionally it might be farther X * back. We have to search all the free lists for the block in order X * to determine its bucket: 1st we make one pass thru the lists X * checking only the first block in each; if that fails we search X * ``realloc_srchlen'' blocks in each list for a match (the variable X * is extern so the caller can modify it). If that fails we just copy X * however many bytes was given to realloc() and hope it's not huge. X */ Xint realloc_srchlen = 4; /* 4 should be plenty, -1 =>'s whole list */ X Xchar * Xrealloc(cp, nbytes) X char *cp; X unsigned nbytes; X{ X register u_int onb, i; X union overhead *op; X char *res; X int was_alloced = 0; X X if (cp == NULL) X return (malloc(nbytes)); X op = (union overhead *)((caddr_t)cp - sizeof (union overhead)); X if (op->ov_magic == MAGIC) { X was_alloced++; X i = op->ov_index; X } else { X /* X * Already free, doing "compaction". X * X * Search for the old block of memory on the X * free list. First, check the most common X * case (last element free'd), then (this failing) X * the last ``realloc_srchlen'' items free'd. X * If all lookups fail, then assume the size of X * the memory block being realloc'd is the X * largest possible (so that all "nbytes" of new X * memory are copied into). Note that this could cause X * a memory fault if the old area was tiny, and the moon X * is gibbous. However, that is very unlikely. X */ X if ((i = findbucket(op, 1)) < 0 && X (i = findbucket(op, realloc_srchlen)) < 0) X i = NBUCKETS; X } X onb = 1 << (i + 3); X if (onb < pagesz) X onb -= sizeof (*op) + RSLOP; X else X onb += pagesz - sizeof (*op) - RSLOP; X /* avoid the copy if same size block */ X if (was_alloced) { X if (i) { X i = 1 << (i + 2); X if (i < pagesz) X i -= sizeof (*op) + RSLOP; X else X i += pagesz - sizeof (*op) - RSLOP; X } X if (nbytes <= onb && nbytes > i) { X#ifdef RCHECK X op->ov_size = (nbytes + RSLOP - 1) & ~(RSLOP - 1); X *(u_short *)((caddr_t)(op + 1) + op->ov_size) = RMAGIC; X#endif X return(cp); X } else X free(cp); X } X if ((res = malloc(nbytes)) == NULL) X return (NULL); X if (cp != res) /* common optimization if "compacting" */ X bcopy(cp, res, (nbytes < onb) ? nbytes : onb); X return (res); X} X X/* X * Search ``srchlen'' elements of each free list for a block whose X * header starts at ``freep''. If srchlen is -1 search the whole list. X * Return bucket number, or -1 if not found. X */ Xstatic Xfindbucket(freep, srchlen) X union overhead *freep; X int srchlen; X{ X register union overhead *p; X register int i, j; X X for (i = 0; i < NBUCKETS; i++) { X j = 0; X for (p = nextf[i]; p && j != srchlen; p = p->ov_next) { X if (p == freep) X return (i); X j++; X } X } X return (-1); X} X X#ifdef MSTATS X/* X * mstats - print out statistics about malloc X * X * Prints two lines of numbers, one showing the length of the free list X * for each size category, the second showing the number of mallocs - X * frees for each size category. X */ Xmstats(s) X char *s; X{ X register int i, j; X register union overhead *p; X int totfree = 0, X totused = 0; X X fprintf(stderr, "Memory allocation statistics %s\nfree:\t", s); X for (i = 0; i < NBUCKETS; i++) { X for (j = 0, p = nextf[i]; p; p = p->ov_next, j++) X ; X fprintf(stderr, " %d", j); X totfree += j * (1 << (i + 3)); X } X fprintf(stderr, "\nused:\t"); X for (i = 0; i < NBUCKETS; i++) { X fprintf(stderr, " %d", nmalloc[i]); X totused += nmalloc[i] * (1 << (i + 3)); X } X fprintf(stderr, "\n\tTotal in use: %d, total free: %d\n", X totused, totfree); X} X#endif END_OF_FILE if test 9831 -ne `wc -c <'phquery/malloc.c'`; then echo shar: \"'phquery/malloc.c'\" unpacked with wrong size! fi # end of 'phquery/malloc.c' fi if test -f 'phquery/messages.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'phquery/messages.h'\" else echo shar: Extracting \"'phquery/messages.h'\" \(4995 characters\) sed "s/^X//" >'phquery/messages.h' <<'END_OF_FILE' X/* X * Written by Paul Pomes, University of Illinois, Computing Services Office X * Copyright (c) 1991 by Paul Pomes and the University of Illinois Board X * of Trustees. X * X * Redistribution and use in source and binary forms, with or without X * modification, are permitted provided that the following conditions X * are met: X * 1. Redistributions of source code must retain the above copyright X * notice, this list of conditions and the following disclaimer. X * 2. Redistributions in binary form must reproduce the above copyright X * notice, this list of conditions and the following disclaimer in the X * documentation and/or other materials provided with the distribution. X * 3. All advertising materials mentioning features or use of this software X * must display the following acknowledgement: X * This product includes software developed by the University of X * Illinois, Urbana and its contributors. X * 4. Neither the name of the University nor the names of its contributors X * may be used to endorse or promote products derived from this software X * without specific prior written permission. X * X * THIS SOFTWARE IS PROVIDED BY THE TRUSTEES AND CONTRIBUTORS ``AS IS'' AND X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE X * ARE DISCLAIMED. IN NO EVENT SHALL THE TRUSTEES OR CONTRIBUTORS BE LIABLE X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF X * SUCH DAMAGE. X * X * Email: Paul-Pomes@uiuc.edu USMail: Paul Pomes X * ICBM: 40 06 47 N / 88 13 35 W University of Illinois - CSO X * 1304 West Springfield Avenue X * Urbana, Illinois, 61801-2910 X * @(#)$Id: messages.h,v 1.4 1992/03/09 00:16:47 paul Exp $ X */ X X/* Messages for ErrorReturn(). How simple, yet stupid, do we have to be? */ X Xchar *NoMatchMsg[] = { X " The message, \"No matches to nameserver query,\" is generated whenever", X " the ph nameserver fails to locate either a ph alias or name field that", X " matches the supplied name. The usual causes are typographical errors or", X " the use of nicknames. Recommended action is to use the ph program to", X " determine the correct ph alias for the individuals addressed. If ph is", X " not available, try sending to the most explicit form of the name, e.g.,", X " if mike-fox fails, try michael-j-fox.", X " ", X NULL X}; X Xchar *MultiMsg[] = { X " The message, \"Multiple matches found for nameserver query,\" is generated", X " whenever the ph nameserver finds multiple matches for the supplied name.", X " The steering philosophy is that mail should be delivered only to the", X " addressed individual. Since the supplied information is insufficient", X " to locate a specific individual, your message is being returned.", X " To help you locate the correct individual, selected fields from the", X " possible matches are included below. The alias field is the only one", X " guaranteed unique within a given ph community.", X " ", X NULL X}; X Xchar *TooManyMsg[] = { X " The message, \"Too many matches found to nameserver query,\" is generated", X " whenever the supplied name or alias matched over twenty ph nameserver", X " entries. In this case no information will be returned about possible", X " matches. Recommended action is to supply more specific names, e.g.,", X " john-b-smith instead of john-smith, or use the per-person unique ph alias.", X " You may have thought that you had used a ph alias and not a name. This is", X " an artifact of the address resolution process. If the address fails as an", X " alias, it is retried first as a callsign and then as a name. While aliases", X " are guaranteed unique, names can match multiple individuals depending on", X " how common the name is.", X " ", X NULL X}; X Xchar *AbsentMsg[] = { X " The message, \"E-mail field not present in nameserver entry,\" is generated", X " whenever the ph nameserver matched the supplied name or alias with an", X " entry that lacked an email address field. In this case no delivery can", X " be made. Recommended action is to contact the individual by alternate", X " means via the information included below. If the individual already has", X " an email address, s/he should edit their ph entry to include it.", X " ", X NULL X}; X Xchar *PhoneMsg[] = { X " A note regarding phone numbers: the UIUC area code is 217. There are three", X " exchanges used by UIUC: 333, 332, and 244. UIUC phone numbers are often", X " abbreviated by omitting the first two digits of the exchange. Thus the", X " example phone number 3-6262 can be reached by dialing 1 217 333 6262.", X " ", X NULL X}; X END_OF_FILE if test 4995 -ne `wc -c <'phquery/messages.h'`; then echo shar: \"'phquery/messages.h'\" unpacked with wrong size! fi # end of 'phquery/messages.h' fi if test -f 'phquery/phquery.8' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'phquery/phquery.8'\" else echo shar: Extracting \"'phquery/phquery.8'\" \(6046 characters\) sed "s/^X//" >'phquery/phquery.8' <<'END_OF_FILE' X.\" Written by Paul Pomes, University of Illinois, Computing Services Office X.\" Copyright (c) 1991 by Paul Pomes and the University of Illinois Board X.\" of Trustees. X.\" X.\" Redistribution and use in source and binary forms, with or without X.\" modification, are permitted provided that the following conditions X.\" are met: X.\" 1. Redistributions of source code must retain the above copyright X.\" notice, this list of conditions and the following disclaimer. X.\" 2. Redistributions in binary form must reproduce the above copyright X.\" notice, this list of conditions and the following disclaimer in the X.\" documentation and/or other materials provided with the distribution. X.\" 3. All advertising materials mentioning features or use of this software X.\" must display the following acknowledgement: X.\" This product includes software developed by the University of X.\" Illinois, Urbana and its contributors. X.\" 4. Neither the name of the University nor the names of its contributors X.\" may be used to endorse or promote products derived from this software X.\" without specific prior written permission. X.\" X.\" THIS SOFTWARE IS PROVIDED BY THE TRUSTEES AND CONTRIBUTORS ``AS IS'' AND X.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE X.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE X.\" ARE DISCLAIMED. IN NO EVENT SHALL THE TRUSTEES OR CONTRIBUTORS BE LIABLE X.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL X.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS X.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) X.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT X.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY X.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF X.\" SUCH DAMAGE. X.\" X.\" @(#)$Id: phquery.8,v 1.4 1992/03/09 00:16:47 paul Exp $ X.\" X.TH PHQUERY 8L "13 Feb 1989" X.UC 4 X.SH NAME Xphquery \- fuzzy address resolver backend for sendmail X.SH SYNOPSIS X.B phquery X[ X.B \-d X] [ X.B \-i X] [ X.B \-l X] [ X.B \-p X] [ X.BI \-x\ service_type X] [ X.BI \-f\ from_address X] Xaddress X[ address2 ] X\&... X.SH DESCRIPTION X.I Phquery Xrelies on the X.IR qi (8) Xpeople name server to resolve fuzzy addresses, e.g., those sent Xto X.IR jp-morgan@uiuc.edu , X.IR John-Morgan@uiuc.edu , Xor X.IR ka9wgn@uiuc.edu . XThe local portion of the address (left of the "@") Xmay be either a X.IR ph (1) Xalias (jp-morgan), Xname (John-Morgan), Xor Xamateur radio callsign (ka9wgn) Xfield. X.PP XN.B., X.I ph Xonly guarantees the uniqueness of the alias field. XShould there be two or more John-Morgan s in the ph database, X.I phquery Xwill return an error message suggesting alternatives. XAlso note that while ph names have blanks, sending a blank embedded in a mail Xaddress, no matter what quoting is done, is likely to be zapped by some Xintervening mail system. XTherefore blanks in full name addresses should be replaced with dashes ("-"). XThus "John Morgan" becomes John-Morgan. X.PP X.I Phquery Xis not meant to be invoked directly by users. XInstead X.IR sendmail (8) Xwill invoke it as a non-final mailer for addresses that have a remote Xportion of X.IR uiuc.edu . XSee the NOTES section below for a quick sendmail.cf hack that will enable X.I phquery Xalias resolution to be done locally instead on on the machines MX'ed for X.IR uiuc.edu . X.PP XThe call sequence runs as follows: X.PP XSendmail resolves one or more addresses in a message from, say X.I joe@chicago.edu Xto X.IR someone@uiuc.edu . X.PP XSendmail invokes X.I phquery Xas X.sp X.in +4 Xphquery -f joe@chicago.edu someone X.in X.sp XThe text of the mail message is read by X.I phquery Xon the standard input. X.I Phquery Xconsults the network X.IR qi (8) Xserver to locate the email address X.I doda@ux1.cso.uiuc.edu Xfor the alias X.IR someone . X.PP XThe header line "X-PH: V@host.domain" is added to the mail message Xwhere X.I host.domain Xis the host where X.I phquery Xdid the translation. XSendmail is then invoked again to transport the message to its destination. X.TP 5 5 X.B \-d XTurn on debugging statements, disable removal of temp files, and don't Xvfork/execve sendmail for error or mail delivery. XEnabling debug also disables X.IR syslog (3) Xstatements unless re-enabled by a subsequent X.BR \-l . X.TP 5 5 X.B \-i XIssue a usage and copyleft statement. X.TP 5 5 X.B \-l XEnable use of X.IR syslog (3) Xroutines to record signicant events using the LOG_MAIL facility. X.TP 5 5 X.BI \-x\ service_name XLook up the single alias X.I service_name Xand send the message to the email address returned. XThis feature at UIUC supports outgoing email to facsimile. X.TP 5 5 X.BI \-f\ Address XUse X.I Address Xas the From: address in the forwarded mail and as the recipient for any Xerror messages. XIf not specified, X.I phquery Xwill use the contents of the From: field in the message header block instead. X.TP 5 5 X.B \-r XA synonym for X.BR \-f . X.TP 5 5 X.B \-p XIf set, all error returns are copied to Postmaster. X.SH NOTES XA vanilla sendmail site can use the syntax X.I some-one@uiuc.edu Xprovided at least one of the following is true: X.nf Xa) the sendmail uses MX records, Xb) it has a mailhost or smarterhost relay that does use MX records, Xc) the rules below have been put into their sendmail.cf file. X.fi X.PP XClass M is defined to be all domains for which mail is to be accepted for. XAt UIUC, it is simply X.PP XCMuiuc.edu X.PP XTo invoke X.I phquery Xlocally, add the following rule to ruleset 0 just prior to selecting the Xlocal mailer: X.PP XR$+@$=M $#PH $@$w $:$1 X.PP XAnd define the PH mailer as follows: X.PP XMPH, P=/usr/local/lib/mail/phquery, F=DFMhnmur, A=phquery $u X.SH SEE ALSO X.IR sendmail (8) X.SH BUGS XUndoubtably. XPlease send comments and suggestions to X.BR paul-pomes@uiuc.edu . X.PP XN.B., the X.B \-p Xoption sends copies of failed mail to Postmaster. XWhile usually a discreet person, it would still not be wise to discuss Xsensitive topics via email. XThis is useful advice at any time. X.SH AUTHOR XPaul Pomes, UIUC-CSO END_OF_FILE if test 6046 -ne `wc -c <'phquery/phquery.8'`; then echo shar: \"'phquery/phquery.8'\" unpacked with wrong size! fi # end of 'phquery/phquery.8' fi if test -f 'phquery/phquery.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'phquery/phquery.h'\" else echo shar: Extracting \"'phquery/phquery.h'\" \(8640 characters\) sed "s/^X//" >'phquery/phquery.h' <<'END_OF_FILE' X/* X * Written by Paul Pomes, University of Illinois, Computing Services Office X * Copyright (c) 1991 by Paul Pomes and the University of Illinois Board X * of Trustees. X * X * Redistribution and use in source and binary forms, with or without X * modification, are permitted provided that the following conditions X * are met: X * 1. Redistributions of source code must retain the above copyright X * notice, this list of conditions and the following disclaimer. X * 2. Redistributions in binary form must reproduce the above copyright X * notice, this list of conditions and the following disclaimer in the X * documentation and/or other materials provided with the distribution. X * 3. All advertising materials mentioning features or use of this software X * must display the following acknowledgement: X * This product includes software developed by the University of X * Illinois, Urbana and its contributors. X * 4. Neither the name of the University nor the names of its contributors X * may be used to endorse or promote products derived from this software X * without specific prior written permission. X * X * THIS SOFTWARE IS PROVIDED BY THE TRUSTEES AND CONTRIBUTORS ``AS IS'' AND X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE X * ARE DISCLAIMED. IN NO EVENT SHALL THE TRUSTEES OR CONTRIBUTORS BE LIABLE X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF X * SUCH DAMAGE. X * X * Email: Paul-Pomes@uiuc.edu USMail: Paul Pomes X * ICBM: 40 06 47 N / 88 13 35 W University of Illinois - CSO X * 1304 West Springfield Avenue X * Urbana, Illinois, 61801-2910 X * @(#)$Id: phquery.h,v 1.10 1992/03/09 00:16:47 paul Exp $ X */ X X/* X * Configuration parameters. X * X * Defining EXPAND_TO will print the list of expanded addresses on an added X * X-PH-To: header line. This will also expand names found in /usr/lib/aliases X * lists. Leaving it undefined will cause phquery to print only a version X * line with the name of the host running phquery, e.g., X * X-Ph: V3.5@uxc.cso.uiuc.edu . X */ X/*#define EXPAND_TO /* Print translated addresses */ X X/* X * An address tested as a name is first run through as is. If no matches X * are found then any punctuation characters are converted one at a time X * (leftmost first) to space characters and the lookup is repeated until X * there are no more punctuation characters. If WILDNAMES is #define'd, X * a wildcard char '*' will be appended after each single character name, X * e.g. p-pomes is tried as "p* pomes". This has risks as follows: assume X * Duncan Lawrie sets his alias to "lawrie". A query for d-lawrie will X * fail as a alias lookup but succeed as a name lookup when written as X * "d* lawrie". This works until Joe Student sets his alias to "d-lawrie". X * Whoops. Still in a non-hostile environment, this function may be more X * useful than dangerous. X */ X/*#define WILDNAMES /* Append '*' to single char names */ X X/* End of configurable parameters. */ X X/* X** Reply codes: X** 1XX - status X** 2XX - information X** 3XX - additional information or action needed X** 4XX - temporary errors X** 5XX - permanent errors X** 6XX - phquery specific codes X*/ X#define LR_PROGRESS 100 /* in progress */ X#define LR_ECHO 101 /* echoing cmd */ X X#define LR_OK 200 /* success */ X#define LR_RONLY 201 /* database ready in read only mode */ X X#define LR_MORE 300 /* need more info */ X#define LR_LOGIN 301 /* encrypt this string */ X X#define LR_TEMP 400 /* temporary error */ X#define LR_INTERNAL 401 /* database error, possibly temporary */ X#define LR_LOCK 402 /* lock not obtained within timeout period */ X#define LR_DOWN 475 /* database unavailable; try again later */ X X#define LR_ERROR 500 /* hard error; general */ X#define LR_NOMATCH 501 /* no matches to query */ X#define LR_TOOMANY 502 /* too many matches to query */ X#define LR_AINFO 503 /* may not see that field */ X#define LR_ASEARCH 504 /* may not search on that field */ X#define LR_ACHANGE 505 /* may not change field */ X#define LR_NOTLOG 506 /* must be logged in */ X#define LR_FIELD 507 /* field unknown */ X#define LR_ABSENT 508 /* field not present in entry */ X#define LR_ALIAS 509 /* requested alias is already in use */ X#define LR_AENTRY 510 /* may not change entry */ X#define LR_ADD 511 /* may not add entries */ X#define LR_VALUE 512 /* illegal value */ X#define LR_OPTION 513 /* unknown option */ X#define LR_UNKNOWN 514 /* unknown command */ X#define LR_NOKEY 515 /* no indexed field found in query */ X#define LR_AUTH 516 /* no authorization for query */ X#define LR_READONLY 517 /* operation failed; database is read-only */ X#define LR_LIMIT 518 /* too many entries selected for change */ X#define LR_HISTORY 519 /* history substitution failed */ X X#define LR_SYNTAX 599 /* syntax error */ X X#define LR_AMBIGUOUS 600 /* ambiguous or multiple match */ X X#define NONE_OF_ABOVE -1 X Xstruct ReplyCodes { X int key; X char *value; X} Codes[] = { X LR_PROGRESS, "Nameserver search in progress", X LR_ECHO, "Echoing nameserver cmd", X LR_OK, "Success", X LR_RONLY, "Nameserver database ready in read only mode", X LR_MORE, "More info needed to process nameserver query", X LR_LOGIN, "Encrypt this string", X LR_TEMP, "Temporary nameserver error", X LR_INTERNAL, "Nameserver database error, possibly temporary", X LR_LOCK, "Nameserver lock not obtained within timeout period", X LR_ERROR, "Nameserver hard error; general", X LR_NOMATCH, "No matches to nameserver query", X LR_TOOMANY, "Too many matches found to nameserver query", X LR_AINFO, "May not see that nameserver field", X LR_ASEARCH, "May not search on that nameserver field", X LR_ACHANGE, "May not change that nameserver field", X LR_NOTLOG, "Must be logged in to nameserver", X LR_FIELD, "Unknown nameserver field", X LR_ABSENT, "E-mail field not present in nameserver entry", X LR_ALIAS, "Requested nameserver alias is already in use", X LR_AENTRY, "May not change nameserver entry", X LR_ADD, "May not add nameserver entries", X LR_VALUE, "Illegal value", X LR_OPTION, "Unknown nameserver option", X LR_UNKNOWN, "Unknown nameserver command", X LR_NOKEY, "No indexed field found in nameserver query", X LR_AUTH, "No authorization for nameserver request", X LR_READONLY, "Nameserver operation failed; database is read-only", X LR_LIMIT, "Too many nameserver entries selected for change", X LR_HISTORY, "History substitution failed", X LR_SYNTAX, "Syntax error", X LR_AMBIGUOUS, "Multiple matches found for nameserver query", X NONE_OF_ABOVE, (char *)NULL X}; X X/* X * Field types returned by QI. These must be sorted in lexographic order. X */ X#define ADDRESS 0 X#define ALIAS 1 X#define ALL 2 X#define BIRTHDAY 3 X#define CALLSIGN 4 X#define CLASSCO 5 X#define CURRICULUM 6 X#define DEF_ACCOUNT 7 X#define DEPARTMENT 8 X#define EMAIL 9 X#define FAMILY 10 X#define HERO 11 X#define HOME_ADDRESS 12 X#define HOURS 13 X#define ID 14 X#define MAILCODE 15 X#define MAIL_ADDRESS 16 X#define NAME 17 X#define NICKNAME 18 X#define OFFICE_ADDRESS 19 X#define OTHER 20 X#define PAGER 21 X#define PASSWORD 22 X#define PERMANENT_ADDRESS 23 X#define PHONE 24 X#define PROJECT 25 X#define PROXY 26 X#define REVISIONS 27 X#define SOUND 28 X#define TITLE 29 X#define TYPE 30 X Xstruct QI_fields { X int key; X char *value; X} Fields[] = { X ADDRESS, "address", X ALIAS, "alias", X ALL, "all", X BIRTHDAY, "birthday", X CALLSIGN, "callsign", X CLASSCO, "classco", X CURRICULUM, "curriculum", X DEF_ACCOUNT, "def_account", X DEPARTMENT, "department", X EMAIL, "email", X FAMILY, "family", X HERO, "hero", X HOME_ADDRESS, "home_address", X HOURS, "hours", X ID, "id", X MAIL_ADDRESS, "mail_address", X MAILCODE, "mailcode", X NAME, "name", X NICKNAME, "nickname", X OFFICE_ADDRESS, "office_address", X OTHER, "other", X PAGER, "pager", X PASSWORD, "password", X PERMANENT_ADDRESS, "permanent_address", X PHONE, "phone", X PROJECT, "project", X PROXY, "proxy", X REVISIONS, "revisions", X SOUND, "sound", X TITLE, "title", X TYPE, "type", X NONE_OF_ABOVE, (char *)NULL X}; X Xstruct QI_response { X int code; X int subcode; X int field; X char *message; X}; Xtypedef struct QI_response QIR; X Xstruct NewAddress { X char *original; X char *new; X int code; X QIR *QIalt; X}; Xtypedef struct NewAddress NADD; END_OF_FILE if test 8640 -ne `wc -c <'phquery/phquery.h'`; then echo shar: \"'phquery/phquery.h'\" unpacked with wrong size! fi # end of 'phquery/phquery.h' fi if test -f 'phquery/sendmail.diffs' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'phquery/sendmail.diffs'\" else echo shar: Extracting \"'phquery/sendmail.diffs'\" \(1934 characters\) sed "s/^X//" >'phquery/sendmail.diffs' <<'END_OF_FILE' XThis file shows the changes I had to make to my SunOS 4.1.1 sendmail.cf Xto get mail sent to my alternate hostname, horton, get routed Xthru phquery. XIt was produced with 'diff -c', and shows the context of the changes. X XThe changes consist simply of adding the alternate name to the Cw class, Xadding a class with CM to list the alternate hostnames which trigger Xphquery, defining a PH mailer to invoke phquery, and adding a single Xrule at the beginning of ruleset zero to send properly-addressed mail Xthru the PH mailer. X X- Dan Kegel (dank@blacks.jpl.nasa.gov) X X*** /etc/sendmail.cf.noph Sat Aug 1 12:12:04 1992 X--- /etc/sendmail.cf.ph Sat Aug 1 12:07:15 1992 X*************** X*** 34,41 **** X Dj$w X X # Aliases for ourself X! Cw blacks blacks.jpl.nasa.gov X X # major relay mailer - typical choice is "ddn" if you are on the X # Defense Data Network (e.g. Arpanet or Milnet) X DMddn X--- 34,47 ---- X Dj$w X X # Aliases for ourself X! Cw horton horton.jpl.nasa.gov blacks blacks.jpl.nasa.gov X! #Cw blacks blacks.jpl.nasa.gov X X+ #### start phquery X+ # Aliases for domain addresses for which we send mail thru phquery X+ CMhorton horton.jpl.nasa.gov X+ #### end phquery X+ X # major relay mailer - typical choice is "ddn" if you are on the X # Defense Data Network (e.g. Arpanet or Milnet) X DMddn X*************** X*** 249,254 **** X--- 255,265 ---- X Mlocal, P=/bin/mail, F=rlsDFMmnP, S=10, R=20, A=mail -d $u X Mprog, P=/bin/sh, F=lsDFMeuP, S=10, R=20, A=sh -c $u X X+ #### start phquery X+ # phquery mailer; rewrites addresses using CSO name lookup X+ MPH, P=/etc/horton/phquery, F=DFMhnmur, A=phquery $u X+ #### end phquery X+ X S10 X # None needed. X X*************** X*** 361,366 **** X--- 372,381 ---- X S0 X # On entry, the address has been canonicalized and focused by ruleset 3. X # Handle special cases..... X+ X+ #### start phquery X+ R$*<@$=M> $#PH $@$w $:$1 X+ #### end phquery X X R@ $#local $:$n handle <> form X END_OF_FILE if test 1934 -ne `wc -c <'phquery/sendmail.diffs'`; then echo shar: \"'phquery/sendmail.diffs'\" unpacked with wrong size! fi # end of 'phquery/sendmail.diffs' fi if test -f 'phquery/sendmail.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'phquery/sendmail.h'\" else echo shar: Extracting \"'phquery/sendmail.h'\" \(437 characters\) sed "s/^X//" >'phquery/sendmail.h' <<'END_OF_FILE' X/* bogus sendmail.h; this replaces the sendmail.h from IDA sendmail X * for purposes of compiling phquery. X * - Dan Kegel (dank@blacks.jpl.nasa.gov) X */ X#include X#include X#include X#include X#ifdef hpux X#include X#else X#include X#endif X#include X#include X#include X#include X#include X X#include "cdefs.h" END_OF_FILE if test 437 -ne `wc -c <'phquery/sendmail.h'`; then echo shar: \"'phquery/sendmail.h'\" unpacked with wrong size! fi # end of 'phquery/sendmail.h' fi echo shar: End of archive 4 \(of 4\). cp /dev/null ark4isdone MISSING="" for I in 1 2 3 4 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fi done if test "${MISSING}" = "" ; then echo You have unpacked all 4 archives. rm -f ark[1-9]isdone else echo You still need to unpack the following archives: echo " " ${MISSING} fi ## End of shell archive. exit 0