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

StarterPak/!Newsbase/Transports/taylor/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/taylor/sendmail
Read OK:
File size: 0E93 bytes
Load address: 0000
Exec address: 0000
File contents
   10REM >sendmail
   20REM takes a mail message file and copies to outgoing directory
   30REM converted from ka9q.sendmail. This version properly handles
   40REM Bcc!
   50REM
   60REM Author:         Gunnar ZREPORTtl
   70REM Date:           14-Sep-1994
   80REM Last modified:  10-Nov-1994
   90
  100ONERROR REPORT:PRINT" at line ";ERL:END
  110
  120LIBRARY "<NewsBase$TaylorDir>.ScriptLib"
  130
  140REM get the command line parameters.
  150PROCentry
  160N$="":u$=""
  170IF (argc = 3) OR (argc = 5) THEN
  180    FOR i%=1 TO argc - 1
  190        CASE argv$(i%) OF
  200            WHEN "-f": N$ = argv$(i% + 1): i% += 1
  210            WHEN "-u": u$ = argv$(i% + 1): i% += 1
  220            OTHERWISE PROCexit(1, "Invalid Parameter")
  230        ENDCASE
  240    NEXT i%
  250ELSE
  260    PROCexit(1, "Invalid Parameters")
  270ENDIF
  280
  290IFu$>""THEN
  300    uid% = FNgetuid(user$)
  310    IF uid% = -1 THEN
  320        PROCexit(1, "unknown user")
  330    ENDIF
  340    OSCLI("*set UUCP_UID " + STR$(uid%))
  350ENDIF
  360
  370REM we store temp. files in the scrapdir
  380IF FNobjtype("<Wimp$ScrapDir>") = 0 THEN
  390    PROCexit(1, "!Scrap must be seen for this to work!")
  400ENDIF
  410
  420REM no fixed upper limit, let memory be the factor...
  430tomax%=(HIMEM-END-1000)DIV40
  440DIMto$(tomax%)
  450
  460REM now extract to/from info...
  470IF u$ <> "" THEN
  480    from$=u$ + "@" + FNgetenv("NewsBase$MailName")
  490ELSE
  491    from$=""
  492ENDIF
  493to$="":count%=0
  510C1%=OPENIN(N$):IFC1%=0 PROCexit(1, "Couldn't open file")
  520REPEAT
  530  A$=GET$#C1%
  540  IF u$="" THEN IFLEFT$(A$,6)="From: " THEN temp$=MID$(A$,7):from$=FNgetaddress(temp$)
  550  IFLEFT$(A$,4)="To: "ORLEFT$(A$,4)="Cc: "  ORLEFT$(A$,5)="Bcc: " THEN
  560    to$=MID$(A$,5):REPEAT
  570    to$(count%)=FNgetaddress(to$):count%+=1
  580    UNTILto$=""ORcount%=tomax%
  590  ENDIF
  600UNTILA$=""OREOF#C1%
  610CLOSE#C1%
  620
  630REM we copy the file to a temporary batch, prefixing it with
  640REM the "From " line, which sendmail does not do, and removing
  650REM Bcc: lines if present.
  660batchname$ = "<Wimp$ScrapDir>." + LEFT$("DM" + STR$TIME, 8)
  670mail% = OPENIN(N$)
  680batch% = OPENOUT(batchname$)
  690REM the following line is just a temporary hack until sendmail
  700REM does generate the "From " line.
  710BPUT#batch%, "From " + FNfromstr(from$)
  720WHILE NOT EOF#mail%
  730    c$ = GET$#mail%
  740    IF LEFT$(c$,5) <> "Bcc: " THEN BPUT#batch%, c$
  750ENDWHILE
  760CLOSE #batch%
  770CLOSE #mail%
  780
  790REM now call the DoMail obey script on the generated batch
  800REM and all of the recipients to do the actual sending.
  810OS$ = "<NewsBase$Dir>.transports.Taylor.DoMail "+batchname$
  820FOR i% = 0 TO count% - 1
  830  OS$ = OS$ + " " + to$(i%)
  840NEXT
  850
  860REM The DoMail script does not return, thus we remove the file
  870REM in N$ here, and let the script remove the file in batchname$
  880OSCLI("remove " + N$)
  890OSCLI(OS$)
  900
  910REM in case we get here anyway...
  920PROCexit(1, "Mail failed")
  930END
  940
  950DEFPROCexit(n%,a$)
  960OSCLI("set NewsBase$ReturnCode "+STR$n%)
  970OSCLI("set NewsBase$ReturnInfo "+a$)
  980END
  990ENDPROC
 1000
 1010DEFFNgetaddress(RETURN A$)
 1020LOCALB$,C$,at%,end%:B$="":at%=0:end%=0
 1030l%=0:WHILEl%<LENA$ANDend%=0
 1040  l%+=1:C$=MID$(A$,l%,1)
 1050  CASEC$OF
 1060    WHEN" ",",",CHR$9:IFB$>""ANDat%<>0THENend%=1
 1070    WHEN"(":REPEATl%+=1:C$=MID$(A$,l%,1)
 1080      IFC$="\"THENl%+=1
 1090      UNTILC$=")"ORl%>LENA$
 1100    WHEN"\":l%+=1
 1110    WHEN"<":
 1120      B$="":REPEATl%+=1:C$=MID$(A$,l%,1)
 1130      IFC$="\"THENl%+=1:ELSEIFC$<>">"B$+=C$
 1140      UNTILC$=">"ORl%>LENA$
 1150    WHEN"@":
 1160      IFat%>0THENMID$(B$,at%,1)="%"
 1170      B$+=C$:at%=LENB$
 1180    WHEN"""":REPEATl%+=1:C$=MID$(A$,l%,1)
 1190      IFC$="\"THENl%+=1:ELSEIFC$<>""""B$+=C$
 1200      UNTILC$=""""ORl%>LENA$
 1210    OTHERWISE:B$+=C$
 1220  ENDCASE
 1230ENDWHILE
 1240A$=MID$(A$,l%+1)
 1250=B$
 1260
 1270REM this generates an entry for the "From " header line by
 1280REM taking the From: line, reading the adress from it, and
 1290REM building a string of the form host.domain!user
 1300REM THIS IS ONLY SUITABLE FOR MAIL ORIGINATING AT THIS SYSTEM
 1310DEFFNfromstr(from$)
 1320LOCAL pos%,R$
 1330pos%=INSTR(from$,"@")
 1340IF pos%>1 THEN
 1350  R$=MID$(from$, pos%+1) + "!" + LEFT$(from$,pos%-1)
 1360ELSE
 1370  PROCexit(1,"Invalid From: adress")
 1380ENDIF
 1390=R$
 1400
 1410DEFFNobjtype(f$)
 1420LOCALF%
 1430SYS"XOS_File",17,f$TOt%;F%
 1440IF(F%AND1)THEN=-1:ELSE=t%

� >sendmail
@� takes a mail message file and copies to outgoing directory
A� converted from ka9q.sendmail. This version properly handles
(
� Bcc!
2�
<!� Author:         Gunnar Z�tl
F!� Date:           14-Sep-1994
P!� Last modified:  10-Nov-1994
Z
d� �:�" at line ";�:�
n
x'ț "<NewsBase$TaylorDir>.ScriptLib"
�
�&� get the command line parameters.
�
�entry
�N$="":u$=""
�� (argc = 3) � (argc = 5) �
�    � i%=1 � argc - 1
�        Ȏ argv$(i%) �
�3            � "-f": N$ = argv$(i% + 1): i% += 1
�3            � "-u": u$ = argv$(i% + 1): i% += 1
�/             �exit(1, "Invalid Parameter")
�
        �
�    � i%
��
&    �exit(1, "Invalid Parameters")
�

"�u$>""�
,    uid% = �getuid(user$)
6    � uid% = -1 �
@$        �exit(1, "unknown user")
J	    �
T%    �("*set UUCP_UID " + �(uid%))
^�
h
r*� we store temp. files in the scrapdir
|'� �objtype("<Wimp$ScrapDir>") = 0 �
�9    �exit(1, "!Scrap must be seen for this to work!")
��
�
�7� no fixed upper limit, let memory be the factor...
�tomax%=(�-�-1000)�40
��to$(tomax%)
�
�!� now extract to/from info...
�� u$ <> "" �
�5    from$=u$ + "@" + �getenv("NewsBase$MailName")
��
�    from$=""
��
�to$="":count%=0
�3C1%=�(N$):�C1%=0 �exit(1, "Couldn't open file")
�
  A$=�#C1%
H  � u$="" � �A$,6)="From: " � temp$=�A$,7):from$=�getaddress(temp$)
&5  �A$,4)="To: "��A$,4)="Cc: "  ��A$,5)="Bcc: " �
0    to$=�A$,5):�
:.    to$(count%)=�getaddress(to$):count%+=1
D    �to$=""�count%=tomax%
N  �
X�A$=""��#C1%
b	�#C1%
l
v>� we copy the file to a temporary batch, prefixing it with
�@� the "From " line, which sendmail does not do, and removing
�� Bcc: lines if present.
�4batchname$ = "<Wimp$ScrapDir>." + �"DM" + Ñ, 8)
�mail% = �(N$)
�batch% = �(batchname$)
�@� the following line is just a temporary hack until sendmail
�%� does generate the "From " line.
�'�#batch%, "From " + �fromstr(from$)
�ȕ � �#mail%
�    c$ = �#mail%
�*    � �c$,5) <> "Bcc: " � �#batch%, c$
��
�
� #batch%
� #mail%

<� now call the DoMail obey script on the generated batch
 9� and all of the recipients to do the actual sending.
*?OS$ = "<NewsBase$Dir>.transports.Taylor.DoMail "+batchname$
4� i% = 0 � count% - 1
>  OS$ = OS$ + " " + to$(i%)
H�
R
\@� The DoMail script does not return, thus we remove the file
fB� in N$ here, and let the script remove the file in batchname$
p�("remove " + N$)
z
�(OS$)
�
�#� in case we get here anyway...
��exit(1, "Mail failed")
��
�
���exit(n%,a$)
�%�("set NewsBase$ReturnCode "+�n%)
�$�("set NewsBase$ReturnInfo "+a$)
��
��
�
�ݤgetaddress(� A$)
�&�B$,C$,at%,end%:B$="":at%=0:end%=0
l%=0:ȕl%<�A$�end%=0
  l%+=1:C$=�A$,l%,1)
  ȎC$�
$(    �" ",",",�9:�B$>""�at%<>0�end%=1
.     �"(":�l%+=1:C$=�A$,l%,1)
8      �C$="\"�l%+=1
B      �C$=")"�l%>�A$
L    �"\":l%+=1
V
    �"<":
`#      B$="":�l%+=1:C$=�A$,l%,1)
j'      �C$="\"�l%+=1:��C$<>">"B$+=C$
t      �C$=">"�l%>�A$
~
    �"@":
�      �at%>0��B$,at%,1)="%"
�      B$+=C$:at%=�B$
�!    �"""":�l%+=1:C$=�A$,l%,1)
�(      �C$="\"�l%+=1:��C$<>""""B$+=C$
�      �C$=""""�l%>�A$
�    :B$+=C$
�  �
��
�A$=�A$,l%+1)
�=B$
�
�<� this generates an entry for the "From " header line by
<� taking the From: line, reading the adress from it, and

