-
Notifications
You must be signed in to change notification settings - Fork 0
/
EMAIL.PAS
898 lines (827 loc) · 23.7 KB
/
EMAIL.PAS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
{$I DIRECT.INC}
unit email;
interface
uses gentypes;
procedure listmail (var c : catalogrec);
procedure write_to_file;
procedure viewoutgoing;
procedure editmailuser;
procedure copymail;
procedure forwardmail;
procedure nextmail;
procedure sendmail(usernum:sstr);
procedure zippymail;
procedure readnum (n:integer);
procedure mailread(newonly : boolean);
procedure someoneelse;
procedure deleteincoming;
procedure scanall;
procedure deleterange;
procedure announcement;
procedure querydelete(var c:catalogrec);
procedure killoutgoing;
implementation
uses configrt,gensubs,subs1,subsovr,subs2,textret,flags,
mailret,userret,overret1,mainr2, mycomman, email0,
group, filelock;
procedure writenummail (var c:catalogrec; txt:mstr);
begin
SendCr(^B^M'You have '+Strr(c.nummail+c.additional)+' '+txt+
' message'+s(c.nummail));
if c.additional>0
then SendCr(' Note: Of those, '+
numthings (c.additional,'is','are')+' uncataloged.')
end;
Procedure MailHeader(M:MailRec; Num:Integer);
Begin
Sr.C[1] := '|T'; Sr.S[1] := M.Title;
Sr.C[2] := '|S'; If M.Anon Then Begin
Sr.S[2] := Cfg.AnonymousStr;
If IsSysOp
Then Sr.S[2] := Sr.S[2] + ' ('+m.sentby+')';
End
Else Sr.S[2] := M.SentBy;
Sr.C[3] := '|W'; Sr.S[3] := TimeStr(M.When);
Sr.C[4] := '|D'; Sr.S[4] := DateStr(M.When);
Sr.C[5] := '|N'; If M.Read
Then Sr.S[5] := 'Old'
Else Sr.S[5] := 'New';
Sr.C[6] := '|A'; Sr.S[6] := Strr(Incoming^.NumMail);
Sr.C[7] := '|#'; Sr.S[7] := Strr(Num);
DataFile(Cfg.TextFileDir+'MAILHDR.ANS');
End;
Procedure Readit (num:integer; var m:mailrec);
Begin
MailHeader(m,num);
If Not Break
Then PrintText ('EMAIL.TXT','EMAIL.MAP',M.Line);
If (M.Return) and (Unum=M.SentTo) then Begin
M.Return:=False;
Notice(M.Sentby,Unam+' read mail from you titled "'+m.title+'"');
End
end;
procedure readincoming (n:integer);
var m:^mailrec;
cnt:integer;
begin
m:=addr(incoming^.mail[n]);
readit (n,m^);
if not (m^.read) then begin
m^.read:=true;
seek (mfile,m^.fileindex);
nwrite (mfile,m^)
end;
for cnt:=n+1 to incoming^.nummail do
if match(incoming^.mail[cnt].sentby,m^.sentby) then begin
SendCr(^B^M'There''s more mail from '+m^.sentby+'!');
exit
end
end;
Procedure ListMail (Var C : CatalogRec);
Const Old_New : Array[False..True] Of Sstr = ('New','Old');
Var N : Integer;
U : UserRec;
Cnt : Integer;
M : MailRec;
Name : Sstr;
Begin
If Ofs(C) = Ofs(Incoming^)
Then Name := 'IN_MAIL.'
Else Name := 'OUT_MAIL.';
ListingFile(Cfg.TextFileDir + Name + 'TOP',True);
If Break
Then exit;
For Cnt := 1 To C.NumMail Do If Not Break
Then Begin
M := C.Mail[Cnt];
Sr.C[1] := 'NN'; Sr.S[1] := Strr(Cnt); Sr.T[1] := 2;
Sr.C[2] := 'TI'; Sr.S[2] := M.Title; Sr.T[2] := 30;
Sr.C[3] := 'RE'; Sr.S[3] := Old_New[M.Read]; Sr.T[3] := 3;
Sr.C[4] := 'FF';
If Match(M.SentBy,Unam)
Then Sr.S[4] := LookUpUName (M.SentTo)
Else Sr.S[4] := M.SentBy;
Sr.T[4] := 30;
ListingFile(Cfg.TextFileDir + Name + 'MID',False);
End;
ListingFile(Cfg.TextFileDir + Name + 'BOT',False);
end;
Procedure Writemail (var c:catalogrec; num:integer);
Begin
Seek (mfile,c.mail[num].fileindex);
NWrite (mfile,c.mail[num])
End;
function checklastread:boolean;
begin
if (lastread<0) or (lastread>incoming^.nummail) then lastread:=0;
checklastread:=lastread=0
end;
function getmsgnumber (var c:catalogrec; txt:sstr):integer;
var n:integer;
inc:boolean;
begin
inc:=ofs(c)=ofs(incoming^);
getmsgnumber:=0;
if c.nummail=0 then begin
if c.additional>0 then readcatalogs(true);
if c.nummail=0 then SendCr(^M'Sorry, no mail!');
if inc then lastread:=0;
exit
end;
inpt:=copy(inpt,2,255);
if length(inpt)=0
then if inc
then n:=lastread
else n:=0
else n:=valu(inpt);
if (n<1) or (n>c.nummail) then begin
repeat
writestr (^M^R'E-Mail # to '+txt+' ('^S'?/List'^R'): &');
if length(inpt)=0 then exit;
if inpt='?' then listmail (c)
until inpt<>'?';
n:=valu(inpt);
if (n<1) or (n>c.nummail) then n:=0
end;
getmsgnumber:=n
end;
procedure deletemail (var c:catalogrec; n:integer);
begin
delmail (c.mail[n].fileindex);
SendCr(^A+c.mail[n].title+^R' by '^A+c.mail[n].sentby+^R' has been deleted!');
readcatalogs(true);
end;
Procedure QueryDelete(var c:catalogrec);
var x:byte;
Begin
if c.nummail < 1
then exit;
For X := C.NumMail DownTo 1 do begin
if C.Mail[X].Read
Then Begin
Sr.C[1] := 'TI'; Sr.S[1] := C.Mail[x].Title;
Sr.C[2] := 'SB'; Sr.S[2] := C.Mail[x].SentBy;
MultiColor(Strng^.U_Have_Read_Mail);
SendCr('');
DefYes := False;
WriteStr(Strng^.Delete_Mail_Now);
If Yes
Then DeleteMail(c,x);
end
end
end;
procedure nextmail;
begin
inc(lastread);
if lastread>incoming^.nummail
then
begin
lastread:=0;
if incoming^.nummail < 1
then SendCr(^S^M'You have no mail.') else
if incoming^.additional > 0
then SendCr(^S^M'You must delete some old mail first!')
else SendCr(^S^M'No more mail.')
end
else readincoming (lastread)
end;
procedure readnum (n:integer);
begin
if (n<1) or (n>incoming^.nummail) then begin
lastread:=0;
exit
end;
lastread:=n;
readincoming (n)
end;
procedure readmail;
begin
readnum (getmsgnumber (incoming^,'read'))
end;
Procedure ListAllMail(All : Boolean);
Begin
If Incoming^.NumMail > 0
Then Listmail (incoming^);
If Not All
Then Exit;
if outgoing^.nummail > 0
then listmail (outgoing^);
end;
procedure deleteincoming;
var n:integer;
begin
if checklastread then begin
n:=getmsgnumber (incoming^,'delete');
if n=0 then exit;
lastread:=n
end;
deletemail (incoming^,lastread);
lastread:=lastread-1
end;
procedure killoutgoing;
var n:integer;
begin
n:=getmsgnumber (outgoing^,'kill');
if n<>0 then deletemail (outgoing^,n)
end;
procedure autoreply;
var n:integer;
begin
if checklastread then begin
n:=getmsgnumber (incoming^,'reply to');
if n=0 then exit;
lastread:=n
end;
With Incoming^.Mail[lastread] Do Begin
Quoting.AllowQuote := True;
Quoting.MsgNum := Line;
Quoting.MsgSec := False;
Quoting.Anon := Anon;
Quoting.From := SentBy;
Quoting.SendTo:=LookUpUName(SentTo);
Quoting.Title:= Title;
Quoting.When := When;
Quoting.TxtFile := 'EMAIL.TXT';
Quoting.MailFile := 'EMAIL.MAP';
sendmailto (sentby,title,anon,true);
end;
Quoting.AllowQuote := False;
readcatalogs(true);
end;
procedure write_to_file;
begin
SendCr(^S^R^M);
if not issysop then begin
SendCr('That command requires SysOp Access.');
exit;
end;
if (lastread < 1) or (lastread > incoming^.nummail)
then exit;
with incoming^.mail[LastRead] do
TextToFile('EMAIL.TXT','EMAIL.MAP',Line,Title,SentBy,
LookUpUName(SentTo));
end;
procedure viewoutgoing;
var n:integer;
begin
n:=getmsgnumber (outgoing^,'view');
if n=0 then exit;
readit (n,outgoing^.mail[n])
end;
procedure showinfos;
var a,n:integer;
begin
If (IsSysop=False) Then Begin
SendFull('You don''t have enough access to do that!');
Exit;
End;
if checklastread then begin
n:=getmsgnumber (incoming^,'delete');
if n=0 then exit;
lastread:=n
end;
For a:=1 to 5 do showinfoforms (incoming^.mail[lastread].sentby,a)
end;
procedure editmailuser;
var n:integer;
m:mstr;
begin
If (IsSysop=False) then Begin
SendFull(^G^G^G'Bad User...');
Exit;
End;
if checklastread then begin
n:=getmsgnumber (incoming^,'edit the sender');
if n=0 then exit;
lastread:=n
end;
m:=incoming^.mail[lastread].sentby;
n:=lookupuser (m);
if n=0 then begin
SendCr(^B^R'User '+m+' not found!');
exit
end;
edituser (n)
end;
Procedure WriteCurMsg;
Var B : Boolean;
Begin
B := CheckLastRead;
If LastRead = 0 Then Begin
MultiColor(Strng^.Current_Mail_None);
SendCr('');
Exit;
End;
With Incoming^.Mail[LastRead] Do Begin
Sr.C[1] := 'TI'; Sr.S[1] := Title;
Sr.C[2] := 'AU'; Sr.S[2] := SentBy;
Sr.C[3] := 'NU'; Sr.S[3] := Strr(LastRead);
End;
MultiColor(Strng^.List_Current_Mail);
SendCr('')
End;
procedure showannouncement (un:integer);
var u:userrec;
begin
seek (ufile,un);
nread (ufile,u);
if u.emailannounce>-1 then begin
writehdr (u.handle+'''s Announcement');
printtext ('ANNOUNCE.TXT','ANNOUNCE.MAP',u.emailannounce)
end
end;
procedure copymsg (var m:mailrec; un:integer);
var me:message;
line:longint;
b:boolean;
U:Userrec;
Name:Mstr;
begin
me.anon:=m.anon;
me.title:='Was from '+m.sentby;
reloadtext ('EMAIL.TXT','EMAIL.MAP',m.line,me);
showannouncement (un);
writestr (^R'Add a prologue ['^A'Y'^R']es ['^A'N'^R']o ['^A'A'^R']bort? *');
if match(inpt,'a') then exit;
if yes then b:=reedit (me,true);
line:=maketext ('EMAIL.TXT','EMAIL.MAP',me,'');
Seek(UFile,Un);
NRead(UFile,U);
Name:=U.Handle;
WriteStr('Notify you when '+Name+' reads this? !');
B:=Yes;
addmail (un,line,b,me);
readcatalogs(true);
end;
procedure copymail;
var n,un,line:integer;
begin
if checklastread then begin
n:=getmsgnumber (incoming^,'copy');
if n=0 then exit;
lastread:=n
end;
n:=lastread;
writestr (^R'User to copy it to'^A': &');
if length(inpt)=0 then exit;
un:=lookupuser (inpt);
if un=0 then exit;
copymsg (incoming^.mail[n],un)
end;
procedure forwardmail;
var n,un:integer;
begin
if checklastread then begin
N:=getmsgnumber (incoming^,'forward');
if n = 0 then exit;
lastread:=n
end;
n:=lastread;
writestr (^R'User to forward mail to'^A': &');
if length(inpt)=0 then exit;
un:=lookupuser (inpt);
if un=0 then exit;
copymsg (incoming^.mail[n],un);
deletemail (incoming^,n)
end;
procedure sendmail(usernum:sstr);
var g:grouprec;
procedure sendit (showeach:boolean);
var un,cnt:integer;
line:longint;
me:message;
return:boolean;
procedure addit (n:integer);
begin
if n<>unum then begin
if showeach
then SendCr(^R'Sending'^A': '^S + lookupuname(n));
addmail (n,line,return,me)
end else deletetext ('EMAIL.TXT','EMAIL.MAP',line)
end;
begin
if g.nummembers < 1 then exit;
writehdr ('Sending mail to '+g.name);
okfortitle:=true;
Me.Add_AutoSig := True;
line:=editor (me,true,false,true,'0',g.name,'0','EMAIL.TXT','EMAIL.MAP');
if line < 0 then exit;
{ WriteStr('Notify you when this mail is read? !'); }
WriteStr(Strng^.Mail_Notify);
return:=yes;
addit (g.members[1]);
if g.nummembers=1 then exit;
SendCr(^B^M);
for cnt:=2 to g.nummembers do begin
un:=g.members[cnt];
if un<>unum then begin
line:=maketext ('EMAIL.TXT','EMAIL.MAP',me,'');
if line<0 then begin
SendCr(Strr(cnt)+' of '+Strr(g.nummembers)+' completed.');
exit
end;
addit (un)
end
end;
readcatalogs(true);
end;
procedure sendtogroup;
var gn:integer;
begin
gn:=getgroupnum;
if gn=0 then exit;
seekgfile (gn);
nread (gfile,g);
sendit (true)
end;
procedure sendtousers(spec:boolean);
var cnt,un:integer;
begin
g.name:=inpt;
un:=lookupuser (g.name);
if un=0 then begin
SendCr(^M'User not found.');
exit
end;
g.nummembers:=1;
g.members[1]:=un;
cnt:=1;
showannouncement (un);
if not spec then repeat
MultiColor(Strng^.Carbon_Copy_To);
InputBox(30);
if length(inpt)>0 then begin
un:=lookupuser (inpt);
if un=0
then SendCr(^M'User not found!'^M)
else if ismember (g,un)
then SendCr(^M'User is already receiving a copy!')
else begin
cnt:=cnt+1;
g.nummembers:=cnt;
g.members[cnt]:=un;
showannouncement (un)
end
end
until (length(inpt)=0) or (cnt=maxgroupsize);
sendit (g.nummembers>1)
end;
begin
{ SendFull(^P'User to send mail to '^O'['^S'+'^O']'^P'/Group Mail: '); }
If UserNum='0' then begin
MultiColor(Strng^.Send_Mail_To_Who);
InputBox(30);
if length(inpt)<>0
then if inpt[1]='+'
then sendtogroup
else sendtousers(false);
end else begin
Inpt:=UserNum;
sendtousers(true);
end;
end;
procedure zippymail;
var un:integer;
me:message;
l:longint;
begin
MultiColor (Strng^.Send_Mail_To_Who);
InputBox(30);
if length(inpt)=0 then exit;
un:=lookupuser (inpt);
if un=0 then begin
SendCr('No such user!');
exit
end;
Me.Add_AutoSig := True;
l:=editor (me,false,false,false,'0',inpt,'0','EMAIL.TXT','EMAIL.MAP');
if l<0 then exit;
me.title:='-----';
me.anon:=false;
addmail (un,l,true,me);
readcatalogs(true);
end;
Procedure MailRead(NewOnly : Boolean);
Const Names : Array[1..9] Of String[10] =
(' Next ',' Kill ',' Reply ',' Again ',' Jump ',' List ',' Fwrd ',' Copy ',' Quit ');
Return : Array[1..9] Of Char = ('N','K','R','A','J','L','F','C','Q');
Var X : Byte;
Procedure GetInput;
Procedure PlaceBar(Hi:Boolean);
Const Cols : Array[1..9] Of Byte = (2,8,14,21,28,34,40,46,52);
Begin
If Hi
Then Ansicolor(Urec.Color7)
Else Ansicolor(Urec.Color3);
SendStr(#13);
SendStr(#27 + '[' + Strr(Cols[X] - 1) + 'C');
SendFull(Names[x]);
End;
Var K : Char;
Done : Boolean;
Begin
If Not BARS_OK Then Begin
SendFull(^R'('^S'Mail'^R') ');
WriteStr(^S'K'^P'ill '^S'N'^P'ext '^S'R'^P'eply '^S'A'^P'gain '+
^S+'J'^P'ump '^S'L'^P'ist '^S'F'^P'orward '^S'C'^P'opy '^S'Q'^P'uit : *');
Exit;
End;
Done := False;
NoBreak:=True;
ClearChain;
Inpt[0]:=#0;
SendFull(^B^O+Cfg.BarChar[1]+' '^P'Next Kill Reply Again Jump List Fwrd Copy Quit '^O+Cfg.BarChar[2]);
If NewOnly
Then SendFull(^R' ('^S'Scanning New Mail'^R')')
Else SendFull(^R' ('^S'Scanning All Mail'^R')');
PlaceBar(True);
Repeat
K := Upcase(ArrowKey(True));
Case K Of
^A,^D,'8','4':
Begin
Nobreak:=True;
PlaceBar(False);
Dec(x);
If X < 1
Then X := 9;
PlaceBar(True);
NoBreak := False;
End;
#32,^B,^C,'6','2':
Begin
NoBreak:=True;
PlaceBar(False);
Inc(x);
If X > 9
Then X := 1;
PlaceBar(True);
NoBreak:=False;
End;
'K','N','R','A','J','L','F','C','Q','+' :
Begin
Done:=True;
Inpt := K;
End;
#13 : Begin
Inpt := Return[X];
Done := True;
End;
End;
Until (HungUpOn) Or (Done);
SendCr(^S);
End;
Var Done : Boolean;
TotalRead : Byte;
Begin
Lastread := 0;
Done := False;
TotalRead := 0;
Repeat
Inc(LastRead);
If LastRead > Incoming^.NumMail
Then Begin
LastRead := 0;
If (NewOnly) And (TotalRead < 1)
Then SendCr(^M^S + 'No new mail found!');
Exit
End;
If (NewOnly = False) Or ( (NewOnly) And (Incoming^.Mail[LastRead].Read = False) )
Then Begin
Inc(TotalRead);
X := 1;
ReadIncoming (Lastread);
Repeat
GetInput;
If Inpt = ''
Then Inpt := 'N';
Case Upcase(Inpt[1]) Of
'R' : AutoReply;
'A' : ReadIncoming(LastRead);
'K' : Begin
SendCr(^S^R);
DeleteMail(Incoming^,LastRead);
Dec(LastRead);
Inpt := 'N';
End;
'J' : Begin
SendCr(^R^S);
SendFull(^R'Mail # to Jump to ');
WriteStr('('^A'1-'+Strr(Incoming^.NumMail)+^R') : *');
If (Valu(Inpt)>0) And (Valu(Inpt) <= Incoming^.NumMail)
Then LastRead := Valu(Inpt) - 1;
Inpt := 'N';
End;
'L' : ListAllMail(False);
'F' : ForwardMail;
'C' : CopyMail;
'+' : Write_To_File;
'Q' : Done := True;
End;
If Incoming^.NumMail < 1
Then Exit;
Until (Match(Inpt,'N')) or (Done) or hungupon;
If Done
Then Exit;
End
Until hungupon;
End;
function sysopreadnum (var n:integer):boolean;
var m:mailrec;
k:char;
done:boolean;
procedure showit;
begin
MailHeader(M,n);
printtext ('EMAIL.TXT','EMAIL.MAP',m.line);
end;
procedure changen (m:integer);
var r2:integer;
begin
r2:=filesize(mfile)-1;
if (m<1) or (m>r2) then begin
writestr ('Continue scan at [1-'+strr(r2)+']: &');
m:=valu(inpt)
end;
if (m>=1) and (m<=r2) then begin
n:=m-1;
done:=true
end
end;
begin
sysopreadnum:=false;
seek (mfile,n);
nread (mfile,m);
showit;
repeat
done:=false;
WriteStr(^R'SysOp Mail Scan ('^S'?/Help'^R') : &');
If Inpt = '' Then Done := True Else
If Inpt = '?' Then Begin
SendCr('<CR> Next Mail');
SendCr('Q - Quit Scanning S - Send Mail to User');
SendCr('E - Edit User R - Edit User Sent To');
SendCr('D - Delete Mail A - Show Again');
End Else
If Valu(Inpt) > 0 Then ChangeN(Valu(Inpt))
Else Case Upcase(Inpt[1]) Of
'Q' : sysopreadnum:=true;
'S' : sendmail('0');
'E' : edituser(lookupuser(m.sentby));
'R' : edituser(m.sentto);
'D' : delmail(n);
'Q' : done:=true;
'A' : showit;
End;
until done or hungupon
end;
procedure someoneelse;
var t,last:integer;
begin
writestr (^M^R'User name to look at'^A': &');
if (length(inpt)=0) or hungupon then exit;
SendCr('');
t:=lookupuser (inpt);
if t=0 then begin
SendCr('No such user!');
exit
end;
writelog (14,1,inpt);
writehdr ('Looking in mailbox...');
last:=searchmail(0,t);
if last=0 then SendCr('No mail.');
while last<>0 do begin
seek (mfile,last);
nread (mfile,m);
if sysopreadnum (last) or hungupon then exit;
last:=searchmail(last,t)
end;
SendCr(^B^M'No more mail!')
end;
procedure scanall;
var r1,r2:integer;
u:userrec;
n:mstr;
begin
r2:=filesize(mfile)-1;
writestr (^R'Start scanning at ['^S'1-'+strr(r2)+^R']: &');
if length(inpt)=0 then r1:=1 else r1:=valu(inpt);
if (r1<1) or (r1>r2) then exit;
writelog (14,2,'');
while r1<filesize(mfile) do begin
seek (mfile,r1);
nread (mfile,m);
if m.sentto<>0 then
if sysopreadnum (r1) then exit;
r1:=r1+1
end;
SendCr(^B^M'No more mail!')
end;
procedure deleterange;
var first,last,num,cnt:integer;
begin
writehdr ('Mass Mail Delete');
parserange (filesize(mfile)-1,first,last,'Mass Delete Range');
if first=0 then exit;
num:=last-first;
if num<>1 then begin
SendCr('Warning! '+Strr(num)+' pieces of mail will be deleted!');
writestr ('Are you sure? !');
if not yes then exit
end;
for cnt:=last downto first do begin
delmail (cnt);
SendFull(Strr(cnt)+' ');
if break then begin
SendCr(^B^M'Aborted!');
exit
end
end;
writeln
end;
Procedure announcement;
procedure delannouncement;
begin
if urec.emailannounce=-1 then begin
SendCr(^M'You don''t have an announcement compadre!');
exit
end;
deletetext ('ANNOUNCE.TXT','ANNOUNCE.MAP',urec.emailannounce);
urec.emailannounce := -1;
writeurec;
SendCr(^M'Deleted.')
end;
Procedure CreateAnnouncement;
Var Me : Message;
Temp : Longint;
Begin
If Urec.EmailAnnounce >= 0
Then DeleteText ('ANNOUNCE.TXT','ANNOUNCE.MAP',urec.emailannounce);
SendCr(^M+'Creating Email Announcement');
Me.Add_AutoSig := True;
Temp := Editor (Me,False,False,False,'0','0','0','ANNOUNCE.TXT','ANNOUNCE.MAP');
Urec.EmailAnnounce := Temp;
Writeurec
end;
var k:char;
begin
if urec.emailannounce>=0
then showannouncement (unum)
else SendCr('You don''t have an announcement right now.');
WriteStr(Strng^.Announce_Prompt);
if length(inpt)=0 then exit;
k:=upcase(inpt[1]);
case k of
'D':delannouncement;
'C':createannouncement
end
end;
begin
incoming := nil;
outgoing := nil;
end.
(*
var q:integer;
begin
cursection:=emailsysop;
Quoting.AllowQuote := False;
Quoting.MsgSec := False;
opengfile;
readcatalogs;
WriteHdr('Electronic Mail');
ListAllMail(False);
If Exist(Cfg.TextFileDir+'MAILNEWS.BBS')
Then Printfile(Cfg.TextFileDir+'MAILNEWS.BBS');
lastread:=0;
Repeat
WriteCurMsg;
If Cfg.UseRumors > 1
Then RandomRumor;
q:=menu (Cfg.MailMenuStr,'EMAIL','QRSLN_%@DKAV#E@CFHGI@Z+');
if q<0
then readnum (abs(q))
else case q of
2:autoreply;
3:sendmail;
4:listallmail(True);
5:MailRead(True); {newmail;}
6:MailRead(False); {nextmail;}
7:sysopmail;
8:deleteincoming;
9:killoutgoing;
10:announcement;
11:viewoutgoing;
13:editmailuser;
14:copymail;
15:forwardmail;
16:; { help ('EMAIL.HLP'); }
17:groupediting;
18:showinfos;
19:zippymail;
20:write_to_file
end
until hungupon or (q=1);
QueryDelete(InComing);
close (gfile)
end;
*)