From: CSBVAX::MRGATE!NED%YMIR.BITNET@CUNYVM.CUNY.EDU@SMTP 5-FEB-1988 18:07 To: ARISIA::EVERHART Subj: Re: BITNET Gateways/Domains Received: from YMIR.BITNET by CUNYVM.CUNY.EDU ; Thu, 04 Feb 88 21:29:02 EST Date: Thu, 4 Feb 88 17:20 PST From: Ned Freed Subject: Re: BITNET Gateways/Domains To: info-pmdf@YMIR.BITNET X-VMS-To: IPMDF Resent-date: Thu, 4 Feb 88 17:35 PST Resent-to: INFO-PMDF-LIST@YMIR.BITNET Sanford L. Berger writes: > I'm just wondering how BITNET sites that run PMDF keep their gateway > rules and channels up-to-date. I know about the DOMAINS.NAMES file available > from BITNIC but this is not in a form readily usable by PMDF. So far I've > been updating once a month by hand but this is somewhat tedious. Is there > any source for ready-to-go PMDF rule/channel definitions that are kept > up to date or am I already using the best method available. I use a command procedure originally written by Mike Iglesias to convert the DOMAIN NAMES file into a couple of chunks suitable for insertion into the PMDF configuration file. This command file has been posted several times (and will be included in the next distribution), but since I recently made a few changes to it I thought I'd repost it. This new version spits out a new file, GATEWAY.RULES, which contains suitable rules for use on remote systems running PMDF that do not have direct access to JNET. Anyway, the new command file follows. Ned $! $! Convert DOMAIN NAMES to PMDF format $! $! Author: Mike Iglesias $! University of California, Irvine $! MIGLESIAS@UCIVMSA $! $! $! Input: domain.names (from NICSERVE@BITNIC) $! Output: gates.rules (rules for DOMAIN.DAT or PMDF.CNF) $! gates.chans (channel defs for PMDF.CNF) $! gateway.rules (rules for a remote system that will route $! things to a gateway) $! $ set noon $ on control_y then goto ctrl_y $! $ gateway_user_name = "smtpuser" $ gateway_system_name = "ymir.bitnet" $! $ open/read in domain.names $ open/write rules gates.tmp $ open/write grules gateway.tmp $ open/write tmp chans.tmp $! $loop: $ read/end=done in rec $ if f$extract(0,6,rec) .nes. ":nick." then $goto loop $! $ rec1 = f$edit(rec,"compress,trim") $ nick = f$element(0," ",rec) $ domain = f$extract (6,99,nick) ! get domain name $! $ info = f$element(1," ",rec1) $ dot = f$locate(".",info) $ at = f$locate("@",info) $ mailer = f$extract(dot+1,at-dot-1,info) ! get mailer name $ site = f$extract(at+1,99,info) ! and site $ lsite = f$edit(site,"lowercase") $! $ smtp = "nosmtp" $ bsmtp = f$element(2," ",rec1) $ if bsmtp .eqs. "BSMTP" then $smtp = "smtp" ! see if mailer wants smtp $! $! For some reason, some of the domains don't have a leading ".". $! In that case, we have to write two rules for the domain, one $! without the leading dot and one with it. I don't know if there's $! a better way to handle this. $! $ if f$length(domain) .lt. 30 then - domain = f$extract(0,30,domain+" ") $ if f$extract(0,1,domain) .nes. "." then $goto no_dot $ write rules "''domain' $U%$H$D@''site'.BITNET" $ write grules "''domain' $U%$H$D@''gateway_system_name'" $ goto wr_tmp $! $no_dot: $ write rules ".''domain' $U%$H$D@''site'.BITNET" $ write grules ".''domain' $U%$H$D@''gateway_system_name'" $ write rules "''domain' $U%$D@''site'.BITNET" $ write grules "''domain' $U%$D@''gateway_system_name'" $! $! Write the site, mailer, and smtp info to the temp file. $! $wr_tmp: $ psite = f$extract(0,8,site+" ") ! pad for SORT $ pmailer = f$extract(0,8,mailer+" ") $ write tmp "''psite' ''mailer' ''smtp'" $ goto loop $! $! $done: $ close in $ close rules $ close grules $ close tmp $! $! Sort GATES.TMP and GATEWAY.TMP to make them nicer looking $! $ sort gates.tmp/key=(pos:1,size:30) gates.rules $ sort gateway.tmp/key=(pos:1,size:30) gateway.rules $! $! Sort CHANS.TMP to get rid of the duplicate records. $! $ sort chans.tmp/key=(pos:1,size:17)/nodup chans.srt $ open/read tmp chans.srt $ open/write chan gates.chans $! $! Now generate the channel tables for PMDF. $! $ch_loop: $ read/end=ch_done tmp rec $ rec1 = f$edit(rec,"compress,lowercase,trim") $ lsite = f$element(0," ",rec1) $ site = f$edit(lsite,"upcase") $ mailer = f$element(1," ",rec1) $ smtp = f$element(2," ",rec1) $ write chan "bit_''lsite' ''smtp' daemon ''mailer' user ''gateway_user_name'" $ write chan "''site'.BITNET" $ write chan "" $ goto ch_loop $! $ch_done: $ close chan $ close tmp $ delete chans.tmp;*,chans.srt;*,gates.tmp;*,gateway.tmp;* $ exit $! $ctrl_y: $ close in $ close tmp $ close chan $ close rules