4� building a string of the form host.domain!user
?� THIS IS ONLY SUITABLE FOR MAIL ORIGINATING AT THIS SYSTEM
ݤfromstr(from$)
(
� pos%,R$
2pos%=�from$,"@")
<� pos%>1 �
F/  R$=�from$, pos%+1) + "!" + �from$,pos%-1)
P�
Z%  �exit(1,"Invalid From: adress")
d�
n=R$
x
�ݤobjtype(f$)
��F%
�ș"XOS_File",17,f$�t%;F%
��(F%�1)�=-1:�=t%
�
00000000  0d 00 0a 0f f4 20 3e 73  65 6e 64 6d 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 41 f4 20 63 6f 6e  76 65 72 74 65 64 20 66  |..A. converted f|
00000060  72 6f 6d 20 6b 61 39 71  2e 73 65 6e 64 6d 61 69  |rom ka9q.sendmai|
00000070  6c 2e 20 54 68 69 73 20  76 65 72 73 69 6f 6e 20  |l. This version |
00000080  70 72 6f 70 65 72 6c 79  20 68 61 6e 64 6c 65 73  |properly handles|
00000090  0d 00 28 0a f4 20 42 63  63 21 0d 00 32 05 f4 0d  |..(.. Bcc!..2...|
000000a0  00 3c 21 f4 20 41 75 74  68 6f 72 3a 20 20 20 20  |.<!. Author:    |
000000b0  20 20 20 20 20 47 75 6e  6e 61 72 20 5a f6 74 6c  |     Gunnar Z.tl|
000000c0  0d 00 46 21 f4 20 44 61  74 65 3a 20 20 20 20 20  |..F!. Date:     |
000000d0  20 20 20 20 20 20 31 34  2d 53 65 70 2d 31 39 39  |      14-Sep-199|
000000e0  34 0d 00 50 21 f4 20 4c  61 73 74 20 6d 6f 64 69  |4..P!. Last modi|
000000f0  66 69 65 64 3a 20 20 31  30 2d 4e 6f 76 2d 31 39  |fied:  10-Nov-19|
00000100  39 34 0d 00 5a 04 0d 00  64 19 ee 85 20 f6 3a f1  |94..Z...d... .:.|
00000110  22 20 61 74 20 6c 69 6e  65 20 22 3b 9e 3a e0 0d  |" at line ";.:..|
00000120  00 6e 04 0d 00 78 27 c8  9b 20 22 3c 4e 65 77 73  |.n...x'.. "<News|
00000130  42 61 73 65 24 54 61 79  6c 6f 72 44 69 72 3e 2e  |Base$TaylorDir>.|
00000140  53 63 72 69 70 74 4c 69  62 22 0d 00 82 04 0d 00  |ScriptLib"......|
00000150  8c 26 f4 20 67 65 74 20  74 68 65 20 63 6f 6d 6d  |.&. get the comm|
00000160  61 6e 64 20 6c 69 6e 65  20 70 61 72 61 6d 65 74  |and line paramet|
00000170  65 72 73 2e 0d 00 96 0a  f2 65 6e 74 72 79 0d 00  |ers......entry..|
00000180  a0 0f 4e 24 3d 22 22 3a  75 24 3d 22 22 0d 00 aa  |..N$="":u$=""...|
00000190  1f e7 20 28 61 72 67 63  20 3d 20 33 29 20 84 20  |.. (argc = 3) . |
000001a0  28 61 72 67 63 20 3d 20  35 29 20 8c 0d 00 b4 19  |(argc = 5) .....|
000001b0  20 20 20 20 e3 20 69 25  3d 31 20 b8 20 61 72 67  |    . i%=1 . arg|
000001c0  63 20 2d 20 31 0d 00 be  1a 20 20 20 20 20 20 20  |c - 1....       |
000001d0  20 c8 8e 20 61 72 67 76  24 28 69 25 29 20 ca 0d  | .. argv$(i%) ..|
000001e0  00 c8 33 20 20 20 20 20  20 20 20 20 20 20 20 c9  |..3            .|
000001f0  20 22 2d 66 22 3a 20 4e  24 20 3d 20 61 72 67 76  | "-f": N$ = argv|
00000200  24 28 69 25 20 2b 20 31  29 3a 20 69 25 20 2b 3d  |$(i% + 1): i% +=|
00000210  20 31 0d 00 d2 33 20 20  20 20 20 20 20 20 20 20  | 1...3          |
00000220  20 20 c9 20 22 2d 75 22  3a 20 75 24 20 3d 20 61  |  . "-u": u$ = a|
00000230  72 67 76 24 28 69 25 20  2b 20 31 29 3a 20 69 25  |rgv$(i% + 1): i%|
00000240  20 2b 3d 20 31 0d 00 dc  2f 20 20 20 20 20 20 20  | += 1.../       |
00000250  20 20 20 20 20 7f 20 f2  65 78 69 74 28 31 2c 20  |     . .exit(1, |
00000260  22 49 6e 76 61 6c 69 64  20 50 61 72 61 6d 65 74  |"Invalid Paramet|
00000270  65 72 22 29 0d 00 e6 0d  20 20 20 20 20 20 20 20  |er")....        |
00000280  cb 0d 00 f0 0c 20 20 20  20 ed 20 69 25 0d 00 fa  |.....    . i%...|
00000290  05 cc 0d 01 04 26 20 20  20 20 f2 65 78 69 74 28  |.....&    .exit(|
000002a0  31 2c 20 22 49 6e 76 61  6c 69 64 20 50 61 72 61  |1, "Invalid Para|
000002b0  6d 65 74 65 72 73 22 29  0d 01 0e 05 cd 0d 01 18  |meters")........|
000002c0  04 0d 01 22 0b e7 75 24  3e 22 22 8c 0d 01 2c 1d  |..."..u$>""...,.|
000002d0  20 20 20 20 75 69 64 25  20 3d 20 a4 67 65 74 75  |    uid% = .getu|
000002e0  69 64 28 75 73 65 72 24  29 0d 01 36 15 20 20 20  |id(user$)..6.   |
000002f0  20 e7 20 75 69 64 25 20  3d 20 2d 31 20 8c 0d 01  | . uid% = -1 ...|
00000300  40 24 20 20 20 20 20 20  20 20 f2 65 78 69 74 28  |@$        .exit(|
00000310  31 2c 20 22 75 6e 6b 6e  6f 77 6e 20 75 73 65 72  |1, "unknown user|
00000320  22 29 0d 01 4a 09 20 20  20 20 cd 0d 01 54 25 20  |")..J.    ...T% |
00000330  20 20 20 ff 28 22 2a 73  65 74 20 55 55 43 50 5f  |   .("*set UUCP_|
00000340  55 49 44 20 22 20 2b 20  c3 28 75 69 64 25 29 29  |UID " + .(uid%))|
00000350  0d 01 5e 05 cd 0d 01 68  04 0d 01 72 2a f4 20 77  |..^....h...r*. w|
00000360  65 20 73 74 6f 72 65 20  74 65 6d 70 2e 20 66 69  |e store temp. fi|
00000370  6c 65 73 20 69 6e 20 74  68 65 20 73 63 72 61 70  |les in the scrap|
00000380  64 69 72 0d 01 7c 27 e7  20 a4 6f 62 6a 74 79 70  |dir..|'. .objtyp|
00000390  65 28 22 3c 57 69 6d 70  24 53 63 72 61 70 44 69  |e("<Wimp$ScrapDi|
000003a0  72 3e 22 29 20 3d 20 30  20 8c 0d 01 86 39 20 20  |r>") = 0 ....9  |
000003b0  20 20 f2 65 78 69 74 28  31 2c 20 22 21 53 63 72  |  .exit(1, "!Scr|
000003c0  61 70 20 6d 75 73 74 20  62 65 20 73 65 65 6e 20  |ap must be seen |
000003d0  66 6f 72 20 74 68 69 73  20 74 6f 20 77 6f 72 6b  |for this to work|
000003e0  21 22 29 0d 01 90 05 cd  0d 01 9a 04 0d 01 a4 37  |!")............7|
000003f0  f4 20 6e 6f 20 66 69 78  65 64 20 75 70 70 65 72  |. no fixed upper|
00000400  20 6c 69 6d 69 74 2c 20  6c 65 74 20 6d 65 6d 6f  | limit, let memo|
00000410  72 79 20 62 65 20 74 68  65 20 66 61 63 74 6f 72  |ry be the factor|
00000420  2e 2e 2e 0d 01 ae 18 74  6f 6d 61 78 25 3d 28 93  |.......tomax%=(.|
00000430  2d e0 2d 31 30 30 30 29  81 34 30 0d 01 b8 10 de  |-.-1000).40.....|
00000440  74 6f 24 28 74 6f 6d 61  78 25 29 0d 01 c2 04 0d  |to$(tomax%).....|
00000450  01 cc 21 f4 20 6e 6f 77  20 65 78 74 72 61 63 74  |..!. now extract|
00000460  20 74 6f 2f 66 72 6f 6d  20 69 6e 66 6f 2e 2e 2e  | to/from info...|
00000470  0d 01 d6 10 e7 20 75 24  20 3c 3e 20 22 22 20 8c  |..... u$ <> "" .|
00000480  0d 01 e0 35 20 20 20 20  66 72 6f 6d 24 3d 75 24  |...5    from$=u$|
00000490  20 2b 20 22 40 22 20 2b  20 a4 67 65 74 65 6e 76  | + "@" + .getenv|
000004a0  28 22 4e 65 77 73 42 61  73 65 24 4d 61 69 6c 4e  |("NewsBase$MailN|
000004b0  61 6d 65 22 29 0d 01 ea  05 cc 0d 01 eb 10 20 20  |ame").........  |
000004c0  20 20 66 72 6f 6d 24 3d  22 22 0d 01 ec 05 cd 0d  |  from$=""......|
000004d0  01 ed 13 74 6f 24 3d 22  22 3a 63 6f 75 6e 74 25  |...to$="":count%|
000004e0  3d 30 0d 01 fe 33 43 31  25 3d 8e 28 4e 24 29 3a  |=0...3C1%=.(N$):|
000004f0  e7 43 31 25 3d 30 20 f2  65 78 69 74 28 31 2c 20  |.C1%=0 .exit(1, |
00000500  22 43 6f 75 6c 64 6e 27  74 20 6f 70 65 6e 20 66  |"Couldn't open f|
00000510  69 6c 65 22 29 0d 02 08  05 f5 0d 02 12 0e 20 20  |ile").........  |
00000520  41 24 3d be 23 43 31 25  0d 02 1c 48 20 20 e7 20  |A$=.#C1%...H  . |
00000530  75 24 3d 22 22 20 8c 20  e7 c0 41 24 2c 36 29 3d  |u$="" . ..A$,6)=|
00000540  22 46 72 6f 6d 3a 20 22  20 8c 20 74 65 6d 70 24  |"From: " . temp$|
00000550  3d c1 41 24 2c 37 29 3a  66 72 6f 6d 24 3d a4 67  |=.A$,7):from$=.g|
00000560  65 74 61 64 64 72 65 73  73 28 74 65 6d 70 24 29  |etaddress(temp$)|
00000570  0d 02 26 35 20 20 e7 c0  41 24 2c 34 29 3d 22 54  |..&5  ..A$,4)="T|
00000580  6f 3a 20 22 84 c0 41 24  2c 34 29 3d 22 43 63 3a  |o: "..A$,4)="Cc:|
00000590  20 22 20 20 84 c0 41 24  2c 35 29 3d 22 42 63 63  | "  ..A$,5)="Bcc|
000005a0  3a 20 22 20 8c 0d 02 30  14 20 20 20 20 74 6f 24  |: " ...0.    to$|
000005b0  3d c1 41 24 2c 35 29 3a  f5 0d 02 3a 2e 20 20 20  |=.A$,5):...:.   |
000005c0  20 74 6f 24 28 63 6f 75  6e 74 25 29 3d a4 67 65  | to$(count%)=.ge|
000005d0  74 61 64 64 72 65 73 73  28 74 6f 24 29 3a 63 6f  |taddress(to$):co|
000005e0  75 6e 74 25 2b 3d 31 0d  02 44 1d 20 20 20 20 fd  |unt%+=1..D.    .|
000005f0  74 6f 24 3d 22 22 84 63  6f 75 6e 74 25 3d 74 6f  |to$="".count%=to|
00000600  6d 61 78 25 0d 02 4e 07  20 20 cd 0d 02 58 10 fd  |max%..N.  ...X..|
00000610  41 24 3d 22 22 84 c5 23  43 31 25 0d 02 62 09 d9  |A$=""..#C1%..b..|
00000620  23 43 31 25 0d 02 6c 04  0d 02 76 3e f4 20 77 65  |#C1%..l...v>. we|
00000630  20 63 6f 70 79 20 74 68  65 20 66 69 6c 65 20 74  | copy the file t|
00000640  6f 20 61 20 74 65 6d 70  6f 72 61 72 79 20 62 61  |o a temporary ba|
00000650  74 63 68 2c 20 70 72 65  66 69 78 69 6e 67 20 69  |tch, prefixing i|
00000660  74 20 77 69 74 68 0d 02  80 40 f4 20 74 68 65 20  |t with...@. the |
00000670  22 46 72 6f 6d 20 22 20  6c 69 6e 65 2c 20 77 68  |"From " line, wh|
00000680  69 63 68 20 73 65 6e 64  6d 61 69 6c 20 64 6f 65  |ich sendmail doe|
00000690  73 20 6e 6f 74 20 64 6f  2c 20 61 6e 64 20 72 65  |s not do, and re|
000006a0  6d 6f 76 69 6e 67 0d 02  8a 1c f4 20 42 63 63 3a  |moving..... Bcc:|
000006b0  20 6c 69 6e 65 73 20 69  66 20 70 72 65 73 65 6e  | lines if presen|
000006c0  74 2e 0d 02 94 34 62 61  74 63 68 6e 61 6d 65 24  |t....4batchname$|
000006d0  20 3d 20 22 3c 57 69 6d  70 24 53 63 72 61 70 44  | = "<Wimp$ScrapD|
000006e0  69 72 3e 2e 22 20 2b 20  c0 22 44 4d 22 20 2b 20  |ir>." + ."DM" + |
000006f0  c3 91 2c 20 38 29 0d 02  9e 11 6d 61 69 6c 25 20  |.., 8)....mail% |
00000700  3d 20 8e 28 4e 24 29 0d  02 a8 1a 62 61 74 63 68  |= .(N$)....batch|
00000710  25 20 3d 20 ae 28 62 61  74 63 68 6e 61 6d 65 24  |% = .(batchname$|
00000720  29 0d 02 b2 40 f4 20 74  68 65 20 66 6f 6c 6c 6f  |)...@. the follo|
00000730  77 69 6e 67 20 6c 69 6e  65 20 69 73 20 6a 75 73  |wing line is jus|
00000740  74 20 61 20 74 65 6d 70  6f 72 61 72 79 20 68 61  |t a temporary ha|
00000750  63 6b 20 75 6e 74 69 6c  20 73 65 6e 64 6d 61 69  |ck until sendmai|
00000760  6c 0d 02 bc 25 f4 20 64  6f 65 73 20 67 65 6e 65  |l...%. does gene|
00000770  72 61 74 65 20 74 68 65  20 22 46 72 6f 6d 20 22  |rate the "From "|
00000780  20 6c 69 6e 65 2e 0d 02  c6 27 d5 23 62 61 74 63  | line....'.#batc|
00000790  68 25 2c 20 22 46 72 6f  6d 20 22 20 2b 20 a4 66  |h%, "From " + .f|
000007a0  72 6f 6d 73 74 72 28 66  72 6f 6d 24 29 0d 02 d0  |romstr(from$)...|
000007b0  10 c8 95 20 ac 20 c5 23  6d 61 69 6c 25 0d 02 da  |... . .#mail%...|
000007c0  14 20 20 20 20 63 24 20  3d 20 be 23 6d 61 69 6c  |.    c$ = .#mail|
000007d0  25 0d 02 e4 2a 20 20 20  20 e7 20 c0 63 24 2c 35  |%...*    . .c$,5|
000007e0  29 20 3c 3e 20 22 42 63  63 3a 20 22 20 8c 20 d5  |) <> "Bcc: " . .|
000007f0  23 62 61 74 63 68 25 2c  20 63 24 0d 02 ee 05 ce  |#batch%, c$.....|
00000800  0d 02 f8 0d d9 20 23 62  61 74 63 68 25 0d 03 02  |..... #batch%...|
00000810  0c d9 20 23 6d 61 69 6c  25 0d 03 0c 04 0d 03 16  |.. #mail%.......|
00000820  3c f4 20 6e 6f 77 20 63  61 6c 6c 20 74 68 65 20  |<. now call the |
00000830  44 6f 4d 61 69 6c 20 6f  62 65 79 20 73 63 72 69  |DoMail obey scri|
00000840  70 74 20 6f 6e 20 74 68  65 20 67 65 6e 65 72 61  |pt on the genera|
00000850  74 65 64 20 62 61 74 63  68 0d 03 20 39 f4 20 61  |ted batch.. 9. a|
00000860  6e 64 20 61 6c 6c 20 6f  66 20 74 68 65 20 72 65  |nd all of the re|
00000870  63 69 70 69 65 6e 74 73  20 74 6f 20 64 6f 20 74  |cipients to do t|
00000880  68 65 20 61 63 74 75 61  6c 20 73 65 6e 64 69 6e  |he actual sendin|
00000890  67 2e 0d 03 2a 3f 4f 53  24 20 3d 20 22 3c 4e 65  |g...*?OS$ = "<Ne|
000008a0  77 73 42 61 73 65 24 44  69 72 3e 2e 74 72 61 6e  |wsBase$Dir>.tran|
000008b0  73 70 6f 72 74 73 2e 54  61 79 6c 6f 72 2e 44 6f  |sports.Taylor.Do|
000008c0  4d 61 69 6c 20 22 2b 62  61 74 63 68 6e 61 6d 65  |Mail "+batchname|
000008d0  24 0d 03 34 19 e3 20 69  25 20 3d 20 30 20 b8 20  |$..4.. i% = 0 . |
000008e0  63 6f 75 6e 74 25 20 2d  20 31 0d 03 3e 1f 20 20  |count% - 1..>.  |
000008f0  4f 53 24 20 3d 20 4f 53  24 20 2b 20 22 20 22 20  |OS$ = OS$ + " " |
00000900  2b 20 74 6f 24 28 69 25  29 0d 03 48 05 ed 0d 03  |+ to$(i%)..H....|
00000910  52 04 0d 03 5c 40 f4 20  54 68 65 20 44 6f 4d 61  |R...\@. The DoMa|
00000920  69 6c 20 73 63 72 69 70  74 20 64 6f 65 73 20 6e  |il script does n|
00000930  6f 74 20 72 65 74 75 72  6e 2c 20 74 68 75 73 20  |ot return, thus |
00000940  77 65 20 72 65 6d 6f 76  65 20 74 68 65 20 66 69  |we remove the fi|
00000950  6c 65 0d 03 66 42 f4 20  69 6e 20 4e 24 20 68 65  |le..fB. in N$ he|
00000960  72 65 2c 20 61 6e 64 20  6c 65 74 20 74 68 65 20  |re, and let the |
00000970  73 63 72 69 70 74 20 72  65 6d 6f 76 65 20 74 68  |script remove th|
00000980  65 20 66 69 6c 65 20 69  6e 20 62 61 74 63 68 6e  |e file in batchn|
00000990  61 6d 65 24 0d 03 70 15  ff 28 22 72 65 6d 6f 76  |ame$..p..("remov|
000009a0  65 20 22 20 2b 20 4e 24  29 0d 03 7a 0a ff 28 4f  |e " + N$)..z..(O|
000009b0  53 24 29 0d 03 84 04 0d  03 8e 23 f4 20 69 6e 20  |S$).......#. in |
000009c0  63 61 73 65 20 77 65 20  67 65 74 20 68 65 72 65  |case we get here|
000009d0  20 61 6e 79 77 61 79 2e  2e 2e 0d 03 98 1b f2 65  | anyway........e|
000009e0  78 69 74 28 31 2c 20 22  4d 61 69 6c 20 66 61 69  |xit(1, "Mail fai|
000009f0  6c 65 64 22 29 0d 03 a2  05 e0 0d 03 ac 04 0d 03  |led")...........|
00000a00  b6 11 dd f2 65 78 69 74  28 6e 25 2c 61 24 29 0d  |....exit(n%,a$).|
00000a10  03 c0 25 ff 28 22 73 65  74 20 4e 65 77 73 42 61  |..%.("set NewsBa|
00000a20  73 65 24 52 65 74 75 72  6e 43 6f 64 65 20 22 2b  |se$ReturnCode "+|
00000a30  c3 6e 25 29 0d 03 ca 24  ff 28 22 73 65 74 20 4e  |.n%)...$.("set N|
00000a40  65 77 73 42 61 73 65 24  52 65 74 75 72 6e 49 6e  |ewsBase$ReturnIn|
00000a50  66 6f 20 22 2b 61 24 29  0d 03 d4 05 e0 0d 03 de  |fo "+a$)........|
00000a60  05 e1 0d 03 e8 04 0d 03  f2 16 dd a4 67 65 74 61  |............geta|
00000a70  64 64 72 65 73 73 28 f8  20 41 24 29 0d 03 fc 26  |ddress(. A$)...&|
00000a80  ea 42 24 2c 43 24 2c 61  74 25 2c 65 6e 64 25 3a  |.B$,C$,at%,end%:|
00000a90  42 24 3d 22 22 3a 61 74  25 3d 30 3a 65 6e 64 25  |B$="":at%=0:end%|
00000aa0  3d 30 0d 04 06 18 6c 25  3d 30 3a c8 95 6c 25 3c  |=0....l%=0:..l%<|
00000ab0  a9 41 24 80 65 6e 64 25  3d 30 0d 04 10 18 20 20  |.A$.end%=0....  |
00000ac0  6c 25 2b 3d 31 3a 43 24  3d c1 41 24 2c 6c 25 2c  |l%+=1:C$=.A$,l%,|
00000ad0  31 29 0d 04 1a 0b 20 20  c8 8e 43 24 ca 0d 04 24  |1)....  ..C$...$|
00000ae0  28 20 20 20 20 c9 22 20  22 2c 22 2c 22 2c bd 39  |(    ." ",",",.9|
00000af0  3a e7 42 24 3e 22 22 80  61 74 25 3c 3e 30 8c 65  |:.B$>"".at%<>0.e|
00000b00  6e 64 25 3d 31 0d 04 2e  20 20 20 20 20 c9 22 28  |nd%=1...     ."(|
00000b10  22 3a f5 6c 25 2b 3d 31  3a 43 24 3d c1 41 24 2c  |":.l%+=1:C$=.A$,|
00000b20  6c 25 2c 31 29 0d 04 38  17 20 20 20 20 20 20 e7  |l%,1)..8.      .|
00000b30  43 24 3d 22 5c 22 8c 6c  25 2b 3d 31 0d 04 42 18  |C$="\".l%+=1..B.|
00000b40  20 20 20 20 20 20 fd 43  24 3d 22 29 22 84 6c 25  |      .C$=")".l%|
00000b50  3e a9 41 24 0d 04 4c 12  20 20 20 20 c9 22 5c 22  |>.A$..L.    ."\"|
00000b60  3a 6c 25 2b 3d 31 0d 04  56 0d 20 20 20 20 c9 22  |:l%+=1..V.    ."|
00000b70  3c 22 3a 0d 04 60 23 20  20 20 20 20 20 42 24 3d  |<":..`#      B$=|
00000b80  22 22 3a f5 6c 25 2b 3d  31 3a 43 24 3d c1 41 24  |"":.l%+=1:C$=.A$|
00000b90  2c 6c 25 2c 31 29 0d 04  6a 27 20 20 20 20 20 20  |,l%,1)..j'      |
00000ba0  e7 43 24 3d 22 5c 22 8c  6c 25 2b 3d 31 3a 8b e7  |.C$="\".l%+=1:..|
00000bb0  43 24 3c 3e 22 3e 22 42  24 2b 3d 43 24 0d 04 74  |C$<>">"B$+=C$..t|
00000bc0  18 20 20 20 20 20 20 fd  43 24 3d 22 3e 22 84 6c  |.      .C$=">".l|
00000bd0  25 3e a9 41 24 0d 04 7e  0d 20 20 20 20 c9 22 40  |%>.A$..~.    ."@|
00000be0  22 3a 0d 04 88 1f 20 20  20 20 20 20 e7 61 74 25  |":....      .at%|
00000bf0  3e 30 8c c1 42 24 2c 61  74 25 2c 31 29 3d 22 25  |>0..B$,at%,1)="%|
00000c00  22 0d 04 92 18 20 20 20  20 20 20 42 24 2b 3d 43  |"....      B$+=C|
00000c10  24 3a 61 74 25 3d a9 42  24 0d 04 9c 21 20 20 20  |$:at%=.B$...!   |
00000c20  20 c9 22 22 22 22 3a f5  6c 25 2b 3d 31 3a 43 24  | ."""":.l%+=1:C$|
00000c30  3d c1 41 24 2c 6c 25 2c  31 29 0d 04 a6 28 20 20  |=.A$,l%,1)...(  |
00000c40  20 20 20 20 e7 43 24 3d  22 5c 22 8c 6c 25 2b 3d  |    .C$="\".l%+=|
00000c50  31 3a 8b e7 43 24 3c 3e  22 22 22 22 42 24 2b 3d  |1:..C$<>""""B$+=|
00000c60  43 24 0d 04 b0 19 20 20  20 20 20 20 fd 43 24 3d  |C$....      .C$=|
00000c70  22 22 22 22 84 6c 25 3e  a9 41 24 0d 04 ba 10 20  |"""".l%>.A$.... |
00000c80  20 20 20 7f 3a 42 24 2b  3d 43 24 0d 04 c4 07 20  |   .:B$+=C$.... |
00000c90  20 cb 0d 04 ce 05 ce 0d  04 d8 10 41 24 3d c1 41  | ..........A$=.A|
00000ca0  24 2c 6c 25 2b 31 29 0d  04 e2 07 3d 42 24 0d 04  |$,l%+1)....=B$..|
00000cb0  ec 04 0d 04 f6 3c f4 20  74 68 69 73 20 67 65 6e  |.....<. this gen|
00000cc0  65 72 61 74 65 73 20 61  6e 20 65 6e 74 72 79 20  |erates an entry |
00000cd0  66 6f 72 20 74 68 65 20  22 46 72 6f 6d 20 22 20  |for the "From " |
00000ce0  68 65 61 64 65 72 20 6c  69 6e 65 20 62 79 0d 05  |header line by..|
00000cf0  00 3c f4 20 74 61 6b 69  6e 67 20 74 68 65 20 46  |.<. taking the F|
00000d00  72 6f 6d 3a 20 6c 69 6e  65 2c 20 72 65 61 64 69  |rom: line, readi|
00000d10  6e 67 20 74 68 65 20 61  64 72 65 73 73 20 66 72  |ng the adress fr|
00000d20  6f 6d 20 69 74 2c 20 61  6e 64 0d 05 0a 34 f4 20  |om it, and...4. |
00000d30  62 75 69 6c 64 69 6e 67  20 61 20 73 74 72 69 6e  |building a strin|
00000d40  67 20 6f 66 20 74 68 65  20 66 6f 72 6d 20 68 6f  |g of the form ho|
00000d50  73 74 2e 64 6f 6d 61 69  6e 21 75 73 65 72 0d 05  |st.domain!user..|
00000d60  14 3f f4 20 54 48 49 53  20 49 53 20 4f 4e 4c 59  |.?. THIS IS ONLY|
00000d70  20 53 55 49 54 41 42 4c  45 20 46 4f 52 20 4d 41  | SUITABLE FOR MA|
00000d80  49 4c 20 4f 52 49 47 49  4e 41 54 49 4e 47 20 41  |IL ORIGINATING A|
00000d90  54 20 54 48 49 53 20 53  59 53 54 45 4d 0d 05 1e  |T THIS SYSTEM...|
00000da0  14 dd a4 66 72 6f 6d 73  74 72 28 66 72 6f 6d 24  |...fromstr(from$|
00000db0  29 0d 05 28 0d ea 20 70  6f 73 25 2c 52 24 0d 05  |)..(.. pos%,R$..|
00000dc0  32 14 70 6f 73 25 3d a7  66 72 6f 6d 24 2c 22 40  |2.pos%=.from$,"@|
00000dd0  22 29 0d 05 3c 0e e7 20  70 6f 73 25 3e 31 20 8c  |")..<.. pos%>1 .|
00000de0  0d 05 46 2f 20 20 52 24  3d c1 66 72 6f 6d 24 2c  |..F/  R$=.from$,|
00000df0  20 70 6f 73 25 2b 31 29  20 2b 20 22 21 22 20 2b  | pos%+1) + "!" +|
00000e00  20 c0 66 72 6f 6d 24 2c  70 6f 73 25 2d 31 29 0d  | .from$,pos%-1).|
00000e10  05 50 05 cc 0d 05 5a 25  20 20 f2 65 78 69 74 28  |.P....Z%  .exit(|
00000e20  31 2c 22 49 6e 76 61 6c  69 64 20 46 72 6f 6d 3a  |1,"Invalid From:|
00000e30  20 61 64 72 65 73 73 22  29 0d 05 64 05 cd 0d 05  | adress")..d....|
00000e40  6e 07 3d 52 24 0d 05 78  04 0d 05 82 11 dd a4 6f  |n.=R$..x.......o|
00000e50  62 6a 74 79 70 65 28 66  24 29 0d 05 8c 07 ea 46  |bjtype(f$).....F|
00000e60  25 0d 05 96 1c c8 99 22  58 4f 53 5f 46 69 6c 65  |%......"XOS_File|
00000e70  22 2c 31 37 2c 66 24 b8  74 25 3b 46 25 0d 05 a0  |",17,f$.t%;F%...|
00000e80  14 e7 28 46 25 80 31 29  8c 3d 2d 31 3a 8b 3d 74  |..(F%.1).=-1:.=t|
00000e90  25 0d ff                                          |%..|
00000e93