IF @stdaddr$(autofix$(i%,0),defzone%)=org$ AND INSTR(UPPER$(subj$),autofix$(i%,1))
log("#File control request from "+org$+" detected")
rsp$="This is a response to your recent file control request on this system."+CHR$(10)+CHR$(10)
IF INSTR(UPPER$(subj$),"-I") OR INSTR(UPPER$(subj$),"/I") OR INSTR(subj$,"/?") OR INSTR(subj$,"-?")
log("#Help information requested")
rsp$=rsp$+"Instructions for use: Send a message to AutoFile on this system, including your password on the subject line, "
rsp$=rsp$+"and either or both of the switches /? and /L. /? will produce this instructions page; and "
rsp$=rsp$+"/L will produce a list of the areas you are connected to, and a list of those you can connect to."+CHR$(10)+CHR$(10)
rsp$=rsp$+"The message body should contain a list of any areas you wish to connect to (optionally preceded by a plus sign), and any you wish to disconnect from "
rsp$=rsp$+"which MUST be preceded by a minus sign. For example, if you want to connect to SOFTDIST and disconnect from "
rsp$=rsp$+"SDSXBBS, your message body could contain ""+SOFTDIST -SDSXBBS""."+CHR$(10)+CHR$(10)
ELSE
rsp$=rsp$+"Put /? on the subject line of FileFix messages for instructions"+CHR$(10)+CHR$(10)
ENDIF
OPEN "I",#6,netmail$+".MSG"
SEEK #6,offs%
msg$=INPUT$(lmsg%,#6)
IF INSTR(msg$,CHR$(0))
msg$=LEFT$(msg$,INSTR(msg$,CHR$(0))-1)
ENDIF
CLOSE #6
DO WHILE msg$>""
' condition y$ to one parameter/one line if starts with ^A
IF INSTR(msg$," ")<INSTR(msg$,CHR$(10)) AND INSTR(msg$," ")>0 AND LEFT$(msg$)<>CHR$(1)
IF INSTR(x$,":")>0 AND INSTR(x$,".")>0 !will always have a / in it
RETURN x$
ENDIF
IF INSTR(x$,":")=0
x$=STR$(z%)+":"+x$
ENDIF
IF INSTR(x$,".")=0
x$=x$+".0"
ENDIF
log(">Expanded "+y$+" to "+x$)
RETURN x$
ENDFUNC
> FUNCTION addr2d$(x$)
x$=@stdaddr$(x$,0)
x$=MID$(x$,INSTR(x$,":")+1)
IF INSTR(x$,".0")
RETURN LEFT$(x$,INSTR(x$,".0")-1)
ENDIF
FOR i%=0 TO naddr%-1
IF INSTR(addr$(i%),LEFT$(x$,INSTR(x$,".")-1))
RETURN STR$(pvtnet%(i%))+MID$(x$,INSTR(x$,"."))
ENDIF
NEXT i%
RETURN ""
ENDFUNC
> FUNCTION accept(from$,pw$)
IF RIGHT$(pw$)=CHR$(13)
pw$=LEFT$(pw$,LEN(pw$)-1)
ENDIF
IF @in(aacc$,from$)=0
RETURN 1 !not connected
ELSE
RETURN @in(aacc$,from$+"!"+UPPER$(pw$)) !0 => bad password, -1 => OK
ENDIF
ENDFUNC
> FUNCTION send(node$,area$)
LOCAL n%
n%=@areanum(area$)
IF @in(atic$,node$)
RETURN 1
ELSE IF @in(afle$,node$)
RETURN 2
ELSE IF @in(anon$,node$)
RETURN 3
ELSE
RETURN 0
ENDIF
ENDFUNC
> FUNCTION pri(node$,area$)
LOCAL n%
n%=@areanum(area$)
IF @in(ahld$,node$)
RETURN -1
ELSE IF @in(acra$,node$)
RETURN 1
ELSE
RETURN 0
ENDIF
ENDFUNC
> FUNCTION in(lst$,number$)
LOCAL zo%,ne%,no%,po%,p$,x%,x$
x$=","
IF INSTR(lst$,CHR$(13))
x$=CHR$(13)
ENDIF
lst$=x$+UPPER$(lst$)
number$=UPPER$(number$)
zo%=-1
IF INSTR(number$,"!")
p$=UPPER$(MID$(number$,INSTR(number$,"!")+1))
number$=LEFT$(number$,INSTR(number$,"!")-1)
ENDIF
IF INSTR(number$,":")
zo%=VAL(number$)
number$=MID$(number$,INSTR(number$,":")+1)
ENDIF
IF INSTR(number$,".")
po%=VAL(MID$(number$,INSTR(number$,".")+1))
ENDIF
ne%=VAL(number$)
no%=VAL(MID$(number$,INSTR(number$,"/")+1))
IF p$>""
IF INSTR(lst$,x$+STR$(zo%)+":"+STR$(ne%)+"/"+STR$(no%)+"."+STR$(po%)+"!"+p$+x$)
RETURN -1
ELSE IF INSTR(lst$,x$+STR$(ne%)+"/"+STR$(no%)+"."+STR$(po%)+"!"+p$+x$)
RETURN -1
ELSE IF INSTR(lst$,x$+STR$(zo%)+":"+STR$(ne%)+"/"+STR$(no%)+"!"+p$+x$) AND po%=0
RETURN -1
ELSE IF INSTR(lst$,x$+STR$(ne%)+"/"+STR$(no%)+"!"+p$+x$) AND po%=0
RETURN -1
ENDIF
ELSE IF INSTR(lst$,x$+STR$(zo%)+":"+STR$(ne%)+"/"+STR$(no%)+"."+STR$(po%)+x$) OR INSTR(lst$,","+STR$(zo%)+":"+STR$(ne%)+"/"+STR$(no%)+"."+STR$(po%)+"!")
RETURN -1
ELSE IF INSTR(lst$,x$+STR$(ne%)+"/"+STR$(no%)+"."+STR$(po%)+x$) OR INSTR(lst$,","+STR$(ne%)+"/"+STR$(no%)+"."+STR$(po%)+"!")
RETURN -1
ELSE IF INSTR(lst$,x$+STR$(zo%)+":"+STR$(ne%)+"/"+STR$(no%)+x$) AND po%=0 OR INSTR(lst$,","+STR$(zo%)+":"+STR$(ne%)+"/"+STR$(no%)+"!") AND po%=0
RETURN -1
ELSE IF INSTR(lst$,x$+STR$(ne%)+"/"+STR$(no%)+x$) AND po%=0 OR INSTR(lst$,","+STR$(ne%)+"/"+STR$(no%)+"!") AND po%=0