home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 12
/
CD_ASCQ_12_0294.iso
/
vrac
/
netmail.zip
/
NETMAIL.PPS
< prev
next >
Wrap
Text File
|
1994-02-11
|
12KB
|
516 lines
;==========================================================================
; :
; Name : NetMail.PPE
; :
; Syntax : NetMail.PPE <Name of Addressee>
; : NOTE: The name of the addressee is optional. If it
; : is supplied then NetMail will use it.
; :
; Copyright : (c) 1994 Tranquility Base
; :
; Version : 1.3
; :
; Action : This program is designed to replace the (E) command in your
; : NetMail conference. It will prompt your user for the name of
; : the person to send to, the Netmail address to send it to, and
; : it will list the available options for sending and allow them
; : to chose one.
;==========================================================================
; CHANGES
;
; V1.00
;----------------
; Initial Release
;
; v1.1
;----------------
; Fixed bugs with handeling Organization names
;
; v1.2
;----------------
; Changed the NAME prompt to include the word NAME
;
; v1.3
;----------------
; Added Expert Mode. If the user is in expert mode, it will not
; display the help files
;
; Also changed the name of the URGENT and the WELCOME files. This was to
; allow PCB to properly search for Security and Grahpics mode flags in the
; File name. If you are using SEC level files make sure you either have
; a base file without a SEC level or that you have one file for EACH
; sec level you have set up on your BBS.
;
; NETMAIL.PPE will honor Security Leve, Graphics Mode and Current Language
; on all the files that it uses. BUT It's up to YOU to create these files.
; If you do create some nice language files for the files in NetMail and you
; would be willing to share them with others; send them to me and I will
; include them in the ZIP file.
;
;==========================================================================
;
; Initalize Variables
;
STRING ThisName, ThisAddress, InString, Organization, Accumulator, OutString
STRING WorkString, Subject, CrLf, Urgency, Valid, UseFullScreen
INTEGER Zone, Net, Node, Point, DefaultZone, DefaultNet, Counter
INTEGER ImmediateLevel, CrashLevel, HoldLevel, DirectLevel
INTEGER GotZone, GotNet, GotNode, GotPoint, GotOrg
DefaultZone=1
DefaultNet=3625
ZONE = 0
Net = 0
Node = 0
Point = 0
GotZone = 0
GotNet = 0
GotNode = 0
GotPoint= 0
GotOrg = 0
CrLf=Chr(13)+Chr(10)
Organization = ""
Urgency = "N"
Valid = "N"
UseFullScreen = "Y"
OutString = ""
;
; Get The USER Info
;
GETUSER
;
; Set Up The Screen
;
If (U_EXPERT=FALSE) THEN
CLS
EndIF
;
; Open the Config File
;
FOPEN 1,PPEPATH()+PPENAME()+".CFG",o_rd,s_dn
;
; Read in the config file options
;
FGet 1, DefaultZone
FGet 1, DefaultNet
FGet 1, ImmediateLevel
FGet 1, CrashLevel
FGet 1, HoldLevel
FGet 1, DirectLevel
;
; Now check to make sure we got them all
;
If (FERR(1)) Then
PRINTLN "Please inform the SYSOP that there is a problem with the CONFIG file."
FClose 1
Goto End
EndIf
FClose 1
;
; Send Out the Opening File
; This File can contain an explanation of what NetMail is, and how to
; run your Nodelist Scanner if you have one and they need to find an
; address.
;
If ((U_EXPERT=FALSE) && (Exist(PPEPath()+"Wlcm*.*"))) Then
DispFile PPEPath()+"Wlcm",SEC+GRAPH+LANG
EndIf
;
; Get any tokens passed
; We are assuming that anything passes to the program is the name of the
; person to send mail to. (Similar to the existing E command.)
;
While (TOKCOUNT()>0) DO
ThisName=ThisName+" "+GetToken()
EndWhile
ThisName=Trim(ThisName," ")
;
; Now prompt the user for the name, using the name provide if available
;
INPUTTEXT "Name (Enter)=ABORT ?",ThisName,@X0F,25
NEWLINE
;
; Check for an empty name and bail if found
;
If (Len(Trim(ThisName," "))<1) Then
Goto End
EndIf
;
; Now get the Subject of the Message
;
INPUTTEXT "Subject (ENTER)=Abort ?",Subject,@X0F,60
NewLine
If (LEN(Subject)<1) Then
Goto END
EndIf
: Address
;
; Now look to see if the SYSOP has created an ADDRESS prompt file.
; If so then display it. If not then Ask for the Address.
; NOTE: The ADDR* file should NOT end with a LF. The last line of
; the file IS the prompt for the Address. You need to make sure and leave
; at lease 32 spaces at the end of your prompt for them to enter the
; address in.
;
If ((U_EXPERT=FALSE) && (EXIST(PPEPATH()+"ADDR*.*"))) Then
DispFile PPEPath()+"ADDR",SEC+GRAPH+LANG
INPUTTEXT "",ThisAddress,@X0F,30
Else
INPUTTEXT "@X0FAddress to Send To (ENTER)=Abort ?",ThisAddress,@X0F,30
EndIF
NEWLINE
;
; Check for an empty address and bail if found
;
If (Len(Trim(ThisAddress," "))<1) Then
Goto END
EndIf
;
; Now Check for a VALID address.
; We are going to take the address apart just to make sure that all the
; parts are there.
;
ThisAddress=Trim(ThisAddress," ")
For Counter=1 to Len(ThisAddress)
WorkString=Mid(ThisAddress,Counter,1)
If (WorkString=":") Then
;
; If this is a COLON then the Accumulator holds the ZONE
;
Zone=S2I(Accumulator,10)
Accumulator=""
GotZone=1
ElseIf (WorkString="/") Then
;
; If this is a SLASH then the Accumulator holds the NET
;
Net=S2I(Accumulator,10)
Accumulator=""
GotNet=1
ElseIf (WorkString=".") Then
;
; If this is a PERIOD and we don't already HAVE a NODE
; then the Accumulator holds the NODE
;
If (GotNode=0) THEN
Node=S2I(Accumulator,10)
Accumulator=""
GotNode=1
Else
;
; If this is a PERIOD and we DO already have a NODE then
; the Accumulator holds the domain
;
Accumulator=Accumulator+WorkString
EndIf
ElseIf (WorkString="@") Then
;
; If this is an @ then the Accumulator holds a POINT
;
Point=S2I(Accumulator,10)
Accumulator=""
GotPoint=1
Else
;
; Anything else is just part of the address.
;
Accumulator=Accumulator+WorkString
EndIf
Next Counter
If (Len(Accumulator)>0) Then
;
; If we have somthing left in the accumulator then let's figure
; out what it is.
;
If (GotNode>0) Then
;
; If GotNode > 0 then it's not the Node number. Let's
; check to see if it's a PONT
;
If (GotPoint>0) Then
;
; If GotPoint > 0 then We've already got a Point
; so it HAS to be the Domain name
;
Organization=Trim(Accumulator," ")
GotOrg=1
Else
;
; If we DON'T have a Point number then let's assume
; that this is a POINT number.
;
Point=S2I(Accumulator,10)
GotPoint=1
EndIf
Else
;
; If we don't have a NODE number then what's left in the Accumulator
; MUST be the NODE number.
;
Node=S2I(Accumulator,10)
GotNode=1
EndIf
EndIf
;
; Now that we have it in pieces, let's check each piece
; First : Let's check the ZONE number. If GotZone=0 then set
; ZONE number to the Default ZONE.
If (GotZone=0) ZONE=DefaultZone
; Second: If Check the GotNet, if GotNet says that we DO NOT have
; a net then set the net to the default net.
If (GotNet=0) Net=DefaultNet
;
; Third : Check the Node Number
;
If (GotNode=0) Then
; If we don't have a NODE number then they obviously
; typed something in wrong. If this is the case then
; tell the user and allow them to change it.
PRINTLN "Your address is improperly formatted, please try again."
NewLine
Goto Address
EndIf
;
; Now that we have checked each part for viability, let's
; put it all back together.
;
ThisAddress=Trim(I2S(Zone,10)," ")
ThisAddress=ThisAddress+":"+Trim(I2S(Net,10)," ")
ThisAddress=ThisAddress+"/"+Trim(I2S(Node,10)," ")
;
; If we have a Point address then add it in.
;
If (GotPoint=1) Then
ThisAddress=ThisAddress+"."+Trim(I2S(Point,10)," ")
EndIf
;
; If we have a domain then add it in.
;
If (GotOrg=1) Then
ThisAddress=ThisAddress+"@"+Organization
EndIf
;
; Send Out The Urgency File
; This File can be tailored by security level. I recomend one file for each
; secuity level specified in the NETMAIL.CFG file.
;
If ((U_EXPERT=FALSE) && (Exist(PPEPath()+"Ugnt*.*"))) Then
DispFile PPEPath()+"Ugnt",SEC+GRAPH+LANG
Else
;
; If the program cannot find an Urgency file then use these
; defauly prompts. They arn't pretty...but they work.
;
; NOTE: These prompts are skipped if you have set up an urgency file.
;
PRINTLN "Urgency Level:"
;
; Does this user have access to the Immediate command?
;
If (U_Sec>=ImmediateLevel) THEN
PRINTLN " (I)mmediate"
EndIf
;
; Does this user have access to the Crash command?
;
If (U_Sec>= CrashLevel) THEN
PRINTLN " (C)rash"
EndIf
;
; Does this user have access to the Hold command?
;
If (U_Sec>= HoldLevel) THEN
PRINTLN " (H)old"
EndIf
;
; Does this user have access to the Direct command?
;
If (U_Sec>= DirectLevel) THEN
PRINTLN " (D)irect"
EndIf
;
; Everybody has access to the Normal Command since it dosen't do
; ANYTHING to the message. It's really only here for cosmetics.
;
PRINTLN " (N)ormal"
PRINT "Urgency Level (Enter)=Normal"
EndIf
;
; Now Build the Valid String
; The VALID string is used in the INPUTSTR command. It puts the first letter
; of each command that the user has access to into a string called Valid.
'
If (U_Sec>=ImmediateLevel) THEN
Valid=Valid+"I"
EndIf
If (U_Sec>= CrashLevel) THEN
Valid=Valid+"C"
EndIf
If (U_Sec>= HoldLevel) THEN
Valid=Valid+"H"
EndIf
If (U_Sec>= DirectLevel) THEN
Valid=Valid+"D"
EndIf
;
; This is the InputStr for the Urgency flag.
;
INPUTSTR "",Urgency,@X0F,1,Valid,LFAfter+Guide+UpCase
;
; Check for Full Screen Editor
; If this user has set the FullScreen flag then we don't need to worry
; about it. Otherwise, we need to see if the user want's to use the
; Full Screen user or not.
;
If (U_FSEP) Then
PROMPTSTR 498,UseFullScreen,1,"Y",LFAFTER+UPCASE+GUIDE
EndIf
;
; Now let's build the Output String
; Line 1: The E Command
OutString="E"+Chr(13)+Chr(10)
; Line 2: The name of the user to send the message to
OutString=OutString+ThisName+CrLf
; Line 3:The Subject of this message
OutString=OutString+Subject +CrLf
; Line 4:Answer the Return Request question
OutString=OutString+"N" +CrLf
;
; If the user is using the Full Screen Editor then don't worry
; about the FSE question. Otherwise, load the answer to the
; 'Use FSE' question into the Output String.
;
If (U_FSE=FALSE) THEN
If (U_FSEP=TRUE) THEN
If (UseFullScreen="Y") THEN
OutString=OutString+"Y"+CrLf
Else
OutString=OutString+"N"+CrLf
EndIf
EndIf
EndIf
; Now Stuff the Address into the message along with the ()'s
OutString=OutString+"("+ThisAddress+")"+CrLf
; Now Stuff the Urgency Flag into the message
If (Urgency="I" ) THEN
OutString=OutString+"(IMMEDIATE)"+CrLf
EndIf
If (Urgency="D") THEN
OutString=OutString+"(DIRECT)"+CrLf
EndIf
If (Urgency="H") THEN
OutString=OutString+"(HOLD)"+CrLf
EndIf
If (Urgency="C") THEN
OutString=OutString+"(CRASH)"+CrLf
EndIf
: END
;
; PLEASE don't remove this (Pretty Please!)
; It only shows breifly and it annoys no-one.
PrintLn " NetMailer -- v1.3 "
PrintLN "(c) 1994 Tranquility Base"
PrintLN " All Rights Reserved "
;
; Stuff The Keyboard if there is anything there.
;
If (Len(OutString)>0) THEN
KBDSTUFF OutString
EndIf
End