Home » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199508.adf » !Internet » StarterPak/!Newsbase/Transports/ka9q/sendmail

StarterPak/!Newsbase/Transports/ka9q/sendmail

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199508.adf » !Internet
Filename: StarterPak/!Newsbase/Transports/ka9q/sendmail
Read OK:
File size: 1EA0 bytes
Load address: 0000
Exec address: 0000
File contents
   10REM >SendMail
   20REM takes a mail message file and copies to outgoing directory
   30
   40ONERROR REPORT:PRINT" at line ";ERL:END
   50SYS"OS_GetEnv" TO A$
   60ver$="0.52"
   70N$="":nolocal%=FALSE:test%=FALSE
   80REPEAT
   90p$=FNgetpar(A$," ")
  100CASEp$OF
  110WHEN"-f":N$=FNgetpar(A$," ")
  120WHEN"-nolocal":nolocal%=TRUE
  130WHEN"-test":test%=TRUE
  140ENDCASE
  150UNTILA$=""
  160IFN$=""THENPROCexit(1,"No file parameter")
  170
  180PROCcheckdirs
  190DIMtmp%300,nbuf%4096
  200REM no fixed upper limit, let memory be the factor...
  210tomax%=(HIMEM-END-1000)DIV40
  220DIMto$(tomax%)
  230
  240gate$=FNvarval("NewsBase$RemoteHost"):IFLENgate$<5THENgate$=""
  250local$=FNvarval("NewsBase$Local")
  260IFnolocal%THENlocal$=""
  270localhost$=FNlower(FNvarval("NewsBase$HostName"))
  280
  290REM now extract to/from info...
  300from$="":to$="":bcc$="":count%=0:into%=FALSE:sender$="":errors$=""
  310C1%=FNopenin(N$):IFC1%=0 PROCexit(1,"Couldn't open file")
  320REPEAT
  330  A$=FNsget(C1%)
  340  IFLEFT$(A$,6)="From: " THENtemp$=MID$(A$,7):from$=FNgetaddress(temp$)
  350  IFLEFT$(A$,8)="Sender: "THENtemp$=MID$(A$,9):sender$=FNgetaddress(temp$)
  360  IFLEFT$(A$,12)="Errors-To: "THENtemp$=MID$(A$,9):errors$=FNgetaddress(temp$)
  370  IFLEFT$(A$,5)="Bcc: " THENbcc$=MID$(A$,7):REM note if Bcc: exists
  380  REM fake continuation lines by faking extra "To:" lines...
  390  IFLEFT$(A$,1)<>" "THENinto%=FALSE
  400  IFLEFT$(A$,1)=" "ANDinto%<>0THENA$="To:"+A$
  410  IFLEFT$(A$,4)="To: "ORLEFT$(A$,4)="Cc: "ORLEFT$(A$,5)="Bcc: " THEN
  420    l%=INSTR(A$," "):to$=MID$(A$,l%+1):into%=TRUE:REPEAT
  430    temp$=FNgetaddress(to$)
  440    IFtemp$>""ANDcount%<tomax%THENto$(count%)=temp$:count%+=1
  450    UNTILto$=""ORcount%=tomax%
  460  ENDIF
  470UNTILA$=""OREOF#C1%
  480PROCcf(C1%)
  490
  500REM override envelope return path with errors-to or sender header if present...
  510IFerrors$>""THENfrom$=errors$
  520IFsender$>""THENfrom$=sender$
  530
  540REM now take care of some error conditions...
  550IFto$(0)=""THENPROCexit(1,"No recipients found")
  560IFfrom$=""THENPROCexit(1,"Couldn't decode sender")
  570
  580IFbcc$>""THENN$=FNremovebcc(N$)
  590
  600IFtest%THEN
  610  PRINT"ka9q sendmail "+ver$+" test output: "+N$
  620  PRINT"Maximum recipients = ";tomax%
  630  PRINT"From: "+from$
  640  PRINT"To: "+to$(0)
  650  FORl%=1TOtomax%:IFto$(l%)>""THENPRINT"    "+to$(l%)
  660  NEXT
  670  PROCexit(0,"test run")
  680ENDIF
  690
  700REM now first handle any local mail, saving to <NewsBase$Local>
  710IFlocal$>""THEN
  720FORl%=0TOcount%-1
  730  to$=to$(l%):tosite$=""
  740  IFto$>""THEN
  750    at%=INSTR(to$,"@")
  760    IFat%>0THENtosite$=FNlower(MID$(to$,at%+1)):to$=LEFT$(to$,at%-1)
  770    IFtosite$=""ORtosite$=localhost$THEN
  780      IFFNlocalsave(N$,to$)<>0THENto$(l%)=""
  790    ENDIF
  800  ENDIF
  810NEXTl%
  820ENDIF
  830
  840REM now make mqueue.work file...
  850REM three choices...
  860REM 1) multiple recipients, smtp gateway defined; send as one file via gateway
  870REM 2) single recipient, send direct
  880REM 3) multiple recipients, no gateway; send separately directly.
  890
  900IFto$(1)>""ANDgate$>""THEN
  910  seq%=FNseq
  920  to$=to$(0)
  930  test%=INSTR(from$," "):IFtest%>1 from$=LEFT$(from$,test%)
  940  o$="<Mail$dir>.spool.mqueue.work."+STR$seq%
  950  C%=FNopenout(o$)
  960    IFC%=0 PROCexit(1,"Couldn't open output work file")
  970    BPUT#C%,gate$
  980    BPUT#C%,from$
  990    FORl%=0TOcount%-1
 1000      IFto$(l%)>""THENBPUT#C%,to$(l%)
 1010    NEXT
 1020  PROCcf(C%):PROCsettype(o$,&FFF)
 1030  o$="<Mail$dir>.spool.mqueue.text."+STR$seq%
 1040  F%=FNmovefile(N$,o$):PROCsettype(o$,&FFF)
 1050  IFF% PROCexit(1,"Couldn't move to spool area")
 1060  ELSE
 1070  FORl%=0TOcount%-1
 1080    seq%=FNseq
 1090    to$=to$(l%)
 1100    IFto$>""THEN
 1110      at%=INSTR(to$,"@",1)+1
 1120      tosite$=MID$(to$,at%):IFat%<1ORtosite$=""THENtosite$=gate$
 1130      IFtosite$=""PROCexit(1,"Couldn't send; no destination or gateway")
 1140      test%=INSTR(from$," "):IFtest%>1 from$=LEFT$(from$,test%)
 1150      o$="<Mail$dir>.spool.mqueue.work."+STR$seq%
 1160      C%=FNopenout(o$)
 1170        IFC%=0 PROCexit(1,"Couldn't open output work file")
 1180        BPUT#C%,tosite$
 1190        BPUT#C%,from$
 1200        BPUT#C%,to$
 1210        PROCcf(C%):PROCsettype(o$,&FFF)
 1220      o$="<Mail$dir>.spool.mqueue.text."+STR$seq%
 1230      F%=FNcopyfile(N$,o$):PROCsettype(o$,&FFF)
 1240      IFF% PROCexit(1,"Couldn't move to spool area")
 1250    ENDIF
 1260  NEXT
 1270  F%=FNdelfile(N$)
 1280ENDIF
 1290
 1300REM finished, so remove source file
 1310OSCLI"remove "+N$
 1320PROCexit(0,"Mail sent")
 1330END
 1340
 1350DEFFNmovefile(s$,d$)
 1360LOCALF%:SYS"XOS_FSControl",25,s$,d$TO;F%
 1370IF(F%AND1) SYS"XOS_FSControl",26,s$,d$,(1<<7) TO;F%
 1380=(F%AND1)
 1390
 1400DEFFNcopyfile(s$,d$)
 1410SYS"XOS_FSControl",26,s$,d$ TO;F%
 1420=(F%AND1)
 1430
 1440DEFFNdelfile(f$)
 1450LOCALF%:SYS"XOS_File",6,f$TO;F%
 1460=(F%AND1)
 1470
 1480DEFPROCexit(n%,a$)
 1490OSCLI("set NewsBase$ReturnCode "+STR$n%)
 1500OSCLI("set NewsBase$ReturnInfo "+a$)
 1510END
 1520ENDPROC
 1530
 1540DEFPROCcheckdirs
 1550IFFNobjtype("<Mail$dir>")<2 PROCexit(1,"!MailDir not found")
 1560PROCensuredir("<Mail$dir>.spool")
 1570PROCensuredir("<Mail$dir>.spool.mqueue")
 1580PROCensuredir("<Mail$dir>.spool.mqueue.text")
 1590PROCensuredir("<Mail$dir>.spool.mqueue.work")
 1600IFFNobjtype("<Mail$dir>.spool.mqueue.text")<2 ORFNobjtype("<Mail$dir>.spool.mqueue.work")<2 THENPROCexit(1,"SMTP spool directories not created")
 1610ENDPROC
 1620
 1630DEFPROCensuredir(f$)
 1640LOCALt%
 1650t%=FNobjtype(f$)
 1660IFt%<2ORt%>3THENSYS"XOS_File",8,f$
 1670ENDPROC
 1680
 1690DEFFNsget(h%)
 1700REM return line from file without error if too long...
 1710LOCALa$,C%
 1720WHILEC%<>10:C%=BGET#h%:IFLENa$<253ANDC%<>10ANDC%<>13:a$+=CHR$C%
 1730ENDWHILE
 1740=a$
 1750
 1760DEFFNobjtype(f$)
 1770LOCALF%
 1780SYS"XOS_File",17,f$TOt%;F%
 1790IF(F%AND1)THEN=-1:ELSE=t%
 1800
 1810DEFPROCsettype(f$,t%)
 1820SYS"XOS_File",18,f$,t%
 1830ENDPROC
 1840
 1850DEFPROCcf(RETURN h%)
 1860IFh%<>0 SYS"XOS_Find",0,h%:h%=0
 1870ENDPROC
 1880
 1890DEFFNvarval(A$)
 1900LOCALL%,F%
 1910SYS"XOS_ReadVarVal",A$,tmp%,256,0,3 TO,,L%;F%
 1920IF(F%AND1) ORL%>256 THEN:=""
 1930tmp%?L%=13:=$tmp%
 1940
 1950DEFFNlower(A$)
 1960LOCALB$,l%,c%,a%,z%,d%
 1970a%=ASC"A":z%=ASC"Z":d%=ASC"a"-a%
 1980IFLENA$>0THEN
 1990FORl%=1TOLENA$
 2000  c%=ASCMID$(A$,l%,1)
 2010  IFc%>=a%ANDc%<=z%THENc%+=d%
 2020  B$+=CHR$c%
 2030NEXT
 2040ENDIF
 2050=B$
 2060
 2070DEFFNgetaddress(RETURN A$)
 2080LOCALB$,C$,at%,end%:B$="":at%=0:end%=0
 2090l%=0:WHILEl%<LENA$ANDend%=0
 2100  l%+=1:C$=MID$(A$,l%,1)
 2110  CASEC$OF
 2120    WHEN",":IFB$>""THENend%=1
 2130    WHEN"(":REPEATl%+=1:C$=MID$(A$,l%,1)
 2140      IFC$="\"THENl%+=1
 2150      UNTILC$=")"ORl%>LENA$
 2160    WHEN"\":l%+=1
 2170    WHEN"<":
 2180      B$="":REPEATl%+=1:C$=MID$(A$,l%,1)
 2190      IFC$="\"THENl%+=1:ELSEIFC$<>">"B$+=C$
 2200      UNTILC$=">"ORl%>LENA$
 2210    WHEN"@":
 2220      IFat%>0THENMID$(B$,at%,1)="%"
 2230      B$+=C$:at%=LENB$
 2240    WHEN" ",CHR$9:REM skip
 2250    WHEN"""":B$+=C$:REPEATl%+=1:C$=MID$(A$,l%,1)
 2260      IFC$="\"THENl%+=1:ELSEIFC$<>""""B$+=C$
 2270      UNTILC$=""""ORl%>LENA$:IFC$=""""THENB$+=C$
 2280    OTHERWISE:B$+=C$
 2290  ENDCASE
 2300ENDWHILE
 2310A$=MID$(A$,l%+1)
 2320=B$
 2330
 2340DEFFNseq
 2350REM read in sequence numer, and update
 2360LOCALseq%,C%
 2370seq$="<Mail$dir>.spool.mqueue.sequence"
 2380IFFNobjtype(seq$)=0 THEN
 2390  seq%=1
 2400  WHILEFNobjtype("<Mail$dir>.spool.mqueue.text."+STR$seq%)>0:seq%+=1:ENDWHILE
 2410  ELSE
 2420  C%=FNopenin(seq$):IFC%=0 PROCexit(1,"Can't open sequence file")
 2430  seq%=VAL(GET$#C%):PROCcf(C%):seq%+=1
 2440ENDIF
 2450C%=FNopenout(seq$):BPUT#C%,STR$seq%:PROCcf(C%)
 2460=seq%
 2470
 2480DEFFNremovebcc(d$)
 2490LOCALf$,a$,r3%:f$=FNtmpfile
 2500f1%=FNopenin(d$)
 2510IFf1%>0THEN
 2520  f2%=FNopenout(f$)
 2530  IFf2%>0THEN
 2540    inbcc%=FALSE
 2550    REPEATA$=FNsget(f1%)
 2560      IFLEFT$(A$,1)<>" "THENinbcc%=FALSE
 2570      IFLEFT$(A$,4)="Bcc:"THENinbcc%=TRUE
 2580      IFinbcc%=FALSE THENBPUT#f2%,A$
 2590    UNTILA$=""OREOF#f1%
 2600    IFNOTEOF#f1%THEN
 2610      r3%=0
 2620      WHILEr3%=0:SYS"XOS_GBPB",4,f1%,nbuf%,4096TO,,,r3%
 2630        IFr3%<4096THENSYS"XOS_GBPB",2,f2%,nbuf%,4096-r3%
 2640      ENDWHILE
 2650    ENDIF
 2660    PROCcf(f2%):PROCsettype(f$,&FFF)
 2670    ELSE
 2680    PROCexit(1,"Couldn't open temp file for mailing")
 2690  ENDIF
 2700  PROCcf(f1%):F%=FNdelfile(d$)
 2710ENDIF
 2720=f$
 2730
 2740DEFFNlocalsave(f$,to$)
 2750LOCALo$,r3%,ok%
 2760ok%=0:o$=local$+"."+to$
 2770f1%=FNopenin(f$)
 2780IFf1%>0THEN
 2790  f2%=FNopenup(o$)
 2800  IFf2%>0THEN
 2810    PTR#f2%=EXT#f2%
 2820    BPUT#f2%,"From "+TIME$
 2830    IFNOTEOF#f1%THEN
 2840      r3%=0
 2850      WHILEr3%=0:SYS"XOS_GBPB",4,f1%,nbuf%,4096TO,,,r3%
 2860        IFr3%<4096THENSYS"XOS_GBPB",2,f2%,nbuf%,4096-r3%
 2870      ENDWHILE
 2880    ENDIF
 2890    BPUT#f2%,""
 2900    PROCcf(f2%):PROCsettype(o$,&FFF):ok%=TRUE
 2910  ENDIF
 2920  PROCcf(f1%)
 2930ENDIF
 2940=ok%
 2950
 2960DEFFNopenin(f$)
 2970LOCALh%,F%
 2980SYS"XOS_Find",&4F,f$ TOh%;F%:IF(F%AND1)<>0THENh%=0
 2990=h%
 3000
 3010DEFFNopenup(f$)
 3020LOCALh%,F%
 3030SYS"XOS_Find",&CF,f$TOh%;F%
 3040IF(F%AND1)THENSYS"XOS_Find",&8F,f$TOh%;F%:IF(F%AND1)<>0THENh%=0
 3050=h%
 3060
 3070DEFFNopenout(f$)
 3080LOCALh%,F%
 3090SYS"XOS_Find",&8F,f$TOh%;F%:IF(F%AND1)<>0THENh%=0
 3100=h%
 3110
 3120DEFFNgetpar(RETURN A$,s$)
 3130LOCALB$,l%
 3140l%=INSTR(A$,s$)
 3150IFl%>0THEN
 3160  B$=LEFT$(A$,l%-1):A$=MID$(A$,l%+1)
 3170  ELSE
 3180  B$=A$:A$=""
 3190ENDIF
 3200=B$
 3210
 3220DEFFNtmpfile
 3230LOCALf$
 3240REPEATf$="<NewsBase$Data>.scratch.tmp"+STR$(RND(10000))
 3250UNTILFNobjtype(f$)=0
 3260=f$

� >SendMail
@� takes a mail message file and copies to outgoing directory

(� �:�" at line ";�:�
2ș"OS_GetEnv" � A$
<ver$="0.52"
FN$="":nolocal%=�:test%=�
P�
Zp$=�getpar(A$," ")
d	Ȏp$�
n�"-f":N$=�getpar(A$," ")
x�"-nolocal":nolocal%=�
��"-test":test%=�
��
�
�A$=""
�'�N$=""��exit(1,"No file parameter")
�
��checkdirs
��tmp%300,nbuf%4096
�7� no fixed upper limit, let memory be the factor...
�tomax%=(�-�-1000)�40
��to$(tomax%)
�
�;gate$=�varval("NewsBase$RemoteHost"):�gate$<5�gate$=""
�$local$=�varval("NewsBase$Local")
�nolocal%�local$=""
3localhost$=�lower(�varval("NewsBase$HostName"))

"!� now extract to/from info...
,Bfrom$="":to$="":bcc$="":count%=0:into%=�:sender$="":errors$=""
68C1%=�openin(N$):�C1%=0 �exit(1,"Couldn't open file")
@�
J  A$=�sget(C1%)
T=  �A$,6)="From: " �temp$=�A$,7):from$=�getaddress(temp$)
^@  �A$,8)="Sender: "�temp$=�A$,9):sender$=�getaddress(temp$)
hD  �A$,12)="Errors-To: "�temp$=�A$,9):errors$=�getaddress(temp$)
r8  �A$,5)="Bcc: " �bcc$=�A$,7):� note if Bcc: exists
|>  � fake continuation lines by faking extra "To:" lines...
�  �A$,1)<>" "�into%=�
�&  �A$,1)=" "�into%<>0�A$="To:"+A$
�3  �A$,4)="To: "��A$,4)="Cc: "��A$,5)="Bcc: " �
�+    l%=�A$," "):to$=�A$,l%+1):into%=�:�
�    temp$=�getaddress(to$)
�;    �temp$>""�count%<tomax%�to$(count%)=temp$:count%+=1
�    �to$=""�count%=tomax%
�  �
��A$=""��#C1%
��cf(C1%)
�
�Q� override envelope return path with errors-to or sender header if present...
��errors$>""�from$=errors$
�sender$>""�from$=sender$

