Sendmail cf hacks to allow mailing to newsgroups

lepreau at utah-cs.UUCP lepreau at utah-cs.UUCP
Sat Jul 28 18:04:34 AEST 1984


: This is a shell script to unpack the files.
: You must run it with sh not csh.
echo Extracting README
sed -e 's/^X//' <<'EnDoFiNpUt' >README
XNote: only reason I'm posting this is cause somebody asked!
XIt is certainly not up to the high standards of this ng (yuk yuk).
X
XThese .cf mods and dumb shell script are hacks to allow sendmail to
Xhandle mail to newsgroups.  CAVEAT: This all worked a long time ago
Xunder 4.1a sendmail, and will probably not drop perfectly into 4.2
Xconfig files, and may not work so hot in them, though we are using it
Xsuccessfully with our much hacked versions of 4.2 config files. I
Xhaven't looked at it for a long time, so some of my recollections below
Xmay be wrong.
X
XIt is trivial except for the stuff to allow "context-sensitive"
Xtoplevel newsgroup domains, i.e., ones which conflict with names of real
Xdomains (or real to sendmail, which uses several internally, such as
XLOCAL).  In our case the conflict arises with local newsgroup tree
X"utah.all", for we also use that internally as a mail domain. The L
Xclass define in csbase.m4 is for the valid subgroups of the conflicting
Xroot.  If you don't have such conflicts, it's trivial. The M class is all
Xvalid roots.
X
XI don't really remember, but I think the only restriction was that
Xnewsgroups with different roots would go out as separate articles.
XI think that multiple ng's with the same root (net.dumb,net.crap)
Xgo as one article.  However I have not checked now and not for almost
Xa year and really don't ever want to look at it again!  Caveat emptor.
X
XOh yeah, you'd better have hacked up your recnews program to work with
Xsendmail, or you'll inject into the net articles full of bogus subject and
Xother headers.  Basically just rip the guts out of recnews cause
Xsendmail can be relied upon to deliver a valid rfc822 msg to it.
X
XJay Lepreau
EnDoFiNpUt
echo Extracting base.diff
sed -e 's/^X//' <<'EnDoFiNpUt' >base.diff
X*** /tmp/,RCSt1015282	Sat Jul 28 01:20:32 1984
X--- base.m4	Mon Sep  5 03:39:22 1983
X***************
X*** 11,13
X  #
X! #	$Header: base.m4,v 1.2 83/09/05 01:04:46 lepreau Exp $
X  #		@(#)base.m4	3.54		6/11/83
X
X--- 11,13 -----
X  #
X! #	$Header: RCS/base.m4,v 1.3 83/09/05 02:15:35 lepreau Exp $
X  #		@(#)base.m4	3.54		6/11/83
X***************
X*** 141,142
X  R$+@$+.UUCP		$2!$1				u at h.UUCP => h!u
X  
X
X--- 141,146 -----
X  R$+@$+.UUCP		$2!$1				u at h.UUCP => h!u
X+ 
X+ # Kludge: fix up news addresses. Avoid $j cause it makes caps.
X+ R$=L at utah		utah.$1@$w.ARPA		grp at utah => utah.grp at cs.ARPA
X+ R$+@$=M			$2.$1@$w.ARPA		grp at dist => dist.grp at cs.ARPA
X  
EnDoFiNpUt
echo Extracting csbase.diff
sed -e 's/^X//' <<'EnDoFiNpUt' >csbase.diff
X*** /tmp/,RCSt1015303	Sat Jul 28 01:22:21 1984
X--- /tmp/,RCSt2015303	Sat Jul 28 01:22:23 1984
X***************
X*** 4,6
X  #
X! #	$Header: csbase.m4,v 1.2 83/09/05 00:04:09 lepreau Exp $
X  #	@(#)csbase.m4	3.10		2/24/83
X
X--- 4,6 -----
X  #
X! #	$Header: csbase.m4,v 1.4 83/09/16 14:24:45 lepreau Exp $
X  #	@(#)csbase.m4	3.10		2/24/83
X***************
X*** 39,40
X  
X  include(base.m4)
X
X--- 39,47 -----
X  
X+ # Netnews prefixes (pseudo-domains).  "utah"  gets special treatment below.
X+ # Have to quote the string ``unix'' cause otherwise m4 eats it.
X+ CMnet vax `unix'
X+ 
X+ # Context sensitive stuff for netnews domain "utah".  Valid suffixes.
X+ CLgeneral sys test hacks emacs
X+ 
X  include(base.m4)
X***************
X*** 57
X  include(etherm.m4)
X
X--- 64,65 -----
X  include(etherm.m4)
X+ include(netnewsm.m4)
EnDoFiNpUt
echo Extracting mrecnews
sed -e 's/^X//' <<'EnDoFiNpUt' >mrecnews
X#! /bin/csh -f
X# Accept news for net.* from sendmail.  Args are the domain prefix
X# and the ng suffix(es).
X# Waits for inews in order to find errors.
X# $Header: RCS/mrecnews.sh,v 1.2 83/09/05 03:18:27 lepreau Exp $
X
Xif ($#argv < 2) then
X	echo No newsgroups specified, impossible
X	exit 1
Xendif
X
Xset dom = $1; shift		# domain
Xset ng = $dom.$1; shift		# first newsgrp
Xforeach f($*)
X	set ng = "$ng,$dom.$f"
Xend
X
X/usr/local/lib/news/recnews $ng >& /tmp/nerr.$$
Xsleep 20	# inews forks immediately: give it time to say no such newsgrp
X
Xif ( -z /tmp/nerr.$$) then
X	rm -f /tmp/nerr.$$
X	exit 0
Xelse
X	echo -n "FAILED: "
X	cat /tmp/nerr.$$
X	rm -f /tmp/nerr.$$
X	exit 67		# "no such user" - most likely bad newsgrp name
Xendif
EnDoFiNpUt
echo Extracting netnewsm.m4
sed -e 's/^X//' <<'EnDoFiNpUt' >netnewsm.m4
X############################################################
X############################################################
X#####
X#####		Netnews Mailer specification
X#####
X#####	$Header: RCS/netnewsm.m4,v 1.1 83/09/05 02:14:55 lepreau Exp $
X#####
X############################################################
X############################################################
X
X# "mrecnews" is front end to recnews which turns multiple args
X# into comma separated list of net.foo ngs.
XMnetnews, P=/usr/local/lib/news/mrecnews, F=smDFe, M=500000,
X	A=mrecnews $h $u
EnDoFiNpUt
echo Extracting netnewsm.rlog
sed -e 's/^X//' <<'EnDoFiNpUt' >netnewsm.rlog
X
XRCS file:        RCS/netnewsm.m4,v;   Working file:    netnewsm.m4
Xhead:            1.1
Xlocks:           lepreau: 1.1;  strict
Xaccess list:   
Xsymbolic names:
Xcomment leader:  ""
Xtotal revisions: 1;    selected revisions: 1
Xdescription:
XNetnews mailer spec.  Note the 'e' flag on it.  Depends on timeout
Xvalue in mrecnews.
X----------------------------
Xrevision 1.1        locked by: lepreau;       
Xdate: 83/09/05 02:14:55;  author: lepreau;  state: Exp;  
XInitial revision
X=============================================================================
EnDoFiNpUt
echo Extracting zerobase.diff
sed -e 's/^X//' <<'EnDoFiNpUt' >zerobase.diff
X*** /tmp/,RCSt1015204	Sat Jul 28 01:15:43 1984
X--- zerobase.m4	Mon Sep  5 03:39:43 1983
X***************
X*** 8,10
X  #####
X! #####	$Header: zerobase.m4,v 1.2 83/09/04 10:54:01 lepreau Exp $
X  #####		@(#)zerobase.m4	3.4		3/20/83
X
X--- 8,10 -----
X  #####
X! #####	$Header: RCS/zerobase.m4,v 1.2 83/09/04 10:54:01 lepreau Exp $
X  #####		@(#)zerobase.m4	3.4		3/20/83
X***************
X*** 23,24
X  R$*<@[$E]>$*		$#local$:$1$3			numeric spec is me
X  
X
X--- 23,26 -----
X  R$*<@[$E]>$*		$#local$:$1$3			numeric spec is me
X+ R$=L<@utah>		$#netnews$@utah$:$1		utah.newsgrp
X+ R$+<@$=M>		$#netnews$@$2$:$1		dist.newsgrp
X  
EnDoFiNpUt
echo Finished



More information about the Comp.sources.unix mailing list