/***************************************************************************/ /* GhostMail.rexx */ /* ======================================================================= */ /* GhostWriter for fido and compatible networks */ /* ======================================================================= */ /* written 1995/96 by Ali Rene Schams-Pirzadeh */ /* ======================================================================= */ /* History: */ /* */ /* v0.7beta : (January 1996) */ /* - changed the name "MakeMail" into "GhostMail" */ /* */ /* v0.6beta : (July 1995) */ /* - added keyword TEARLINE to config-file */ /* - show tearline */ /* - show taskpri */ /* - show stack */ /* */ /* v0.5beta : (June 1995) */ /* - number of mails in inbound-dir changed back to 100 again. */ /* - changed the flags (PV,FL,CM,KS) */ /* - works without flags now */ /* - may use a configfile */ /* - added tmpfile-support */ /* - translated doc-file(s) into german */ /* - changed msgid (no ".0" will be added any more) */ /* - added keyword taskpri to config-file */ /* - added keyword stack to config-file */ /* - added 5-dim-addressing */ /* - Thomas Strauss (AmiNet-Upload) got a copy of it */ /* */ /* v0.4beta : (June 1995) */ /* - if words(toname)=2 the subject has been crypted. fixed */ /* - checks all parameter-keywords now */ /* - works with more than 99 mails in inbound-dir now */ /* - Thomas Strauss (AmiNet-Upload) got a copy of it */ /* */ /* v0.3beta : (May 1995) */ /* - added node-support (works with .0 now !) */ /* */ /* v0.2beta : (April 1995) */ /* - changed the output a little bit */ /* - optimized the source */ /* */ /* v0.1beta : (March 1995) */ /* - the first try ;-)) */ /* ======================================================================= */ /* Examples: */ /* */ /* rx GhostMail.rexx */ /* AREA "matrix" */ /* FROMADR 2:2464/221.0 */ /* FROM "Ali Rene Schams-Pirzadeh" */ /* TOADR 2:2464/220.0 */ /* TO "Ali Rene Schams-Pirzadeh" */ /* FLAGS "CM" */ /* SUBJECT "This is an example" */ /* FILE "GhostMail.rexx" */ /* INBOUND "inbound:" */ /* ORIGIN "Original-<-Origin->-" */ /* */ /* rx GhostMail.rexx */ /* AREA "netmail" */ /* FROMADR 2:2464/221.0 */ /* FROM "Ali Rene Schams-Pirzadeh" */ /* TOADR 2:2464/220.0 */ /* TO "Ali Rene Schams-Pirzadeh" */ /* FLAGS "CM" */ /* SUBJECT "This is an example" */ /* FILE "GhostMail.rexx" */ /* INBOUND "inbound:" */ /* ORIGIN "Original-<-Origin->-" */ /* */ /* rx GhostMail.rexx */ /* AREA "newfiles.ger" */ /* FROMADR 2:2464/221.0 */ /* FROM "Ali Rene Schams-Pirzadeh" */ /* TO "Ali Rene Schams-Pirzadeh" */ /* FLAGS "CM" */ /* SUBJECT "This is an example" */ /* FILE "GhostMail.rexx" */ /* INBOUND "inbound:" */ /* ORIGIN "Original-<-Origin->-" */ /***************************************************************************/ /* needs external: */ /* - 'rexxsupport.library' */ /* - 'c:delete' */ /***************************************************************************/ cr = "0d"x; flags = ""; areaname = ""; fromadr = ""; fromname = ""; toadr = ""; toadrdummy = ""; toname = ""; subject = ""; file = ""; inbound = ""; origin = ""; pvtmail = 0; null = "00"x maxmail = 100; /* the maximum number of files to create */ version = "GhostMail v0.7beta" mydelete = "C:Delete" tmpfile1 = "RAM:GhostMail.tmp" pri = -8; stacksize = 300000; tearline = "---" parse arg areanamedummy dummy call showheader; if upper(areanamedummy)=upper("CONFIG") then do; cfgfilename=reverse(trim(reverse(trim(dummy)))); if substr(cfgfilename,1,1)='"' then cfgfilename=substr(cfgfilename,2,length(cfgfilename)-1); if length(cfgfilename)=0 then signal wrongparm; if substr(cfgfilename,length(cfgfilename),1)='"' then cfgfilename=substr(cfgfilename,1,length(cfgfilename)-1); call getcfgfile; end; else do; if upper(areanamedummy)=upper("AREA") then do; call getparm; end; else do; say "*** Cannot find keyword AREA or CONFIG !" signal rauserror; end; end; inbound=upper(inbound); fromadr=reverse(trim(reverse(trim(fromadr)))); if length(fromadr)=0 then signal wrongparm; if substr(fromadr,1,1)='"' then fromadr=substr(fromadr,2,length(fromadr)-1); if substr(fromadr,length(fromadr),1)='"' then fromadr=substr(fromadr,1,length(fromadr)-1); if pos(".",fromadr)=0 then fromadr=fromadr".0" fromname=reverse(trim(reverse(trim(fromname)))); if length(fromname)=0 then signal wrongparm; if substr(fromname,1,1)='"' then fromname=substr(fromname,2,length(fromname)-1); if substr(fromname,length(fromname),1)='"' then fromname=substr(fromname,1,length(fromname)-1); if pvtmail="1" then do; toadr=reverse(trim(reverse(trim(toadr)))); if length(toadr)=0 then signal wrongparm; if substr(toadr ,1,1)='"' then toadr =substr(toadr,2,length(toadr)-1); if substr(toadr ,length(toadr),1)='"' then toadr =substr(toadr,1,length(toadr)-1); if pos(".",toadr)=0 then toadr=toadr".0" end; toname=reverse(trim(reverse(trim(toname)))); if length(toname)=0 then signal wrongparm; if substr(toname ,1,1)='"' then toname =substr(toname,2,length(toname)-1); if substr(toname ,length(toname),1)='"' then toname =substr(toname,1,length(toname)-1); flags=reverse(trim(reverse(trim(flags)))); if length(flags)>0 then do; if substr(flags ,1,1)='"' then flags =substr(flags,2,length(flags)-1); if substr(flags ,length(flags),1)='"' then flags =substr(flags,1,length(flags)-1); end; subject=reverse(trim(reverse(trim(subject)))); if length(subject)=0 then signal wrongparm; if substr(subject ,1,1)='"' then subject =substr(subject,2,length(subject)-1); if substr(subject ,length(subject),1)='"' then subject=substr(subject,1,length(subject)-1); file=reverse(trim(reverse(trim(file)))); if length(file)=0 then signal wrongparm; if substr(file ,1,1)='"' then file =substr(file,2,length(file)-1); if substr(file ,length(file),1)='"' then file =substr(file,1,length(file)-1); inbound=reverse(trim(reverse(trim(inbound)))); if length(inbound)=0 then signal wrongparm; if substr(inbound ,1,1)='"' then inbound =substr(inbound,2,length(inbound)-1); if substr(inbound ,length(inbound),1)='"' then inbound=substr(inbound,1,length(inbound)-1); origin=reverse(trim(reverse(trim(origin)))); if length(origin)=0 then signal wrongparm; if substr(origin,1,1)='"' then origin =substr(origin,2,length(origin)-1); if substr(origin,length(origin),1)='"' then origin=substr(origin,1,length(origin)-1); if exists(file)=0 then do; say "*** file '"file"' does not exist !" signal rauserror; end; say " area: '"areaname"'" say " fromadr: "fromadr say "fromname: '"fromname"'" if pvtmail="1" then do; say " toadr: "toadr end; say " toname: '"toname"'" say " subject: '"subject"'" say " file: '"file"'" say " inbound: '"inbound"'" say "tearline: '"tearline"'" say " origin: '"origin"'" say " taskpri: "pri say " stack: "stacksize options results; options failat 200; if pvtmail="1" then do; if pos("@",toadr)=0 then toadr=toadr"@" end; if pos("@",fromadr)=0 then fromadr=fromadr"@" d1=pos(":",fromadr) if d1=0 then signal wrongparm; zonehere =substr(fromadr,1,d1-1); fromadr =substr(fromadr,d1+1,length(fromadr)-(d1+1)+1); d1=pos("/",fromadr); if d1=0 then signal wrongparm; nethere =substr(fromadr,1,d1-1); fromadr =substr(fromadr,d1+1,length(fromadr)-(d1+1)+1); d1=pos(".",fromadr); if d1=0 then signal wrongparm; nodehere =substr(fromadr,1,d1-1); fromadr =substr(fromadr,d1+1,length(fromadr)-(d1+1)+1); d1=pos("@",fromadr); if d1=0 then signal wrongparm; pointhere =substr(fromadr,1,d1-1); netnamehere =substr(fromadr,d1+1,length(fromadr)-(d1+1)+1); if pvtmail="0" then do; zonenumber =zonehere; netnumber =nethere; nodenumber =nodehere; pointnumber=pointhere; netname =netnamehere; end; else do; d1=pos(":",toadr) if d1=0 then signal wrongparm; zonenumber =substr(toadr,1,d1-1); toadr=substr(toadr,d1+1,length(toadr)-(d1+1)+1); d1=pos("/",toadr); if d1=0 then signal wrongparm; netnumber =substr(toadr,1,d1-1); toadr=substr(toadr,d1+1,length(toadr)-(d1+1)+1); d1=pos(".",toadr); if d1=0 then signal wrongparm; nodenumber =substr(toadr,1,d1-1); toadr =substr(toadr,d1+1,length(toadr)-(d1+1)+1); d1=pos("@",toadr); if d1=0 then signal wrongparm; pointnumber =substr(toadr,1,d1-1); netname =substr(toadr,d1+1,length(toadr)-(d1+1)+1); end; mydate = date(); mydatei = date("I"); mytime = time(); mytimes = time("S"); if ~show("L","rexxsupport.library") then call addlib("rexxsupport.library",0,-30); pragma("stack",stacksize); pragma("priority",pri); call prepmail; reportfilename=inbound"00000" o=1 marker=0; do while marker=0 o2=maxmail-o; if o2<100 then o2="0"o2 if o2<10 then o2="0"o2 if exists(reportfilename||o2".pkt")=1 then marker=1; else do; if o=maxmail then marker=2 end; o=o+1; end; if marker=1 then do; o2=o2+1; end; if marker=2 then do; o2=0; end; if o2<100 then o2="0"o2; if o2<10 then o2="0"o2; reportfilename=reportfilename||o2".pkt" call open(report,reportfilename,"W"); writech(report,msginfo); if exists(file)=0 then do; signal wrongparm; end; call open(mail,file,"R"); do while eof(mail)=0 zeile=readln(mail); if eof(mail)=0 then do; writeln(report,zeile||cr); end; end; call close(mail); if pvtmail="0" then do; writeln(report,tearline||cr); writech(report," * Origin: "origin" ("zonehere":"nethere"/"nodehere"."pointhere); if netnamehere~="" then writech(report,"@"netnamehere); writech(report,")"cr); writech(report,"SEEN-BY: "nethere"/"nodehere); if netnamehere~="" then writech(report,"@"netnamehere); writech(report,")"cr); writech(report,"01"x||"PATH: "nethere"/"nodehere); if netnamehere~="" then writech(report,"@"netnamehere); writech(report,")"cr); end; writech(report,null||null||null); call close(report); raushier:; /* ============================================================================ close all files if open and quit this frequest handler ============================================================================ */ if reportopen=1 then do; call close(report); end; call deletetmpfile; exit; rauserror:; /* ============================================================================ exit with errorcode 100 ============================================================================ */ call deletetmpfile; exit 100; getparm:; /* ============================================================================ parse all parameters ============================================================================ */ parse var dummy areaname fromadrdummy fromadr fromnamedummy zz dummy areaname=upper(areaname); if length(areanamedummy)=0 then signal informparm; if substr(areaname,1,1)='"' then areaname=substr(areaname,2,length(areaname)-1); if substr(areaname,length(areaname),1)='"' then areaname=substr(areaname,1,length(areaname)-1); if upper(fromadrdummy)~=upper("FROMADR") then do; say "*** Cannot find keyword FROMADR !" signal rauserror; end; if upper(fromnamedummy)~=upper("FROM") then do; say "*** Cannot find keyword FROM !" signal rauserror; end; z=""; do while substr(zz,length(zz),1)~='"' if length(z)=0 then z=zz else z=z" "zz parse var dummy zz dummy end; if length(z)=0 then z=zz else z=z" "zz /* fromname=substr(z,2,length(z)-2); */ fromname=z; if areaname=upper("matrix")|areaname=upper("netmail") then do parse var dummy toadrdummy toadr dummy pvtmail = 1 end; parse var dummy tonamedummy zz dummy if upper(tonamedummy)~=upper("TO") then do; say "*** Cannot find keyword TO !" signal rauserror; end; z=""; do while substr(zz,length(zz),1)~='"' if length(z)=0 then z=zz else z=z" "zz parse var dummy zz dummy end; if length(z)=0 then z=zz else z=z" "zz /* toname=substr(z,2,length(z)-2); */ toname=z; parse var dummy flagsdummy zz dummy if upper(flagsdummy)~=upper("FLAGS") then do; say "*** Cannot find keyword FLAGS !" signal rauserror; end; z=flags; do while substr(zz,length(zz),1)~='"' if length(z)=0 then z=zz else z=z" "zz parse var dummy zz dummy end; if length(z)=0 then z=zz else z=z" "zz /* flags=substr(z,2,length(z)-2); */ flags=z; parse var dummy subjectdummy zz dummy if upper(subjectdummy)~=upper("SUBJECT") then do; say "*** Cannot find keyword SUBJECT !" signal rauserror; end; z=""; do while substr(zz,length(zz),1)~='"' if length(z)=0 then z=zz else z=z" "zz parse var dummy zz dummy end; if length(z)=0 then z=zz else z=z" "zz /* subject=substr(z,2,length(z)-2); */ subject=z; parse var dummy filedummy zz dummy z=""; do while substr(zz,length(zz),1)~='"' if length(z)=0 then z=zz else z=z" "zz parse var dummy zz dummy end; if length(z)=0 then z=zz else z=z" "zz /* file=substr(z,2,length(z)-2); */ file=z; parse var dummy inbounddummy inbound origindummy origin if upper(inbounddummy)~=upper("INBOUND") then do; say "*** Cannot find keyword INBOUND !" signal rauserror; end; if upper(origindummy)~=upper("ORIGIN") then do; say "*** Cannot find keyword ORIGIN !" signal rauserror; end; return; getcfgfile:; /* ============================================================================ read the config-file ============================================================================ */ if exists(cfgfilename)=1 then do; call open(tmp,cfgfilename,"R"); do while eof(tmp)=0 zeile=readln(tmp); if length(zeile)>0 then do; if substr(zeile,1,1)~==";" then do; if upper(word(zeile,1))==upper("area") then do; areaname=upper(substr(zeile,6,length(zeile)-6+1)); areaname=reverse(trim(reverse(trim(areaname)))); if substr(areaname,1,1)='"' then areaname=substr(areaname,2,length(areaname)-1); if substr(areaname,length(areaname),1)='"' then areaname=substr(areaname,1,length(areaname)-1); end; if upper(word(zeile,1))==upper("taskpri") then do; pri=word(zeile,2); end; if upper(word(zeile,1))==upper("stack") then do; stacksize=word(zeile,2); end; if upper(word(zeile,1))==upper("fromadr") then do; fromadr=substr(zeile,9,length(zeile)-9+1); end; if upper(word(zeile,1))==upper("from") then do; fromname=substr(zeile,6,length(zeile)-6+1); end; if upper(word(zeile,1))==upper("toadr") then do; toadr=substr(zeile,7,length(zeile)-7+1); end; if upper(word(zeile,1))==upper("to") then do; toname=substr(zeile,4,length(zeile)-4+1); end; if upper(word(zeile,1))==upper("subject") then do; subject=substr(zeile,9,length(zeile)-9+1); end; if upper(word(zeile,1))==upper("flags") then do; flags=substr(zeile,7,length(zeile)-7+1); end; if upper(word(zeile,1))==upper("file") then do; file=substr(zeile,6,length(zeile)-6+1); end; if upper(word(zeile,1))==upper("tearline") then do; tearline=substr(zeile,10,length(zeile)-10+1); end; if upper(word(zeile,1))==upper("inbound") then do; inbound=substr(zeile,9,length(zeile)-9+1); end; if upper(word(zeile,1))==upper("origin") then do; origin=substr(zeile,8,length(zeile)-8+1); origin=reverse(trim(reverse(trim(origin)))); if substr(origin,1,1)='"' then origin=substr(origin,2,length(origin)-1); if substr(origin,length(origin),1)='"' then origin=substr(origin,1,length(origin)-1); end; end; end; end; call close(tmp); tearline=reverse(trim(reverse(trim(tearline)))); if substr(tearline,1,1)='"' then tearline=substr(tearline,2,length(tearline)-1); if substr(tearline,length(tearline),1)='"' then tearline=substr(tearline,1,length(tearline)-1); if areaname="" then do; say "*** Cannot find keyword AREA !" signal rauserror; end; if fromadr="" then do; say "*** Cannot find keyword FROMADR !" signal rauserror; end; if fromname="" then do; say "*** Cannot find keyword FROMNAME !" signal rauserror; end; if areaname=upper("matrix")|areaname=upper("netmail") then do pvtmail = 1 if toadr="" then do; say "*** Cannot find keyword TOADR !" signal rauserror; end; end; if toname="" then do; say "*** Cannot find keyword TONAME !" signal rauserror; end; if subject="" then do; say "*** Cannot find keyword SUBJECT !" signal rauserror; end; if file="" then do; say "*** Cannot find keyword FILE !" signal rauserror; end; if substr(tearline,1,3)~="---" then do; say "*** Wrong format of TEARLINE !" signal rauserror; end; if inbound="" then do; say "*** Cannot find keyword INBOUND !" signal rauserror; end; if origin="" then do; say "*** Cannot find keyword ORIGIN !" signal rauserror; end; end; else do; say "*** Fatal error occured - cannot open cfgfilename '"cfgfilename"' !" signal rauserror; end; return; changedate:; /* ============================================================================ change alphanumeric month into numeric one ============================================================================ */ ii=pos(upper(filedate),upper("JanFebMarAprMayJunJulAugSepOctNovDec")); filedate=(ii+2)/3 return; changemonth:; /* ============================================================================ change numeric month into alphanumeric one ============================================================================ */ ii=pos(upper(filedate),upper("010203040506070809101112")); filedate=substr("JanFebMarAprMayJunJulAugSepOctNovDec",(3*((ii+1)/2))-2,3); return; prepmail:; /* ============================================================================ prep the netmail ============================================================================ */ null72 = copies(null,72) Pass = left(null72,8) Fill = left(null72,14) fill2 = left(null72,4); Parse Var mytime Hour":"Minute":"Second Year = substr(mydate,length(mydate)-1,2) Year = substr('0000'||D2X(year),length("0000"||d2x(year))-3,4) YearHi = X2C(substr(year, 1,2)) YearLo = X2C(substr(year,length(year)-1,2)) Month = Substr(mydate,4,3) Month = Pos(Month,"JanFebMarAprMayJunJulAugSepOctNovDec") Month = X2C(Right("00"||(((Month+2)/3)-1),2))||null Day = Left(mydate,2) Day = Right('0000'||D2X(Day),4) DayHi = X2C(Left(Day,2)) DayLo = X2C(Right(Day,2)) Today = left(mydate,7)||right(mydate,2)||" "mytime||null Hour = right('0000'||D2X(Hour),4) HourHi = X2C(left(Hour,2)) HourLo = X2C(right(Hour,2)) Minute = right('0000'||D2X(Minute),4) MinuteHi = X2C(left(Minute,2)) MinuteLo = X2C(right(Minute,2)) Second = right('0000'||D2X(Second),4) SecondHi = X2C(left(Day,2)) SecondLo = X2C(right(Second,2)) Baud = null||null TRead = null||null Cost = null||null Dzonenumber = right('0000'||D2X(zonenumber),4) DzonenumberHi = X2C(left(Dzonenumber,2)) DzonenumberLo = X2C(right(Dzonenumber,2)) Dnodenumber = right('0000'||D2X(nodenumber),4) DnodenumberHi = X2C(left(Dnodenumber,2)) DnodenumberLo = X2C(right(Dnodenumber,2)) Dnetnumber = right('0000'||D2X(netnumber),4) DnetnumberHi = X2C(left(Dnetnumber,2)) DnetnumberLo = X2C(right(Dnetnumber,2)) Dpointnumber = right('0000'||D2X(pointnumber),4) DpointnumberHi = X2C(left(Dpointnumber,2)) DpointnumberLo = X2C(right(Dpointnumber,2)) Ozonenumber = right('0000'||D2X(zonehere),4) OzonenumberHi = X2C(left(Ozonenumber,2)) OzonenumberLo = X2C(right(Ozonenumber,2)) Onodenumber = right('0000'||D2X(nodehere),4) OnodenumberHi = X2C(left(Onodenumber,2)) OnodenumberLo = X2C(right(Onodenumber,2)) Onetnumber = right('0000'||D2X(nethere),4) OnetnumberHi = X2C(left(Onetnumber,2)) OnetnumberLo = X2C(right(Onetnumber,2)) Opointnumber = right('0000'||D2X(pointhere),4) OpointnumberHi = X2C(left(Opointnumber,2)) OpointnumberLo = X2C(right(Opointnumber,2)) DAddr = Dnetnumber||Dnodenumber Prod = '00'x Serial = '00'x ReplyTo = null||null /* attrib: pvt [pv] = "01"x = " 1"d */ /* crashmail [cm] = "02"x = " 2"d */ /* not used = "04"x = " 4"d */ /* not used = "08"x = " 8"d */ /* file attach [fl] = "10"x = " 16"d */ /* not used = "20"x = " 32"d */ /* not used = "40"x = " 64"d */ /* kill/send [ks] = "80"x = "128"d */ attrib=0; do i=1 to words(flags) thisflag=upper(word(flags,i)); thisflag=reverse(trim(reverse(trim(thisflag)))); if substr(thisflag,1,1)='"' then thisflag=substr(thisflag,2,length(thisflag)-1); if substr(thisflag,length(thisflag),1)='"' then thisflag=substr(thisflag,1,length(thisflag)-1); if thisflag=upper("pv") then attrib=attrib+ 1; if thisflag=upper("cm") then attrib=attrib+ 2; if thisflag=upper("fl") then attrib=attrib+ 16; /* "10"x */ if thisflag=upper("ks") then attrib=attrib+128; /* "80"x */ end; if pvtmail="0" then do; attrib = bitand(attrib,"FE"x); /* echomails are NEVER private ! */ end; else do; attrib = bitand(attrib,"FE"x); /* netmails are ALWAYS private ! */ attrib = attrib+1; /* 'bitor' has a bug ! */ end; Attrib = d2c(attrib)||d2c("00") NReply = null||null PMsgStart = '02'x||'00'x INTL = '01'x||'INTL 'zonenumber':'netnumber'/'nodenumber if pointnumber~="0" then intl=intl'.'pointnumber if netname~="" then intl=intl"@"netname; intl=intl' 'zonehere':'nethere'/'nodehere if pointhere~="0" then intl=intl'.'pointhere if netnamehere~="" then intl=intl"@"netnamehere intl=intl||CR TOPT = '01'x||'TOPT 'pointnumber||CR /************************************************/ /* Figure out Message-ID from 01/01/70 00:00:00 */ /* Code by: Bob English */ /************************************************/ /* Find number of days since 1/1/78 */ /* Find number of secs since midnight */ Secs70 = 252460600 /* Number of secs from 1/1/70 to 12/31/77 */ ID = (mydatei * 86400) + mytimes + Secs70 /* Add up all the seconds for the MsgID */ MID = D2X(ID) /* Convert to Hex */ /************************************************/ msgid=""; if pvtmail="0" then do; msgid=msgid"AREA:"areaname||cr end; MsgID = msgid||"01"x||"MSGID: "zonehere":"nethere"/"nodehere if pointhere~="0" then msgid=msgid"."pointhere if netnamehere~="" then msgid=msgid"@"netnamehere msgid=msgid" "MID||CR PID = '01'x||'PID: 'version||CR /* 20 */ PHead1 = OnodenumberLo||OnodenumberHi||DnodenumberLo||DnodenumberHi||YearLo||YearHi||Month||DayLo||DayHi||HourLo||HourHi||MinuteLo||MinuteHi||SecondLo||SecondHi||Baud||'02'x||'00'x /* 14 */ PHead2 = OnetnumberLo||OnetnumberHi||DnetnumberLo||DnetnumberHi||Prod||Serial||Pass||OzonenumberLo||OzonenumberHi||DzonenumberLo||DzonenumberHi /* 20 */ phead2=phead2||fill||dpointnumberlo||dpointnumberhi||fill2; MsgInfo = PMsgStart||OnodenumberLo||OnodenumberHi||DnodenumberLo||DnodenumberHi||OnetnumberLo||OnetnumberHi||DnetnumberLo||DnetnumberHi||Attrib||Cost||Today||toname||null||fromname||null||subject||null if pvtmail="1" then do; If Ozonenumber ~= Dzonenumber then MsgInfo = MsgInfo||INTL||MsgID||PID Else MsgInfo = MsgInfo||MsgID||PID If pointnumber ~= 0 then MsgInfo = MsgInfo||TOPT end; else do; msginfo=msginfo||msgid||pid end; msginfo=phead1||phead2||msginfo; return; showheader:; /* ============================================================================ inform the user the number of parameters is wrong ! ============================================================================ */ say ""version"" say "Copyright (c) 1995/96 by Ali Rene Schams-Pirzadeh, Germany." say "Ghostwriter for fido and compatible networks. Read the docs for more info !!!" return; informparm:; /* ============================================================================ inform the user the number of parameters is wrong ! ============================================================================ */ say "*** Fatal error occured ! ---> Wrong number of parameters !" signal rauserror; wrongparm:; /* ============================================================================ inform the user the number of parameters is wrong ! ============================================================================ */ say "*** Fatal error occured !" if length(areaname)>0 then say " area: '"areaname"'" if length(fromadr )>0 then say " fromadr: "fromadr if length(fromname)>0 then say "fromname: '"fromname"'" if pvtmail="1" then do; if length(toadr)>0 then say " toadr: "toadr end; if length(toname )>0 then say " toname: '"toname"'" if length(subject )>0 then say " subject: '"subject"'" if length(file )>0 then say " file: '"file"'" if length(inbound )>0 then say " inbound: '"inbound"'" if length(origin )>0 then say " origin: '"origin"'" signal rauserror; deletetmpfile:; /* ============================================================================ delete all temporary files ============================================================================ */ if exists(tmpfile1) then do; address command mydelete" "tmpfile1 if rc > 0 then do; say "*** Fatal error occured - could not delete "tmpfile1" !" call dolog("| "); call dolog("* ***Fatal error occured - could not delete "tmpfile1" !"); end; end; return;