/� now take care of some error conditions...
&-�to$(0)=""��exit(1,"No recipients found")
0/�from$=""��exit(1,"Couldn't decode sender")
:
D�bcc$>""�N$=�removebcc(N$)
N
X�test%�
b0  �"ka9q sendmail "+ver$+" test output: "+N$
l%  �"Maximum recipients = ";tomax%
v  �"From: "+from$
�  �"To: "+to$(0)
�.  �l%=1�tomax%:�to$(l%)>""��"    "+to$(l%)
�  �
�  �exit(0,"test run")
��
�
�A� now first handle any local mail, saving to <NewsBase$Local>
��local$>""�
��l%=0�count%-1
�  to$=to$(l%):tosite$=""
�  �to$>""�
�    at%=�to$,"@")
�:    �at%>0�tosite$=�lower(�to$,at%+1)):to$=�to$,at%-1)
'    �tosite$=""�tosite$=localhost$�
+      �localsave(N$,to$)<>0�to$(l%)=""
	    �
   �
*�l%
4�
>
H"� now make mqueue.work file...
R� three choices...
\P� 1) multiple recipients, smtp gateway defined; send as one file via gateway
f&� 2) single recipient, send direct
pC� 3) multiple recipients, no gateway; send separately directly.
z
��to$(1)>""�gate$>""�
�  seq%=�seq
�  to$=to$(0)
�4  test%=�from$," "):�test%>1 from$=�from$,test%)
�.  o$="<Mail$dir>.spool.mqueue.work."+�seq%
�  C%=�openout(o$)
�7    �C%=0 �exit(1,"Couldn't open output work file")
�    �#C%,gate$
�    �#C%,from$
�    �l%=0�count%-1
�"      �to$(l%)>""��#C%,to$(l%)
�	    �
�  �cf(C%):�settype(o$,&FFF)
.  o$="<Mail$dir>.spool.mqueue.text."+�seq%
+  F%=�movefile(N$,o$):�settype(o$,&FFF)
0  �F% �exit(1,"Couldn't move to spool area")
$  �
.  �l%=0�count%-1
8    seq%=�seq
B    to$=to$(l%)
L    �to$>""�
V      at%=�to$,"@",1)+1
`;      tosite$=�to$,at%):�at%<1�tosite$=""�tosite$=gate$
jH      �tosite$=""�exit(1,"Couldn't send; no destination or gateway")
t8      test%=�from$," "):�test%>1 from$=�from$,test%)
~2      o$="<Mail$dir>.spool.mqueue.work."+�seq%
�      C%=�openout(o$)
�;        �C%=0 �exit(1,"Couldn't open output work file")
�        �#C%,tosite$
�        �#C%,from$
�        �#C%,to$
�%        �cf(C%):�settype(o$,&FFF)
�2      o$="<Mail$dir>.spool.mqueue.text."+�seq%
�/      F%=�copyfile(N$,o$):�settype(o$,&FFF)
�4      �F% �exit(1,"Couldn't move to spool area")
�	    �
�  �
�  F%=�delfile(N$)
�


%� finished, so remove source file
�"remove "+N$
(�exit(0,"Mail sent")
2�
<
Fݤmovefile(s$,d$)
P&�F%:ș"XOS_FSControl",25,s$,d$�;F%
Z2�(F%�1) ș"XOS_FSControl",26,s$,d$,(1<<7) �;F%
d=(F%�1)
n
xݤcopyfile(s$,d$)
�#ș"XOS_FSControl",26,s$,d$ �;F%
�=(F%�1)
�
�ݤdelfile(f$)
��F%:ș"XOS_File",6,f$�;F%
�=(F%�1)
�
���exit(n%,a$)
�%�("set NewsBase$ReturnCode "+�n%)
�$�("set NewsBase$ReturnInfo "+a$)
��
��
�
��checkdirs
;�objtype("<Mail$dir>")<2 �exit(1,"!MailDir not found")
"�ensuredir("<Mail$dir>.spool")
")�ensuredir("<Mail$dir>.spool.mqueue")
,.�ensuredir("<Mail$dir>.spool.mqueue.text")
6.�ensuredir("<Mail$dir>.spool.mqueue.work")
@��objtype("<Mail$dir>.spool.mqueue.text")<2 ��objtype("<Mail$dir>.spool.mqueue.work")<2 ��exit(1,"SMTP spool directories not created")
J�
T
^��ensuredir(f$)
h�t%
rt%=�objtype(f$)
| �t%<2�t%>3�ș"XOS_File",8,f$
��
�
�ݤsget(h%)
�8� return line from file without error if too long...
�
�a$,C%
�3ȕC%<>10:C%=�#h%:�a$<253�C%<>10�C%<>13:a$+=�C%
��
�=a$
�
�ݤobjtype(f$)
��F%
�ș"XOS_File",17,f$�t%;F%
��(F%�1)�=-1:�=t%

��settype(f$,t%)
ș"XOS_File",18,f$,t%
&�
0
:��cf(� h%)
D!�h%<>0 ș"XOS_Find",0,h%:h%=0
N�
X
bݤvarval(A$)
l
�L%,F%
v/ș"XOS_ReadVarVal",A$,tmp%,256,0,3 �,,L%;F%
��(F%�1) �L%>256 �:=""
�tmp%?L%=13:=$tmp%
�
�ݤlower(A$)
��B$,l%,c%,a%,z%,d%
�a%=�"A":z%=�"Z":d%=�"a"-a%
��A$>0�
�
�l%=1��A$
�  c%=��A$,l%,1)
�  �c%>=a%�c%<=z%�c%+=d%
�
  B$+=�c%
��
��
=B$

ݤgetaddress(� A$)
 &�B$,C$,at%,end%:B$="":at%=0:end%=0
*l%=0:ȕl%<�A$�end%=0
4  l%+=1:C$=�A$,l%,1)
>  ȎC$�
H    �",":�B$>""�end%=1
R     �"(":�l%+=1:C$=�A$,l%,1)
\      �C$="\"�l%+=1
f      �C$=")"�l%>�A$
p    �"\":l%+=1
z
    �"<":
�#      B$="":�l%+=1:C$=�A$,l%,1)
�'      �C$="\"�l%+=1:��C$<>">"B$+=C$
�      �C$=">"�l%>�A$
�
    �"@":
�      �at%>0��B$,at%,1)="%"
�      B$+=C$:at%=�B$
�    �" ",�9:� skip
�(    �"""":B$+=C$:�l%+=1:C$=�A$,l%,1)
�(      �C$="\"�l%+=1:��C$<>""""B$+=C$
�)      �C$=""""�l%>�A$:�C$=""""�B$+=C$
�    :B$+=C$
�  �
��
	A$=�A$,l%+1)
	=B$
	
	$	ݤseq
	.(� read in sequence numer, and update
	8�seq%,C%
	B+seq$="<Mail$dir>.spool.mqueue.sequence"
	L�objtype(seq$)=0 �
	V  seq%=1
	`C  ȕ�objtype("<Mail$dir>.spool.mqueue.text."+�seq%)>0:seq%+=1:�
	j  �
	t@  C%=�openin(seq$):�C%=0 �exit(1,"Can't open sequence file")
	~"  seq%=�(�#C%):�cf(C%):seq%+=1
	��
	�(C%=�openout(seq$):�#C%,�seq%:�cf(C%)
	�	=seq%
	�
	�ݤremovebcc(d$)
	��f$,a$,r3%:f$=�tmpfile
	�f1%=�openin(d$)
	��f1%>0�
	�  f2%=�openout(f$)
	�
  �f2%>0�
	�    inbcc%=�
	�    �A$=�sget(f1%)
      �A$,1)<>" "�inbcc%=�

!      �A$,4)="Bcc:"�inbcc%=�
      �inbcc%=� ��#f2%,A$
    �A$=""��#f1%
(    ��#f1%�
2      r3%=0
<6      ȕr3%=0:ș"XOS_GBPB",4,f1%,nbuf%,4096�,,,r3%
F7        �r3%<4096�ș"XOS_GBPB",2,f2%,nbuf%,4096-r3%
P      �
Z	    �
d"    �cf(f2%):�settype(f$,&FFF)
n	    �
x6    �exit(1,"Couldn't open temp file for mailing")
�  �
�  �cf(f1%):F%=�delfile(d$)
��
�=f$
�
�ݤlocalsave(f$,to$)
��o$,r3%,ok%
�ok%=0:o$=local$+"."+to$
�f1%=�openin(f$)
��f1%>0�
�  f2%=�openup(o$)
�
  �f2%>0�
�    �#f2%=�#f2%
    �#f2%,"From "+�$
    ��#f1%�
      r3%=0
"6      ȕr3%=0:ș"XOS_GBPB",4,f1%,nbuf%,4096�,,,r3%
,7        �r3%<4096�ș"XOS_GBPB",2,f2%,nbuf%,4096-r3%
6      �
@	    �
J    �#f2%,""
T(    �cf(f2%):�settype(o$,&FFF):ok%=�
^  �
h  �cf(f1%)
r�
|=ok%
�
�ݤopenin(f$)
�
�h%,F%
�.ș"XOS_Find",&4F,f$ �h%;F%:�(F%�1)<>0�h%=0
�=h%
�
�ݤopenup(f$)
�
�h%,F%
�ș"XOS_Find",&CF,f$�h%;F%
�5�(F%�1)�ș"XOS_Find",&8F,f$�h%;F%:�(F%�1)<>0�h%=0
�=h%
�
�ݤopenout(f$)

�h%,F%
-ș"XOS_Find",&8F,f$�h%;F%:�(F%�1)<>0�h%=0
=h%
&
0ݤgetpar(� A$,s$)
:
�B$,l%
Dl%=�A$,s$)
N
�l%>0�
X  B$=�A$,l%-1):A$=�A$,l%+1)
b  �
l  B$=A$:A$=""
v�
�=B$
�
�
ݤtmpfile
��f$
�1�f$="<NewsBase$Data>.scratch.tmp"+�(�(10000))
���objtype(f$)=0
�=f$
�
00000000  0d 00 0a 0f f4 20 3e 53  65 6e 64 4d 61 69 6c 0d  |..... >SendMail.|
00000010  00 14 40 f4 20 74 61 6b  65 73 20 61 20 6d 61 69  |..@. takes a mai|
00000020  6c 20 6d 65 73 73 61 67  65 20 66 69 6c 65 20 61  |l message file a|
00000030  6e 64 20 63 6f 70 69 65  73 20 74 6f 20 6f 75 74  |nd copies to out|
00000040  67 6f 69 6e 67 20 64 69  72 65 63 74 6f 72 79 0d  |going directory.|
00000050  00 1e 04 0d 00 28 19 ee  85 20 f6 3a f1 22 20 61  |.....(... .:." a|
00000060  74 20 6c 69 6e 65 20 22  3b 9e 3a e0 0d 00 32 16  |t line ";.:...2.|
00000070  c8 99 22 4f 53 5f 47 65  74 45 6e 76 22 20 b8 20  |.."OS_GetEnv" . |
00000080  41 24 0d 00 3c 0f 76 65  72 24 3d 22 30 2e 35 32  |A$..<.ver$="0.52|
00000090  22 0d 00 46 1c 4e 24 3d  22 22 3a 6e 6f 6c 6f 63  |"..F.N$="":noloc|
000000a0  61 6c 25 3d a3 3a 74 65  73 74 25 3d a3 0d 00 50  |al%=.:test%=...P|
000000b0  05 f5 0d 00 5a 16 70 24  3d a4 67 65 74 70 61 72  |....Z.p$=.getpar|
000000c0  28 41 24 2c 22 20 22 29  0d 00 64 09 c8 8e 70 24  |(A$," ")..d...p$|
000000d0  ca 0d 00 6e 1c c9 22 2d  66 22 3a 4e 24 3d a4 67  |...n.."-f":N$=.g|
000000e0  65 74 70 61 72 28 41 24  2c 22 20 22 29 0d 00 78  |etpar(A$," ")..x|
000000f0  1a c9 22 2d 6e 6f 6c 6f  63 61 6c 22 3a 6e 6f 6c  |.."-nolocal":nol|
00000100  6f 63 61 6c 25 3d b9 0d  00 82 14 c9 22 2d 74 65  |ocal%=......"-te|
00000110  73 74 22 3a 74 65 73 74  25 3d b9 0d 00 8c 05 cb  |st":test%=......|
00000120  0d 00 96 0a fd 41 24 3d  22 22 0d 00 a0 27 e7 4e  |.....A$=""...'.N|
00000130  24 3d 22 22 8c f2 65 78  69 74 28 31 2c 22 4e 6f  |$=""..exit(1,"No|
00000140  20 66 69 6c 65 20 70 61  72 61 6d 65 74 65 72 22  | file parameter"|
00000150  29 0d 00 aa 04 0d 00 b4  0e f2 63 68 65 63 6b 64  |).........checkd|
00000160  69 72 73 0d 00 be 16 de  74 6d 70 25 33 30 30 2c  |irs.....tmp%300,|
00000170  6e 62 75 66 25 34 30 39  36 0d 00 c8 37 f4 20 6e  |nbuf%4096...7. n|
00000180  6f 20 66 69 78 65 64 20  75 70 70 65 72 20 6c 69  |o fixed upper li|
00000190  6d 69 74 2c 20 6c 65 74  20 6d 65 6d 6f 72 79 20  |mit, let memory |
000001a0  62 65 20 74 68 65 20 66  61 63 74 6f 72 2e 2e 2e  |be the factor...|
000001b0  0d 00 d2 18 74 6f 6d 61  78 25 3d 28 93 2d e0 2d  |....tomax%=(.-.-|
000001c0  31 30 30 30 29 81 34 30  0d 00 dc 10 de 74 6f 24  |1000).40.....to$|
000001d0  28 74 6f 6d 61 78 25 29  0d 00 e6 04 0d 00 f0 3b  |(tomax%).......;|
000001e0  67 61 74 65 24 3d a4 76  61 72 76 61 6c 28 22 4e  |gate$=.varval("N|
000001f0  65 77 73 42 61 73 65 24  52 65 6d 6f 74 65 48 6f  |ewsBase$RemoteHo|
00000200  73 74 22 29 3a e7 a9 67  61 74 65 24 3c 35 8c 67  |st"):..gate$<5.g|
00000210  61 74 65 24 3d 22 22 0d  00 fa 24 6c 6f 63 61 6c  |ate$=""...$local|
00000220  24 3d a4 76 61 72 76 61  6c 28 22 4e 65 77 73 42  |$=.varval("NewsB|
00000230  61 73 65 24 4c 6f 63 61  6c 22 29 0d 01 04 17 e7  |ase$Local").....|
00000240  6e 6f 6c 6f 63 61 6c 25  8c 6c 6f 63 61 6c 24 3d  |nolocal%.local$=|
00000250  22 22 0d 01 0e 33 6c 6f  63 61 6c 68 6f 73 74 24  |""...3localhost$|
00000260  3d a4 6c 6f 77 65 72 28  a4 76 61 72 76 61 6c 28  |=.lower(.varval(|
00000270  22 4e 65 77 73 42 61 73  65 24 48 6f 73 74 4e 61  |"NewsBase$HostNa|
00000280  6d 65 22 29 29 0d 01 18  04 0d 01 22 21 f4 20 6e  |me"))......"!. n|
00000290  6f 77 20 65 78 74 72 61  63 74 20 74 6f 2f 66 72  |ow extract to/fr|
000002a0  6f 6d 20 69 6e 66 6f 2e  2e 2e 0d 01 2c 42 66 72  |om info.....,Bfr|
000002b0  6f 6d 24 3d 22 22 3a 74  6f 24 3d 22 22 3a 62 63  |om$="":to$="":bc|
000002c0  63 24 3d 22 22 3a 63 6f  75 6e 74 25 3d 30 3a 69  |c$="":count%=0:i|
000002d0  6e 74 6f 25 3d a3 3a 73  65 6e 64 65 72 24 3d 22  |nto%=.:sender$="|
000002e0  22 3a 65 72 72 6f 72 73  24 3d 22 22 0d 01 36 38  |":errors$=""..68|
000002f0  43 31 25 3d a4 6f 70 65  6e 69 6e 28 4e 24 29 3a  |C1%=.openin(N$):|
00000300  e7 43 31 25 3d 30 20 f2  65 78 69 74 28 31 2c 22  |.C1%=0 .exit(1,"|
00000310  43 6f 75 6c 64 6e 27 74  20 6f 70 65 6e 20 66 69  |Couldn't open fi|
00000320  6c 65 22 29 0d 01 40 05  f5 0d 01 4a 13 20 20 41  |le")..@....J.  A|
00000330  24 3d a4 73 67 65 74 28  43 31 25 29 0d 01 54 3d  |$=.sget(C1%)..T=|
00000340  20 20 e7 c0 41 24 2c 36  29 3d 22 46 72 6f 6d 3a  |  ..A$,6)="From:|
00000350  20 22 20 8c 74 65 6d 70  24 3d c1 41 24 2c 37 29  | " .temp$=.A$,7)|
00000360  3a 66 72 6f 6d 24 3d a4  67 65 74 61 64 64 72 65  |:from$=.getaddre|
00000370  73 73 28 74 65 6d 70 24  29 0d 01 5e 40 20 20 e7  |ss(temp$)..^@  .|
00000380  c0 41 24 2c 38 29 3d 22  53 65 6e 64 65 72 3a 20  |.A$,8)="Sender: |
00000390  22 8c 74 65 6d 70 24 3d  c1 41 24 2c 39 29 3a 73  |".temp$=.A$,9):s|
000003a0  65 6e 64 65 72 24 3d a4  67 65 74 61 64 64 72 65  |ender$=.getaddre|
000003b0  73 73 28 74 65 6d 70 24  29 0d 01 68 44 20 20 e7  |ss(temp$)..hD  .|
000003c0  c0 41 24 2c 31 32 29 3d  22 45 72 72 6f 72 73 2d  |.A$,12)="Errors-|
000003d0  54 6f 3a 20 22 8c 74 65  6d 70 24 3d c1 41 24 2c  |To: ".temp$=.A$,|
000003e0  39 29 3a 65 72 72 6f 72  73 24 3d a4 67 65 74 61  |9):errors$=.geta|
000003f0  64 64 72 65 73 73 28 74  65 6d 70 24 29 0d 01 72  |ddress(temp$)..r|
00000400  38 20 20 e7 c0 41 24 2c  35 29 3d 22 42 63 63 3a  |8  ..A$,5)="Bcc:|
00000410  20 22 20 8c 62 63 63 24  3d c1 41 24 2c 37 29 3a  | " .bcc$=.A$,7):|
00000420  f4 20 6e 6f 74 65 20 69  66 20 42 63 63 3a 20 65  |. note if Bcc: e|
00000430  78 69 73 74 73 0d 01 7c  3e 20 20 f4 20 66 61 6b  |xists..|>  . fak|
00000440  65 20 63 6f 6e 74 69 6e  75 61 74 69 6f 6e 20 6c  |e continuation l|
00000450  69 6e 65 73 20 62 79 20  66 61 6b 69 6e 67 20 65  |ines by faking e|
00000460  78 74 72 61 20 22 54 6f  3a 22 20 6c 69 6e 65 73  |xtra "To:" lines|
00000470  2e 2e 2e 0d 01 86 1a 20  20 e7 c0 41 24 2c 31 29  |.......  ..A$,1)|
00000480  3c 3e 22 20 22 8c 69 6e  74 6f 25 3d a3 0d 01 90  |<>" ".into%=....|
00000490  26 20 20 e7 c0 41 24 2c  31 29 3d 22 20 22 80 69  |&  ..A$,1)=" ".i|
000004a0  6e 74 6f 25 3c 3e 30 8c  41 24 3d 22 54 6f 3a 22  |nto%<>0.A$="To:"|
000004b0  2b 41 24 0d 01 9a 33 20  20 e7 c0 41 24 2c 34 29  |+A$...3  ..A$,4)|
000004c0  3d 22 54 6f 3a 20 22 84  c0 41 24 2c 34 29 3d 22  |="To: "..A$,4)="|
000004d0  43 63 3a 20 22 84 c0 41  24 2c 35 29 3d 22 42 63  |Cc: "..A$,5)="Bc|
000004e0  63 3a 20 22 20 8c 0d 01  a4 2b 20 20 20 20 6c 25  |c: " ....+    l%|
000004f0  3d a7 41 24 2c 22 20 22  29 3a 74 6f 24 3d c1 41  |=.A$," "):to$=.A|
00000500  24 2c 6c 25 2b 31 29 3a  69 6e 74 6f 25 3d b9 3a  |$,l%+1):into%=.:|
00000510  f5 0d 01 ae 1e 20 20 20  20 74 65 6d 70 24 3d a4  |.....    temp$=.|
00000520  67 65 74 61 64 64 72 65  73 73 28 74 6f 24 29 0d  |getaddress(to$).|
00000530  01 b8 3b 20 20 20 20 e7  74 65 6d 70 24 3e 22 22  |..;    .temp$>""|
00000540  80 63 6f 75 6e 74 25 3c  74 6f 6d 61 78 25 8c 74  |.count%<tomax%.t|
00000550  6f 24 28 63 6f 75 6e 74  25 29 3d 74 65 6d 70 24  |o$(count%)=temp$|
00000560  3a 63 6f 75 6e 74 25 2b  3d 31 0d 01 c2 1d 20 20  |:count%+=1....  |
00000570  20 20 fd 74 6f 24 3d 22  22 84 63 6f 75 6e 74 25  |  .to$="".count%|
00000580  3d 74 6f 6d 61 78 25 0d  01 cc 07 20 20 cd 0d 01  |=tomax%....  ...|
00000590  d6 10 fd 41 24 3d 22 22  84 c5 23 43 31 25 0d 01  |...A$=""..#C1%..|
000005a0  e0 0c f2 63 66 28 43 31  25 29 0d 01 ea 04 0d 01  |...cf(C1%)......|
000005b0  f4 51 f4 20 6f 76 65 72  72 69 64 65 20 65 6e 76  |.Q. override env|
000005c0  65 6c 6f 70 65 20 72 65  74 75 72 6e 20 70 61 74  |elope return pat|
000005d0  68 20 77 69 74 68 20 65  72 72 6f 72 73 2d 74 6f  |h with errors-to|
000005e0  20 6f 72 20 73 65 6e 64  65 72 20 68 65 61 64 65  | or sender heade|
000005f0  72 20 69 66 20 70 72 65  73 65 6e 74 2e 2e 2e 0d  |r if present....|
00000600  01 fe 1d e7 65 72 72 6f  72 73 24 3e 22 22 8c 66  |....errors$>"".f|
00000610  72 6f 6d 24 3d 65 72 72  6f 72 73 24 0d 02 08 1d  |rom$=errors$....|
00000620  e7 73 65 6e 64 65 72 24  3e 22 22 8c 66 72 6f 6d  |.sender$>"".from|
00000630  24 3d 73 65 6e 64 65 72  24 0d 02 12 04 0d 02 1c  |$=sender$.......|
00000640  2f f4 20 6e 6f 77 20 74  61 6b 65 20 63 61 72 65  |/. now take care|
00000650  20 6f 66 20 73 6f 6d 65  20 65 72 72 6f 72 20 63  | of some error c|
00000660  6f 6e 64 69 74 69 6f 6e  73 2e 2e 2e 0d 02 26 2d  |onditions.....&-|
00000670  e7 74 6f 24 28 30 29 3d  22 22 8c f2 65 78 69 74  |.to$(0)=""..exit|
00000680  28 31 2c 22 4e 6f 20 72  65 63 69 70 69 65 6e 74  |(1,"No recipient|
00000690  73 20 66 6f 75 6e 64 22  29 0d 02 30 2f e7 66 72  |s found")..0/.fr|
000006a0  6f 6d 24 3d 22 22 8c f2  65 78 69 74 28 31 2c 22  |om$=""..exit(1,"|
000006b0  43 6f 75 6c 64 6e 27 74  20 64 65 63 6f 64 65 20  |Couldn't decode |
000006c0  73 65 6e 64 65 72 22 29  0d 02 3a 04 0d 02 44 1e  |sender")..:...D.|
000006d0  e7 62 63 63 24 3e 22 22  8c 4e 24 3d a4 72 65 6d  |.bcc$>"".N$=.rem|
000006e0  6f 76 65 62 63 63 28 4e  24 29 0d 02 4e 04 0d 02  |ovebcc(N$)..N...|
000006f0  58 0b e7 74 65 73 74 25  8c 0d 02 62 30 20 20 f1  |X..test%...b0  .|
00000700  22 6b 61 39 71 20 73 65  6e 64 6d 61 69 6c 20 22  |"ka9q sendmail "|
00000710  2b 76 65 72 24 2b 22 20  74 65 73 74 20 6f 75 74  |+ver$+" test out|
00000720  70 75 74 3a 20 22 2b 4e  24 0d 02 6c 25 20 20 f1  |put: "+N$..l%  .|
00000730  22 4d 61 78 69 6d 75 6d  20 72 65 63 69 70 69 65  |"Maximum recipie|
00000740  6e 74 73 20 3d 20 22 3b  74 6f 6d 61 78 25 0d 02  |nts = ";tomax%..|
00000750  76 15 20 20 f1 22 46 72  6f 6d 3a 20 22 2b 66 72  |v.  ."From: "+fr|
00000760  6f 6d 24 0d 02 80 14 20  20 f1 22 54 6f 3a 20 22  |om$....  ."To: "|
00000770  2b 74 6f 24 28 30 29 0d  02 8a 2e 20 20 e3 6c 25  |+to$(0)....  .l%|
00000780  3d 31 b8 74 6f 6d 61 78  25 3a e7 74 6f 24 28 6c  |=1.tomax%:.to$(l|
00000790  25 29 3e 22 22 8c f1 22  20 20 20 20 22 2b 74 6f  |%)>"".."    "+to|
000007a0  24 28 6c 25 29 0d 02 94  07 20 20 ed 0d 02 9e 19  |$(l%)....  .....|
000007b0  20 20 f2 65 78 69 74 28  30 2c 22 74 65 73 74 20  |  .exit(0,"test |
000007c0  72 75 6e 22 29 0d 02 a8  05 cd 0d 02 b2 04 0d 02  |run")...........|
000007d0  bc 41 f4 20 6e 6f 77 20  66 69 72 73 74 20 68 61  |.A. now first ha|
000007e0  6e 64 6c 65 20 61 6e 79  20 6c 6f 63 61 6c 20 6d  |ndle any local m|
000007f0  61 69 6c 2c 20 73 61 76  69 6e 67 20 74 6f 20 3c  |ail, saving to <|
00000800  4e 65 77 73 42 61 73 65  24 4c 6f 63 61 6c 3e 0d  |NewsBase$Local>.|
00000810  02 c6 0f e7 6c 6f 63 61  6c 24 3e 22 22 8c 0d 02  |....local$>""...|
00000820  d0 12 e3 6c 25 3d 30 b8  63 6f 75 6e 74 25 2d 31  |...l%=0.count%-1|
00000830  0d 02 da 1c 20 20 74 6f  24 3d 74 6f 24 28 6c 25  |....  to$=to$(l%|
00000840  29 3a 74 6f 73 69 74 65  24 3d 22 22 0d 02 e4 0e  |):tosite$=""....|
00000850  20 20 e7 74 6f 24 3e 22  22 8c 0d 02 ee 15 20 20  |  .to$>"".....  |
00000860  20 20 61 74 25 3d a7 74  6f 24 2c 22 40 22 29 0d  |  at%=.to$,"@").|
00000870  02 f8 3a 20 20 20 20 e7  61 74 25 3e 30 8c 74 6f  |..:    .at%>0.to|
00000880  73 69 74 65 24 3d a4 6c  6f 77 65 72 28 c1 74 6f  |site$=.lower(.to|
00000890  24 2c 61 74 25 2b 31 29  29 3a 74 6f 24 3d c0 74  |$,at%+1)):to$=.t|
000008a0  6f 24 2c 61 74 25 2d 31  29 0d 03 02 27 20 20 20  |o$,at%-1)...'   |
000008b0  20 e7 74 6f 73 69 74 65  24 3d 22 22 84 74 6f 73  | .tosite$="".tos|
000008c0  69 74 65 24 3d 6c 6f 63  61 6c 68 6f 73 74 24 8c  |ite$=localhost$.|
000008d0  0d 03 0c 2b 20 20 20 20  20 20 e7 a4 6c 6f 63 61  |...+      ..loca|
000008e0  6c 73 61 76 65 28 4e 24  2c 74 6f 24 29 3c 3e 30  |lsave(N$,to$)<>0|
000008f0  8c 74 6f 24 28 6c 25 29  3d 22 22 0d 03 16 09 20  |.to$(l%)="".... |
00000900  20 20 20 cd 0d 03 20 07  20 20 cd 0d 03 2a 07 ed  |   ... .  ...*..|
00000910  6c 25 0d 03 34 05 cd 0d  03 3e 04 0d 03 48 22 f4  |l%..4....>...H".|
00000920  20 6e 6f 77 20 6d 61 6b  65 20 6d 71 75 65 75 65  | now make mqueue|
00000930  2e 77 6f 72 6b 20 66 69  6c 65 2e 2e 2e 0d 03 52  |.work file.....R|
00000940  16 f4 20 74 68 72 65 65  20 63 68 6f 69 63 65 73  |.. three choices|
00000950  2e 2e 2e 0d 03 5c 50 f4  20 31 29 20 6d 75 6c 74  |.....\P. 1) mult|
00000960  69 70 6c 65 20 72 65 63  69 70 69 65 6e 74 73 2c  |iple recipients,|
00000970  20 73 6d 74 70 20 67 61  74 65 77 61 79 20 64 65  | smtp gateway de|
00000980  66 69 6e 65 64 3b 20 73  65 6e 64 20 61 73 20 6f  |fined; send as o|
00000990  6e 65 20 66 69 6c 65 20  76 69 61 20 67 61 74 65  |ne file via gate|
000009a0  77 61 79 0d 03 66 26 f4  20 32 29 20 73 69 6e 67  |way..f&. 2) sing|
000009b0  6c 65 20 72 65 63 69 70  69 65 6e 74 2c 20 73 65  |le recipient, se|
000009c0  6e 64 20 64 69 72 65 63  74 0d 03 70 43 f4 20 33  |nd direct..pC. 3|
000009d0  29 20 6d 75 6c 74 69 70  6c 65 20 72 65 63 69 70  |) multiple recip|
000009e0  69 65 6e 74 73 2c 20 6e  6f 20 67 61 74 65 77 61  |ients, no gatewa|
000009f0  79 3b 20 73 65 6e 64 20  73 65 70 61 72 61 74 65  |y; send separate|
00000a00  6c 79 20 64 69 72 65 63  74 6c 79 2e 0d 03 7a 04  |ly directly...z.|
00000a10  0d 03 84 18 e7 74 6f 24  28 31 29 3e 22 22 80 67  |.....to$(1)>"".g|
00000a20  61 74 65 24 3e 22 22 8c  0d 03 8e 0f 20 20 73 65  |ate$>"".....  se|
00000a30  71 25 3d a4 73 65 71 0d  03 98 10 20 20 74 6f 24  |q%=.seq....  to$|
00000a40  3d 74 6f 24 28 30 29 0d  03 a2 34 20 20 74 65 73  |=to$(0)...4  tes|
00000a50  74 25 3d a7 66 72 6f 6d  24 2c 22 20 22 29 3a e7  |t%=.from$," "):.|
00000a60  74 65 73 74 25 3e 31 20  66 72 6f 6d 24 3d c0 66  |test%>1 from$=.f|
00000a70  72 6f 6d 24 2c 74 65 73  74 25 29 0d 03 ac 2e 20  |rom$,test%).... |
00000a80  20 6f 24 3d 22 3c 4d 61  69 6c 24 64 69 72 3e 2e  | o$="<Mail$dir>.|
00000a90  73 70 6f 6f 6c 2e 6d 71  75 65 75 65 2e 77 6f 72  |spool.mqueue.wor|
00000aa0  6b 2e 22 2b c3 73 65 71  25 0d 03 b6 15 20 20 43  |k."+.seq%....  C|
00000ab0  25 3d a4 6f 70 65 6e 6f  75 74 28 6f 24 29 0d 03  |%=.openout(o$)..|
00000ac0  c0 37 20 20 20 20 e7 43  25 3d 30 20 f2 65 78 69  |.7    .C%=0 .exi|
00000ad0  74 28 31 2c 22 43 6f 75  6c 64 6e 27 74 20 6f 70  |t(1,"Couldn't op|
00000ae0  65 6e 20 6f 75 74 70 75  74 20 77 6f 72 6b 20 66  |en output work f|
00000af0  69 6c 65 22 29 0d 03 ca  12 20 20 20 20 d5 23 43  |ile")....    .#C|
00000b00  25 2c 67 61 74 65 24 0d  03 d4 12 20 20 20 20 d5  |%,gate$....    .|
00000b10  23 43 25 2c 66 72 6f 6d  24 0d 03 de 16 20 20 20  |#C%,from$....   |
00000b20  20 e3 6c 25 3d 30 b8 63  6f 75 6e 74 25 2d 31 0d  | .l%=0.count%-1.|
00000b30  03 e8 22 20 20 20 20 20  20 e7 74 6f 24 28 6c 25  |.."      .to$(l%|
00000b40  29 3e 22 22 8c d5 23 43  25 2c 74 6f 24 28 6c 25  |)>""..#C%,to$(l%|
00000b50  29 0d 03 f2 09 20 20 20  20 ed 0d 03 fc 1f 20 20  |)....    .....  |
00000b60  f2 63 66 28 43 25 29 3a  f2 73 65 74 74 79 70 65  |.cf(C%):.settype|
00000b70  28 6f 24 2c 26 46 46 46  29 0d 04 06 2e 20 20 6f  |(o$,&FFF)....  o|
00000b80  24 3d 22 3c 4d 61 69 6c  24 64 69 72 3e 2e 73 70  |$="<Mail$dir>.sp|
00000b90  6f 6f 6c 2e 6d 71 75 65  75 65 2e 74 65 78 74 2e  |ool.mqueue.text.|
00000ba0  22 2b c3 73 65 71 25 0d  04 10 2b 20 20 46 25 3d  |"+.seq%...+  F%=|
00000bb0  a4 6d 6f 76 65 66 69 6c  65 28 4e 24 2c 6f 24 29  |.movefile(N$,o$)|
00000bc0  3a f2 73 65 74 74 79 70  65 28 6f 24 2c 26 46 46  |:.settype(o$,&FF|
00000bd0  46 29 0d 04 1a 30 20 20  e7 46 25 20 f2 65 78 69  |F)...0  .F% .exi|
00000be0  74 28 31 2c 22 43 6f 75  6c 64 6e 27 74 20 6d 6f  |t(1,"Couldn't mo|
00000bf0  76 65 20 74 6f 20 73 70  6f 6f 6c 20 61 72 65 61  |ve to spool area|
00000c00  22 29 0d 04 24 07 20 20  cc 0d 04 2e 14 20 20 e3  |")..$.  .....  .|
00000c10  6c 25 3d 30 b8 63 6f 75  6e 74 25 2d 31 0d 04 38  |l%=0.count%-1..8|
00000c20  11 20 20 20 20 73 65 71  25 3d a4 73 65 71 0d 04  |.    seq%=.seq..|
00000c30  42 13 20 20 20 20 74 6f  24 3d 74 6f 24 28 6c 25  |B.    to$=to$(l%|
00000c40  29 0d 04 4c 10 20 20 20  20 e7 74 6f 24 3e 22 22  |)..L.    .to$>""|
00000c50  8c 0d 04 56 1b 20 20 20  20 20 20 61 74 25 3d a7  |...V.      at%=.|
00000c60  74 6f 24 2c 22 40 22 2c  31 29 2b 31 0d 04 60 3b  |to$,"@",1)+1..`;|
00000c70  20 20 20 20 20 20 74 6f  73 69 74 65 24 3d c1 74  |      tosite$=.t|
00000c80  6f 24 2c 61 74 25 29 3a  e7 61 74 25 3c 31 84 74  |o$,at%):.at%<1.t|
00000c90  6f 73 69 74 65 24 3d 22  22 8c 74 6f 73 69 74 65  |osite$="".tosite|
00000ca0  24 3d 67 61 74 65 24 0d  04 6a 48 20 20 20 20 20  |$=gate$..jH     |
00000cb0  20 e7 74 6f 73 69 74 65  24 3d 22 22 f2 65 78 69  | .tosite$="".exi|
00000cc0  74 28 31 2c 22 43 6f 75  6c 64 6e 27 74 20 73 65  |t(1,"Couldn't se|
00000cd0  6e 64 3b 20 6e 6f 20 64  65 73 74 69 6e 61 74 69  |nd; no destinati|
00000ce0  6f 6e 20 6f 72 20 67 61  74 65 77 61 79 22 29 0d  |on or gateway").|
00000cf0  04 74 38 20 20 20 20 20  20 74 65 73 74 25 3d a7  |.t8      test%=.|
00000d00  66 72 6f 6d 24 2c 22 20  22 29 3a e7 74 65 73 74  |from$," "):.test|
00000d10  25 3e 31 20 66 72 6f 6d  24 3d c0 66 72 6f 6d 24  |%>1 from$=.from$|
00000d20  2c 74 65 73 74 25 29 0d  04 7e 32 20 20 20 20 20  |,test%)..~2     |
00000d30  20 6f 24 3d 22 3c 4d 61  69 6c 24 64 69 72 3e 2e  | o$="<Mail$dir>.|
00000d40  73 70 6f 6f 6c 2e 6d 71  75 65 75 65 2e 77 6f 72  |spool.mqueue.wor|
00000d50  6b 2e 22 2b c3 73 65 71  25 0d 04 88 19 20 20 20  |k."+.seq%....   |
00000d60  20 20 20 43 25 3d a4 6f  70 65 6e 6f 75 74 28 6f  |   C%=.openout(o|
00000d70  24 29 0d 04 92 3b 20 20  20 20 20 20 20 20 e7 43  |$)...;        .C|
00000d80  25 3d 30 20 f2 65 78 69  74 28 31 2c 22 43 6f 75  |%=0 .exit(1,"Cou|
00000d90  6c 64 6e 27 74 20 6f 70  65 6e 20 6f 75 74 70 75  |ldn't open outpu|
00000da0  74 20 77 6f 72 6b 20 66  69 6c 65 22 29 0d 04 9c  |t work file")...|
00000db0  18 20 20 20 20 20 20 20  20 d5 23 43 25 2c 74 6f  |.        .#C%,to|
00000dc0  73 69 74 65 24 0d 04 a6  16 20 20 20 20 20 20 20  |site$....       |
00000dd0  20 d5 23 43 25 2c 66 72  6f 6d 24 0d 04 b0 14 20  | .#C%,from$.... |
00000de0  20 20 20 20 20 20 20 d5  23 43 25 2c 74 6f 24 0d  |       .#C%,to$.|
00000df0  04 ba 25 20 20 20 20 20  20 20 20 f2 63 66 28 43  |..%        .cf(C|
00000e00  25 29 3a f2 73 65 74 74  79 70 65 28 6f 24 2c 26  |%):.settype(o$,&|
00000e10  46 46 46 29 0d 04 c4 32  20 20 20 20 20 20 6f 24  |FFF)...2      o$|
00000e20  3d 22 3c 4d 61 69 6c 24  64 69 72 3e 2e 73 70 6f  |="<Mail$dir>.spo|
00000e30  6f 6c 2e 6d 71 75 65 75  65 2e 74 65 78 74 2e 22  |ol.mqueue.text."|
00000e40  2b c3 73 65 71 25 0d 04  ce 2f 20 20 20 20 20 20  |+.seq%.../      |
00000e50  46 25 3d a4 63 6f 70 79  66 69 6c 65 28 4e 24 2c  |F%=.copyfile(N$,|
00000e60  6f 24 29 3a f2 73 65 74  74 79 70 65 28 6f 24 2c  |o$):.settype(o$,|
00000e70  26 46 46 46 29 0d 04 d8  34 20 20 20 20 20 20 e7  |&FFF)...4      .|
00000e80  46 25 20 f2 65 78 69 74  28 31 2c 22 43 6f 75 6c  |F% .exit(1,"Coul|
00000e90  64 6e 27 74 20 6d 6f 76  65 20 74 6f 20 73 70 6f  |dn't move to spo|
00000ea0  6f 6c 20 61 72 65 61 22  29 0d 04 e2 09 20 20 20  |ol area")....   |
00000eb0  20 cd 0d 04 ec 07 20 20  ed 0d 04 f6 15 20 20 46  | .....  .....  F|
00000ec0  25 3d a4 64 65 6c 66 69  6c 65 28 4e 24 29 0d 05  |%=.delfile(N$)..|
00000ed0  00 05 cd 0d 05 0a 04 0d  05 14 25 f4 20 66 69 6e  |..........%. fin|
00000ee0  69 73 68 65 64 2c 20 73  6f 20 72 65 6d 6f 76 65  |ished, so remove|
00000ef0  20 73 6f 75 72 63 65 20  66 69 6c 65 0d 05 1e 11  | source file....|
00000f00  ff 22 72 65 6d 6f 76 65  20 22 2b 4e 24 0d 05 28  |."remove "+N$..(|
00000f10  18 f2 65 78 69 74 28 30  2c 22 4d 61 69 6c 20 73  |..exit(0,"Mail s|
00000f20  65 6e 74 22 29 0d 05 32  05 e0 0d 05 3c 04 0d 05  |ent")..2....<...|
00000f30  46 15 dd a4 6d 6f 76 65  66 69 6c 65 28 73 24 2c  |F...movefile(s$,|
00000f40  64 24 29 0d 05 50 26 ea  46 25 3a c8 99 22 58 4f  |d$)..P&.F%:.."XO|
00000f50  53 5f 46 53 43 6f 6e 74  72 6f 6c 22 2c 32 35 2c  |S_FSControl",25,|
00000f60  73 24 2c 64 24 b8 3b 46  25 0d 05 5a 32 e7 28 46  |s$,d$.;F%..Z2.(F|
00000f70  25 80 31 29 20 c8 99 22  58 4f 53 5f 46 53 43 6f  |%.1) .."XOS_FSCo|
00000f80  6e 74 72 6f 6c 22 2c 32  36 2c 73 24 2c 64 24 2c  |ntrol",26,s$,d$,|
00000f90  28 31 3c 3c 37 29 20 b8  3b 46 25 0d 05 64 0b 3d  |(1<<7) .;F%..d.=|
00000fa0  28 46 25 80 31 29 0d 05  6e 04 0d 05 78 15 dd a4  |(F%.1)..n...x...|
00000fb0  63 6f 70 79 66 69 6c 65  28 73 24 2c 64 24 29 0d  |copyfile(s$,d$).|
00000fc0  05 82 23 c8 99 22 58 4f  53 5f 46 53 43 6f 6e 74  |..#.."XOS_FSCont|
00000fd0  72 6f 6c 22 2c 32 36 2c  73 24 2c 64 24 20 b8 3b  |rol",26,s$,d$ .;|
00000fe0  46 25 0d 05 8c 0b 3d 28  46 25 80 31 29 0d 05 96  |F%....=(F%.1)...|
00000ff0  04 0d 05 a0 11 dd a4 64  65 6c 66 69 6c 65 28 66  |.......delfile(f|
00001000  24 29 0d 05 aa 1d ea 46  25 3a c8 99 22 58 4f 53  |$).....F%:.."XOS|
00001010  5f 46 69 6c 65 22 2c 36  2c 66 24 b8 3b 46 25 0d  |_File",6,f$.;F%.|
00001020  05 b4 0b 3d 28 46 25 80  31 29 0d 05 be 04 0d 05  |...=(F%.1)......|
00001030  c8 11 dd f2 65 78 69 74  28 6e 25 2c 61 24 29 0d  |....exit(n%,a$).|
00001040  05 d2 25 ff 28 22 73 65  74 20 4e 65 77 73 42 61  |..%.("set NewsBa|
00001050  73 65 24 52 65 74 75 72  6e 43 6f 64 65 20 22 2b  |se$ReturnCode "+|
00001060  c3 6e 25 29 0d 05 dc 24  ff 28 22 73 65 74 20 4e  |.n%)...$.("set N|
00001070  65 77 73 42 61 73 65 24  52 65 74 75 72 6e 49 6e  |ewsBase$ReturnIn|
00001080  66 6f 20 22 2b 61 24 29  0d 05 e6 05 e0 0d 05 f0  |fo "+a$)........|
00001090  05 e1 0d 05 fa 04 0d 06  04 0f dd f2 63 68 65 63  |............chec|
000010a0  6b 64 69 72 73 0d 06 0e  3b e7 a4 6f 62 6a 74 79  |kdirs...;..objty|
000010b0  70 65 28 22 3c 4d 61 69  6c 24 64 69 72 3e 22 29  |pe("<Mail$dir>")|
000010c0  3c 32 20 f2 65 78 69 74  28 31 2c 22 21 4d 61 69  |<2 .exit(1,"!Mai|
000010d0  6c 44 69 72 20 6e 6f 74  20 66 6f 75 6e 64 22 29  |lDir not found")|
000010e0  0d 06 18 22 f2 65 6e 73  75 72 65 64 69 72 28 22  |...".ensuredir("|
000010f0  3c 4d 61 69 6c 24 64 69  72 3e 2e 73 70 6f 6f 6c  |<Mail$dir>.spool|
00001100  22 29 0d 06 22 29 f2 65  6e 73 75 72 65 64 69 72  |")..").ensuredir|
00001110  28 22 3c 4d 61 69 6c 24  64 69 72 3e 2e 73 70 6f  |("<Mail$dir>.spo|
00001120  6f 6c 2e 6d 71 75 65 75  65 22 29 0d 06 2c 2e f2  |ol.mqueue")..,..|
00001130  65 6e 73 75 72 65 64 69  72 28 22 3c 4d 61 69 6c  |ensuredir("<Mail|
00001140  24 64 69 72 3e 2e 73 70  6f 6f 6c 2e 6d 71 75 65  |$dir>.spool.mque|
00001150  75 65 2e 74 65 78 74 22  29 0d 06 36 2e f2 65 6e  |ue.text")..6..en|
00001160  73 75 72 65 64 69 72 28  22 3c 4d 61 69 6c 24 64  |suredir("<Mail$d|
00001170  69 72 3e 2e 73 70 6f 6f  6c 2e 6d 71 75 65 75 65  |ir>.spool.mqueue|
00001180  2e 77 6f 72 6b 22 29 0d  06 40 8a e7 a4 6f 62 6a  |.work")..@...obj|
00001190  74 79 70 65 28 22 3c 4d  61 69 6c 24 64 69 72 3e  |type("<Mail$dir>|
000011a0  2e 73 70 6f 6f 6c 2e 6d  71 75 65 75 65 2e 74 65  |.spool.mqueue.te|
000011b0  78 74 22 29 3c 32 20 84  a4 6f 62 6a 74 79 70 65  |xt")<2 ..objtype|
000011c0  28 22 3c 4d 61 69 6c 24  64 69 72 3e 2e 73 70 6f  |("<Mail$dir>.spo|
000011d0  6f 6c 2e 6d 71 75 65 75  65 2e 77 6f 72 6b 22 29  |ol.mqueue.work")|
000011e0  3c 32 20 8c f2 65 78 69  74 28 31 2c 22 53 4d 54  |<2 ..exit(1,"SMT|
000011f0  50 20 73 70 6f 6f 6c 20  64 69 72 65 63 74 6f 72  |P spool director|
00001200  69 65 73 20 6e 6f 74 20  63 72 65 61 74 65 64 22  |ies not created"|
00001210  29 0d 06 4a 05 e1 0d 06  54 04 0d 06 5e 13 dd f2  |)..J....T...^...|
00001220  65 6e 73 75 72 65 64 69  72 28 66 24 29 0d 06 68  |ensuredir(f$)..h|
00001230  07 ea 74 25 0d 06 72 13  74 25 3d a4 6f 62 6a 74  |..t%..r.t%=.objt|
00001240  79 70 65 28 66 24 29 0d  06 7c 20 e7 74 25 3c 32  |ype(f$)..| .t%<2|
00001250  84 74 25 3e 33 8c c8 99  22 58 4f 53 5f 46 69 6c  |.t%>3..."XOS_Fil|
00001260  65 22 2c 38 2c 66 24 0d  06 86 05 e1 0d 06 90 04  |e",8,f$.........|
00001270  0d 06 9a 0e dd a4 73 67  65 74 28 68 25 29 0d 06  |......sget(h%)..|
00001280  a4 38 f4 20 72 65 74 75  72 6e 20 6c 69 6e 65 20  |.8. return line |
00001290  66 72 6f 6d 20 66 69 6c  65 20 77 69 74 68 6f 75  |from file withou|
000012a0  74 20 65 72 72 6f 72 20  69 66 20 74 6f 6f 20 6c  |t error if too l|
000012b0  6f 6e 67 2e 2e 2e 0d 06  ae 0a ea 61 24 2c 43 25  |ong........a$,C%|
000012c0  0d 06 b8 33 c8 95 43 25  3c 3e 31 30 3a 43 25 3d  |...3..C%<>10:C%=|
000012d0  9a 23 68 25 3a e7 a9 61  24 3c 32 35 33 80 43 25  |.#h%:..a$<253.C%|
000012e0  3c 3e 31 30 80 43 25 3c  3e 31 33 3a 61 24 2b 3d  |<>10.C%<>13:a$+=|
000012f0  bd 43 25 0d 06 c2 05 ce  0d 06 cc 07 3d 61 24 0d  |.C%.........=a$.|
00001300  06 d6 04 0d 06 e0 11 dd  a4 6f 62 6a 74 79 70 65  |.........objtype|
00001310  28 66 24 29 0d 06 ea 07  ea 46 25 0d 06 f4 1c c8  |(f$).....F%.....|
00001320  99 22 58 4f 53 5f 46 69  6c 65 22 2c 31 37 2c 66  |."XOS_File",17,f|
00001330  24 b8 74 25 3b 46 25 0d  06 fe 14 e7 28 46 25 80  |$.t%;F%.....(F%.|
00001340  31 29 8c 3d 2d 31 3a 8b  3d 74 25 0d 07 08 04 0d  |1).=-1:.=t%.....|
00001350  07 12 14 dd f2 73 65 74  74 79 70 65 28 66 24 2c  |.....settype(f$,|
00001360  74 25 29 0d 07 1c 19 c8  99 22 58 4f 53 5f 46 69  |t%)......"XOS_Fi|
00001370  6c 65 22 2c 31 38 2c 66  24 2c 74 25 0d 07 26 05  |le",18,f$,t%..&.|
00001380  e1 0d 07 30 04 0d 07 3a  0e dd f2 63 66 28 f8 20  |...0...:...cf(. |
00001390  68 25 29 0d 07 44 21 e7  68 25 3c 3e 30 20 c8 99  |h%)..D!.h%<>0 ..|
000013a0  22 58 4f 53 5f 46 69 6e  64 22 2c 30 2c 68 25 3a  |"XOS_Find",0,h%:|
000013b0  68 25 3d 30 0d 07 4e 05  e1 0d 07 58 04 0d 07 62  |h%=0..N....X...b|
000013c0  10 dd a4 76 61 72 76 61  6c 28 41 24 29 0d 07 6c  |...varval(A$)..l|
000013d0  0a ea 4c 25 2c 46 25 0d  07 76 2f c8 99 22 58 4f  |..L%,F%..v/.."XO|
000013e0  53 5f 52 65 61 64 56 61  72 56 61 6c 22 2c 41 24  |S_ReadVarVal",A$|
000013f0  2c 74 6d 70 25 2c 32 35  36 2c 30 2c 33 20 b8 2c  |,tmp%,256,0,3 .,|
00001400  2c 4c 25 3b 46 25 0d 07  80 19 e7 28 46 25 80 31  |,L%;F%.....(F%.1|
00001410  29 20 84 4c 25 3e 32 35  36 20 8c 3a 3d 22 22 0d  |) .L%>256 .:="".|
00001420  07 8a 15 74 6d 70 25 3f  4c 25 3d 31 33 3a 3d 24  |...tmp%?L%=13:=$|
00001430  74 6d 70 25 0d 07 94 04  0d 07 9e 0f dd a4 6c 6f  |tmp%..........lo|
00001440  77 65 72 28 41 24 29 0d  07 a8 16 ea 42 24 2c 6c  |wer(A$).....B$,l|
00001450  25 2c 63 25 2c 61 25 2c  7a 25 2c 64 25 0d 07 b2  |%,c%,a%,z%,d%...|
00001460  1e 61 25 3d 97 22 41 22  3a 7a 25 3d 97 22 5a 22  |.a%=."A":z%=."Z"|
00001470  3a 64 25 3d 97 22 61 22  2d 61 25 0d 07 bc 0b e7  |:d%=."a"-a%.....|
00001480  a9 41 24 3e 30 8c 0d 07  c6 0d e3 6c 25 3d 31 b8  |.A$>0......l%=1.|
00001490  a9 41 24 0d 07 d0 13 20  20 63 25 3d 97 c1 41 24  |.A$....  c%=..A$|
000014a0  2c 6c 25 2c 31 29 0d 07  da 1b 20 20 e7 63 25 3e  |,l%,1)....  .c%>|
000014b0  3d 61 25 80 63 25 3c 3d  7a 25 8c 63 25 2b 3d 64  |=a%.c%<=z%.c%+=d|
000014c0  25 0d 07 e4 0d 20 20 42  24 2b 3d bd 63 25 0d 07  |%....  B$+=.c%..|
000014d0  ee 05 ed 0d 07 f8 05 cd  0d 08 02 07 3d 42 24 0d  |............=B$.|
000014e0  08 0c 04 0d 08 16 16 dd  a4 67 65 74 61 64 64 72  |.........getaddr|
000014f0  65 73 73 28 f8 20 41 24  29 0d 08 20 26 ea 42 24  |ess(. A$).. &.B$|
00001500  2c 43 24 2c 61 74 25 2c  65 6e 64 25 3a 42 24 3d  |,C$,at%,end%:B$=|
00001510  22 22 3a 61 74 25 3d 30  3a 65 6e 64 25 3d 30 0d  |"":at%=0:end%=0.|
00001520  08 2a 18 6c 25 3d 30 3a  c8 95 6c 25 3c a9 41 24  |.*.l%=0:..l%<.A$|
00001530  80 65 6e 64 25 3d 30 0d  08 34 18 20 20 6c 25 2b  |.end%=0..4.  l%+|
00001540  3d 31 3a 43 24 3d c1 41  24 2c 6c 25 2c 31 29 0d  |=1:C$=.A$,l%,1).|
00001550  08 3e 0b 20 20 c8 8e 43  24 ca 0d 08 48 1a 20 20  |.>.  ..C$...H.  |
00001560  20 20 c9 22 2c 22 3a e7  42 24 3e 22 22 8c 65 6e  |  .",":.B$>"".en|
00001570  64 25 3d 31 0d 08 52 20  20 20 20 20 c9 22 28 22  |d%=1..R     ."("|
00001580  3a f5 6c 25 2b 3d 31 3a  43 24 3d c1 41 24 2c 6c  |:.l%+=1:C$=.A$,l|
00001590  25 2c 31 29 0d 08 5c 17  20 20 20 20 20 20 e7 43  |%,1)..\.      .C|
000015a0  24 3d 22 5c 22 8c 6c 25  2b 3d 31 0d 08 66 18 20  |$="\".l%+=1..f. |
000015b0  20 20 20 20 20 fd 43 24  3d 22 29 22 84 6c 25 3e  |     .C$=")".l%>|
000015c0  a9 41 24 0d 08 70 12 20  20 20 20 c9 22 5c 22 3a  |.A$..p.    ."\":|
000015d0  6c 25 2b 3d 31 0d 08 7a  0d 20 20 20 20 c9 22 3c  |l%+=1..z.    ."<|
000015e0  22 3a 0d 08 84 23 20 20  20 20 20 20 42 24 3d 22  |":...#      B$="|
000015f0  22 3a f5 6c 25 2b 3d 31  3a 43 24 3d c1 41 24 2c  |":.l%+=1:C$=.A$,|
00001600  6c 25 2c 31 29 0d 08 8e  27 20 20 20 20 20 20 e7  |l%,1)...'      .|
00001610  43 24 3d 22 5c 22 8c 6c  25 2b 3d 31 3a 8b e7 43  |C$="\".l%+=1:..C|
00001620  24 3c 3e 22 3e 22 42 24  2b 3d 43 24 0d 08 98 18  |$<>">"B$+=C$....|
00001630  20 20 20 20 20 20 fd 43  24 3d 22 3e 22 84 6c 25  |      .C$=">".l%|
00001640  3e a9 41 24 0d 08 a2 0d  20 20 20 20 c9 22 40 22  |>.A$....    ."@"|
00001650  3a 0d 08 ac 1f 20 20 20  20 20 20 e7 61 74 25 3e  |:....      .at%>|
00001660  30 8c c1 42 24 2c 61 74  25 2c 31 29 3d 22 25 22  |0..B$,at%,1)="%"|
00001670  0d 08 b6 18 20 20 20 20  20 20 42 24 2b 3d 43 24  |....      B$+=C$|
00001680  3a 61 74 25 3d a9 42 24  0d 08 c0 16 20 20 20 20  |:at%=.B$....    |
00001690  c9 22 20 22 2c bd 39 3a  f4 20 73 6b 69 70 0d 08  |." ",.9:. skip..|
000016a0  ca 28 20 20 20 20 c9 22  22 22 22 3a 42 24 2b 3d  |.(    ."""":B$+=|
000016b0  43 24 3a f5 6c 25 2b 3d  31 3a 43 24 3d c1 41 24  |C$:.l%+=1:C$=.A$|
000016c0  2c 6c 25 2c 31 29 0d 08  d4 28 20 20 20 20 20 20  |,l%,1)...(      |
000016d0  e7 43 24 3d 22 5c 22 8c  6c 25 2b 3d 31 3a 8b e7  |.C$="\".l%+=1:..|
000016e0  43 24 3c 3e 22 22 22 22  42 24 2b 3d 43 24 0d 08  |C$<>""""B$+=C$..|
000016f0  de 29 20 20 20 20 20 20  fd 43 24 3d 22 22 22 22  |.)      .C$=""""|
00001700  84 6c 25 3e a9 41 24 3a  e7 43 24 3d 22 22 22 22  |.l%>.A$:.C$=""""|
00001710  8c 42 24 2b 3d 43 24 0d  08 e8 10 20 20 20 20 7f  |.B$+=C$....    .|
00001720  3a 42 24 2b 3d 43 24 0d  08 f2 07 20 20 cb 0d 08  |:B$+=C$....  ...|
00001730  fc 05 ce 0d 09 06 10 41  24 3d c1 41 24 2c 6c 25  |.......A$=.A$,l%|
00001740  2b 31 29 0d 09 10 07 3d  42 24 0d 09 1a 04 0d 09  |+1)....=B$......|
00001750  24 09 dd a4 73 65 71 0d  09 2e 28 f4 20 72 65 61  |$...seq...(. rea|
00001760  64 20 69 6e 20 73 65 71  75 65 6e 63 65 20 6e 75  |d in sequence nu|
00001770  6d 65 72 2c 20 61 6e 64  20 75 70 64 61 74 65 0d  |mer, and update.|
00001780  09 38 0c ea 73 65 71 25  2c 43 25 0d 09 42 2b 73  |.8..seq%,C%..B+s|
00001790  65 71 24 3d 22 3c 4d 61  69 6c 24 64 69 72 3e 2e  |eq$="<Mail$dir>.|
000017a0  73 70 6f 6f 6c 2e 6d 71  75 65 75 65 2e 73 65 71  |spool.mqueue.seq|
000017b0  75 65 6e 63 65 22 0d 09  4c 17 e7 a4 6f 62 6a 74  |uence"..L...objt|
000017c0  79 70 65 28 73 65 71 24  29 3d 30 20 8c 0d 09 56  |ype(seq$)=0 ...V|
000017d0  0c 20 20 73 65 71 25 3d  31 0d 09 60 43 20 20 c8  |.  seq%=1..`C  .|
000017e0  95 a4 6f 62 6a 74 79 70  65 28 22 3c 4d 61 69 6c  |..objtype("<Mail|
000017f0  24 64 69 72 3e 2e 73 70  6f 6f 6c 2e 6d 71 75 65  |$dir>.spool.mque|
00001800  75 65 2e 74 65 78 74 2e  22 2b c3 73 65 71 25 29  |ue.text."+.seq%)|
00001810  3e 30 3a 73 65 71 25 2b  3d 31 3a ce 0d 09 6a 07  |>0:seq%+=1:...j.|
00001820  20 20 cc 0d 09 74 40 20  20 43 25 3d a4 6f 70 65  |  ...t@  C%=.ope|
00001830  6e 69 6e 28 73 65 71 24  29 3a e7 43 25 3d 30 20  |nin(seq$):.C%=0 |
00001840  f2 65 78 69 74 28 31 2c  22 43 61 6e 27 74 20 6f  |.exit(1,"Can't o|
00001850  70 65 6e 20 73 65 71 75  65 6e 63 65 20 66 69 6c  |pen sequence fil|
00001860  65 22 29 0d 09 7e 22 20  20 73 65 71 25 3d bb 28  |e")..~"  seq%=.(|
00001870  be 23 43 25 29 3a f2 63  66 28 43 25 29 3a 73 65  |.#C%):.cf(C%):se|
00001880  71 25 2b 3d 31 0d 09 88  05 cd 0d 09 92 28 43 25  |q%+=1........(C%|
00001890  3d a4 6f 70 65 6e 6f 75  74 28 73 65 71 24 29 3a  |=.openout(seq$):|
000018a0  d5 23 43 25 2c c3 73 65  71 25 3a f2 63 66 28 43  |.#C%,.seq%:.cf(C|
000018b0  25 29 0d 09 9c 09 3d 73  65 71 25 0d 09 a6 04 0d  |%)....=seq%.....|
000018c0  09 b0 13 dd a4 72 65 6d  6f 76 65 62 63 63 28 64  |.....removebcc(d|
000018d0  24 29 0d 09 ba 1a ea 66  24 2c 61 24 2c 72 33 25  |$).....f$,a$,r3%|
000018e0  3a 66 24 3d a4 74 6d 70  66 69 6c 65 0d 09 c4 13  |:f$=.tmpfile....|
000018f0  66 31 25 3d a4 6f 70 65  6e 69 6e 28 64 24 29 0d  |f1%=.openin(d$).|
00001900  09 ce 0b e7 66 31 25 3e  30 8c 0d 09 d8 16 20 20  |....f1%>0.....  |
00001910  66 32 25 3d a4 6f 70 65  6e 6f 75 74 28 66 24 29  |f2%=.openout(f$)|
00001920  0d 09 e2 0d 20 20 e7 66  32 25 3e 30 8c 0d 09 ec  |....  .f2%>0....|
00001930  10 20 20 20 20 69 6e 62  63 63 25 3d a3 0d 09 f6  |.    inbcc%=....|
00001940  16 20 20 20 20 f5 41 24  3d a4 73 67 65 74 28 66  |.    .A$=.sget(f|
00001950  31 25 29 0d 0a 00 1f 20  20 20 20 20 20 e7 c0 41  |1%)....      ..A|
00001960  24 2c 31 29 3c 3e 22 20  22 8c 69 6e 62 63 63 25  |$,1)<>" ".inbcc%|
00001970  3d a3 0d 0a 0a 21 20 20  20 20 20 20 e7 c0 41 24  |=....!      ..A$|
00001980  2c 34 29 3d 22 42 63 63  3a 22 8c 69 6e 62 63 63  |,4)="Bcc:".inbcc|
00001990  25 3d b9 0d 0a 14 1d 20  20 20 20 20 20 e7 69 6e  |%=.....      .in|
000019a0  62 63 63 25 3d a3 20 8c  d5 23 66 32 25 2c 41 24  |bcc%=. ..#f2%,A$|
000019b0  0d 0a 1e 14 20 20 20 20  fd 41 24 3d 22 22 84 c5  |....    .A$=""..|
000019c0  23 66 31 25 0d 0a 28 10  20 20 20 20 e7 ac c5 23  |#f1%..(.    ...#|
000019d0  66 31 25 8c 0d 0a 32 0f  20 20 20 20 20 20 72 33  |f1%...2.      r3|
000019e0  25 3d 30 0d 0a 3c 36 20  20 20 20 20 20 c8 95 72  |%=0..<6      ..r|
000019f0  33 25 3d 30 3a c8 99 22  58 4f 53 5f 47 42 50 42  |3%=0:.."XOS_GBPB|
00001a00  22 2c 34 2c 66 31 25 2c  6e 62 75 66 25 2c 34 30  |",4,f1%,nbuf%,40|
00001a10  39 36 b8 2c 2c 2c 72 33  25 0d 0a 46 37 20 20 20  |96.,,,r3%..F7   |
00001a20  20 20 20 20 20 e7 72 33  25 3c 34 30 39 36 8c c8  |     .r3%<4096..|
00001a30  99 22 58 4f 53 5f 47 42  50 42 22 2c 32 2c 66 32  |."XOS_GBPB",2,f2|
00001a40  25 2c 6e 62 75 66 25 2c  34 30 39 36 2d 72 33 25  |%,nbuf%,4096-r3%|
00001a50  0d 0a 50 0b 20 20 20 20  20 20 ce 0d 0a 5a 09 20  |..P.      ...Z. |
00001a60  20 20 20 cd 0d 0a 64 22  20 20 20 20 f2 63 66 28  |   ...d"    .cf(|
00001a70  66 32 25 29 3a f2 73 65  74 74 79 70 65 28 66 24  |f2%):.settype(f$|
00001a80  2c 26 46 46 46 29 0d 0a  6e 09 20 20 20 20 cc 0d  |,&FFF)..n.    ..|
00001a90  0a 78 36 20 20 20 20 f2  65 78 69 74 28 31 2c 22  |.x6    .exit(1,"|
00001aa0  43 6f 75 6c 64 6e 27 74  20 6f 70 65 6e 20 74 65  |Couldn't open te|
00001ab0  6d 70 20 66 69 6c 65 20  66 6f 72 20 6d 61 69 6c  |mp file for mail|
00001ac0  69 6e 67 22 29 0d 0a 82  07 20 20 cd 0d 0a 8c 1e  |ing")....  .....|
00001ad0  20 20 f2 63 66 28 66 31  25 29 3a 46 25 3d a4 64  |  .cf(f1%):F%=.d|
00001ae0  65 6c 66 69 6c 65 28 64  24 29 0d 0a 96 05 cd 0d  |elfile(d$)......|
00001af0  0a a0 07 3d 66 24 0d 0a  aa 04 0d 0a b4 17 dd a4  |...=f$..........|
00001b00  6c 6f 63 61 6c 73 61 76  65 28 66 24 2c 74 6f 24  |localsave(f$,to$|
00001b10  29 0d 0a be 0f ea 6f 24  2c 72 33 25 2c 6f 6b 25  |).....o$,r3%,ok%|
00001b20  0d 0a c8 1b 6f 6b 25 3d  30 3a 6f 24 3d 6c 6f 63  |....ok%=0:o$=loc|
00001b30  61 6c 24 2b 22 2e 22 2b  74 6f 24 0d 0a d2 13 66  |al$+"."+to$....f|
00001b40  31 25 3d a4 6f 70 65 6e  69 6e 28 66 24 29 0d 0a  |1%=.openin(f$)..|
00001b50  dc 0b e7 66 31 25 3e 30  8c 0d 0a e6 15 20 20 66  |...f1%>0.....  f|
00001b60  32 25 3d a4 6f 70 65 6e  75 70 28 6f 24 29 0d 0a  |2%=.openup(o$)..|
00001b70  f0 0d 20 20 e7 66 32 25  3e 30 8c 0d 0a fa 13 20  |..  .f2%>0..... |
00001b80  20 20 20 cf 23 66 32 25  3d a2 23 66 32 25 0d 0b  |   .#f2%=.#f2%..|
00001b90  04 18 20 20 20 20 d5 23  66 32 25 2c 22 46 72 6f  |..    .#f2%,"Fro|
00001ba0  6d 20 22 2b 91 24 0d 0b  0e 10 20 20 20 20 e7 ac  |m "+.$....    ..|
00001bb0  c5 23 66 31 25 8c 0d 0b  18 0f 20 20 20 20 20 20  |.#f1%.....      |
00001bc0  72 33 25 3d 30 0d 0b 22  36 20 20 20 20 20 20 c8  |r3%=0.."6      .|
00001bd0  95 72 33 25 3d 30 3a c8  99 22 58 4f 53 5f 47 42  |.r3%=0:.."XOS_GB|
00001be0  50 42 22 2c 34 2c 66 31  25 2c 6e 62 75 66 25 2c  |PB",4,f1%,nbuf%,|
00001bf0  34 30 39 36 b8 2c 2c 2c  72 33 25 0d 0b 2c 37 20  |4096.,,,r3%..,7 |
00001c00  20 20 20 20 20 20 20 e7  72 33 25 3c 34 30 39 36  |       .r3%<4096|
00001c10  8c c8 99 22 58 4f 53 5f  47 42 50 42 22 2c 32 2c  |..."XOS_GBPB",2,|
00001c20  66 32 25 2c 6e 62 75 66  25 2c 34 30 39 36 2d 72  |f2%,nbuf%,4096-r|
00001c30  33 25 0d 0b 36 0b 20 20  20 20 20 20 ce 0d 0b 40  |3%..6.      ...@|
00001c40  09 20 20 20 20 cd 0d 0b  4a 10 20 20 20 20 d5 23  |.    ...J.    .#|
00001c50  66 32 25 2c 22 22 0d 0b  54 28 20 20 20 20 f2 63  |f2%,""..T(    .c|
00001c60  66 28 66 32 25 29 3a f2  73 65 74 74 79 70 65 28  |f(f2%):.settype(|
00001c70  6f 24 2c 26 46 46 46 29  3a 6f 6b 25 3d b9 0d 0b  |o$,&FFF):ok%=...|
00001c80  5e 07 20 20 cd 0d 0b 68  0e 20 20 f2 63 66 28 66  |^.  ...h.  .cf(f|
00001c90  31 25 29 0d 0b 72 05 cd  0d 0b 7c 08 3d 6f 6b 25  |1%)..r....|.=ok%|
00001ca0  0d 0b 86 04 0d 0b 90 10  dd a4 6f 70 65 6e 69 6e  |..........openin|
00001cb0  28 66 24 29 0d 0b 9a 0a  ea 68 25 2c 46 25 0d 0b  |(f$).....h%,F%..|
00001cc0  a4 2e c8 99 22 58 4f 53  5f 46 69 6e 64 22 2c 26  |...."XOS_Find",&|
00001cd0  34 46 2c 66 24 20 b8 68  25 3b 46 25 3a e7 28 46  |4F,f$ .h%;F%:.(F|
00001ce0  25 80 31 29 3c 3e 30 8c  68 25 3d 30 0d 0b ae 07  |%.1)<>0.h%=0....|
00001cf0  3d 68 25 0d 0b b8 04 0d  0b c2 10 dd a4 6f 70 65  |=h%..........ope|
00001d00  6e 75 70 28 66 24 29 0d  0b cc 0a ea 68 25 2c 46  |nup(f$).....h%,F|
00001d10  25 0d 0b d6 1d c8 99 22  58 4f 53 5f 46 69 6e 64  |%......"XOS_Find|
00001d20  22 2c 26 43 46 2c 66 24  b8 68 25 3b 46 25 0d 0b  |",&CF,f$.h%;F%..|
00001d30  e0 35 e7 28 46 25 80 31  29 8c c8 99 22 58 4f 53  |.5.(F%.1)..."XOS|
00001d40  5f 46 69 6e 64 22 2c 26  38 46 2c 66 24 b8 68 25  |_Find",&8F,f$.h%|
00001d50  3b 46 25 3a e7 28 46 25  80 31 29 3c 3e 30 8c 68  |;F%:.(F%.1)<>0.h|
00001d60  25 3d 30 0d 0b ea 07 3d  68 25 0d 0b f4 04 0d 0b  |%=0....=h%......|
00001d70  fe 11 dd a4 6f 70 65 6e  6f 75 74 28 66 24 29 0d  |....openout(f$).|
00001d80  0c 08 0a ea 68 25 2c 46  25 0d 0c 12 2d c8 99 22  |....h%,F%...-.."|
00001d90  58 4f 53 5f 46 69 6e 64  22 2c 26 38 46 2c 66 24  |XOS_Find",&8F,f$|
00001da0  b8 68 25 3b 46 25 3a e7  28 46 25 80 31 29 3c 3e  |.h%;F%:.(F%.1)<>|
00001db0  30 8c 68 25 3d 30 0d 0c  1c 07 3d 68 25 0d 0c 26  |0.h%=0....=h%..&|
00001dc0  04 0d 0c 30 15 dd a4 67  65 74 70 61 72 28 f8 20  |...0...getpar(. |
00001dd0  41 24 2c 73 24 29 0d 0c  3a 0a ea 42 24 2c 6c 25  |A$,s$)..:..B$,l%|
00001de0  0d 0c 44 0e 6c 25 3d a7  41 24 2c 73 24 29 0d 0c  |..D.l%=.A$,s$)..|
00001df0  4e 0a e7 6c 25 3e 30 8c  0d 0c 58 1f 20 20 42 24  |N..l%>0...X.  B$|
00001e00  3d c0 41 24 2c 6c 25 2d  31 29 3a 41 24 3d c1 41  |=.A$,l%-1):A$=.A|
00001e10  24 2c 6c 25 2b 31 29 0d  0c 62 07 20 20 cc 0d 0c  |$,l%+1)..b.  ...|
00001e20  6c 11 20 20 42 24 3d 41  24 3a 41 24 3d 22 22 0d  |l.  B$=A$:A$="".|
00001e30  0c 76 05 cd 0d 0c 80 07  3d 42 24 0d 0c 8a 04 0d  |.v......=B$.....|
00001e40  0c 94 0d dd a4 74 6d 70  66 69 6c 65 0d 0c 9e 07  |.....tmpfile....|
00001e50  ea 66 24 0d 0c a8 31 f5  66 24 3d 22 3c 4e 65 77  |.f$...1.f$="<New|
00001e60  73 42 61 73 65 24 44 61  74 61 3e 2e 73 63 72 61  |sBase$Data>.scra|
00001e70  74 63 68 2e 74 6d 70 22  2b c3 28 b3 28 31 30 30  |tch.tmp"+.(.(100|
00001e80  30 30 29 29 0d 0c b2 13  fd a4 6f 62 6a 74 79 70  |00))......objtyp|
00001e90  65 28 66 24 29 3d 30 0d  0c bc 07 3d 66 24 0d ff  |e(f$)=0....=f$..|
00001ea0