This commit is contained in:
mysticbbs 2013-04-13 00:57:02 -04:00
parent ac6c2cc3df
commit d08486a89f
7 changed files with 362 additions and 241 deletions

View File

@ -1114,8 +1114,31 @@ Var
DoWrap : Boolean = True; DoWrap : Boolean = True;
QuoteFile : Text; QuoteFile : Text;
Lines : SmallInt; Lines : SmallInt;
ReplyBase : RecMessageBase;
Begin Begin
If Not Session.User.Access(MBase.PostACS) Then Begin ReplyBase := MBase;
(*
Session.io.OutFull('|CR|09Reply |01[|10ENTER|01] |09Current Base, |01[|10B|01]|09ase, |01[|10N|01]|09etmail, |01[|10E|01]|09mail, |01[|10ESC|01] |09Abort: |11');
Case Session.io.OneKey (#13#27 + 'BNE', True) of
#27 : Exit;
'B' : Begin
//Total := ListAreas(Config.MCompress);
//NEW something like: (and use it in other areas too)
//PromptMessageBase (Var Base: RMB, IgnoreGroups): LongInt; -1 is abort, otherwise = physical area
End;
'E' : Begin
Reset (MBaseFile);
Read (MBaseFile, ReplyBase);
Close (MBaseFile);
Email := True;
End; // load email area set email := true
'N' : ; // load netmail area
End;
*)
If Not Session.User.Access(ReplyBase.PostACS) Then Begin
Session.io.OutFullLn (Session.GetPrompt(105)); Session.io.OutFullLn (Session.GetPrompt(105));
Exit; Exit;
End; End;
@ -1144,7 +1167,7 @@ Begin
Break; Break;
Until False; Until False;
If MBase.NetType = 3 Then Begin If ReplyBase.NetType = 3 Then Begin
MsgBase^.GetOrig(Addr); MsgBase^.GetOrig(Addr);
TempStr := NetmailLookup(False, ToWho, strAddr2Str(Addr)); TempStr := NetmailLookup(False, ToWho, strAddr2Str(Addr));
@ -1218,15 +1241,15 @@ Begin
If Editor(Lines, ColumnValue[Session.Theme.ColumnSize] - 2, mysMaxMsgLines, False, fn_tplMsgEdit, Subj) Then Begin If Editor(Lines, ColumnValue[Session.Theme.ColumnSize] - 2, mysMaxMsgLines, False, fn_tplMsgEdit, Subj) Then Begin
Session.io.OutFull (Session.GetPrompt(107)); Session.io.OutFull (Session.GetPrompt(107));
If Not OpenCreateBase(MsgNew, MBase) Then Exit; If Not OpenCreateBase(MsgNew, ReplyBase) Then Exit;
AssignMessageData(MsgNew, MBase); AssignMessageData(MsgNew, ReplyBase);
Case MBase.NetType of Case ReplyBase.NetType of
2 : MsgNew^.SetTo('All'); 2 : MsgNew^.SetTo('All');
3 : Begin 3 : Begin
MsgNew^.SetDest (Addr); MsgNew^.SetDest (Addr);
MsgNew^.SetOrig (GetMatchedAddress(Config.NetAddress[MBase.NetAddr], Addr)); MsgNew^.SetOrig (GetMatchedAddress(Config.NetAddress[ReplyBase.NetAddr], Addr));
MsgNew^.SetCrash (Config.netCrash); MsgNew^.SetCrash (Config.netCrash);
MsgNew^.SetHold (Config.netHold); MsgNew^.SetHold (Config.netHold);
MsgNew^.SetKillSent (Config.netKillSent); MsgNew^.SetKillSent (Config.netKillSent);
@ -1256,7 +1279,7 @@ Begin
Inc (Session.User.ThisUser.Emails); Inc (Session.User.ThisUser.Emails);
Inc (Session.HistoryEmails); Inc (Session.HistoryEmails);
End Else Begin End Else Begin
Session.SystemLog ('Posted #' + strI2S(MsgNew^.GetMsgNum) + ': "' + Subj + '" to ' + strStripMCI(MBase.Name)); Session.SystemLog ('Posted #' + strI2S(MsgNew^.GetMsgNum) + ': "' + Subj + '" to ' + strStripMCI(ReplyBase.Name));
Inc (Session.User.ThisUser.Posts); Inc (Session.User.ThisUser.Posts);
Inc (Session.HistoryPosts); Inc (Session.HistoryPosts);

View File

@ -57,7 +57,7 @@
; Level 2 = verbose ; Level 2 = verbose
; Level 3 = debug ; Level 3 = debug
loglevel=2 loglevel=1
; list of functions to perform on startup ; list of functions to perform on startup
@ -72,7 +72,7 @@
PostTextFiles = false PostTextFiles = false
PackMessageBases = false PackMessageBases = false
ImportEchoMail = false ImportEchoMail = false
ExportEchoMail = true ExportEchoMail = false
; ========================================================================== ; ==========================================================================
; ========================================================================== ; ==========================================================================

View File

@ -93,6 +93,7 @@ Function GetFTNArchiveName (Orig, Dest: RecEchoMailAddr) : String;
Function GetFTNFlowName (Dest: RecEchoMailAddr) : String; Function GetFTNFlowName (Dest: RecEchoMailAddr) : String;
Function GetFTNOutPath (EchoNode: RecEchoMailNode) : String; Function GetFTNOutPath (EchoNode: RecEchoMailNode) : String;
Function GetNodeByIndex (Num: LongInt; Var TempNode: RecEchoMailNode) : Boolean; Function GetNodeByIndex (Num: LongInt; Var TempNode: RecEchoMailNode) : Boolean;
Function IsValidAKA (Zone, Net, Node: Word) : Boolean;
Implementation Implementation
@ -581,4 +582,19 @@ Begin
Close (F); Close (F);
End; End;
Function IsValidAKA (Zone, Net, Node: Word) : Boolean;
Var
Count : Byte;
Begin
Result := False;
For Count := 1 to 30 Do Begin
Result := (bbsConfig.NetAddress[Count].Zone = Zone) And
(bbsConfig.NetAddress[Count].Net = Net) And
(bbsConfig.NetAddress[Count].Node = Node);
If Result Then Break;
End;
End;
End. End.

View File

@ -114,7 +114,8 @@ Type
Procedure DisposeText; Procedure DisposeText;
Function Open (FN: String) : Boolean; Function Open (FN: String) : Boolean;
Function GetMessage (NetMail: Boolean) : Boolean; Procedure Close;
Function GetMessage : Boolean;
End; End;
Implementation Implementation
@ -218,6 +219,13 @@ Begin
MsgLines := 0; MsgLines := 0;
End; End;
Procedure TPKTReader.Close;
Begin
DisposeText;
If MsgFile.Opened Then MsgFile.Close;
End;
Function TPKTReader.Open (FN: String) : Boolean; Function TPKTReader.Open (FN: String) : Boolean;
Var Var
Res : LongInt; Res : LongInt;
@ -230,6 +238,7 @@ Begin
If (Res <> SizeOf(PKTHeader)) or (PKTHeader.PKTType <> $0002) Then Begin If (Res <> SizeOf(PKTHeader)) or (PKTHeader.PKTType <> $0002) Then Begin
MsgFile.Close; MsgFile.Close;
Opened := False; Opened := False;
End Else Begin End Else Begin
Orig.Zone := PKTHeader.OrigZone; Orig.Zone := PKTHeader.OrigZone;
@ -243,10 +252,11 @@ Begin
End; End;
End; End;
Function TPKTReader.GetMessage (NetMail: Boolean) : Boolean; Function TPKTReader.GetMessage : Boolean;
Var Var
Res : LongInt; Res : LongInt;
Ch : Char; Ch : Char;
First : Boolean;
Function GetStr (TermChar: Char) : String; Function GetStr (TermChar: Char) : String;
Begin Begin
@ -278,12 +288,6 @@ Begin
MsgSubj := GetStr (#0); MsgSubj := GetStr (#0);
MsgTime := Copy(MsgDate, 12, 5); MsgTime := Copy(MsgDate, 12, 5);
If Not NetMail Then Begin
MsgArea := GetStr (#13);
Delete (MsgArea, Pos('AREA:', MsgArea), 5);
End;
Tmp := strUpper(Copy(MsgDate, 4, 3)); Tmp := strUpper(Copy(MsgDate, 4, 3));
For Res := 1 to 12 Do For Res := 1 to 12 Do
@ -296,6 +300,7 @@ Begin
DisposeText; DisposeText;
First := True;
MsgSize := 0; MsgSize := 0;
Result := True; Result := True;
MsgLines := 1; MsgLines := 1;
@ -321,6 +326,19 @@ Begin
Break; Break;
End; End;
If First Then Begin
First := False;
If Pos('AREA:', MsgText[MsgLines]^) = 1 Then Begin
MsgArea := Copy(MsgText[MsgLines]^, 6, 255);
MsgText[MsgLines]^ := '';
Continue;
End Else
MsgArea := 'NETMAIL';
End;
Inc (MsgSize, Length(MsgText[MsgLines]^)); Inc (MsgSize, Length(MsgText[MsgLines]^));
Inc (MsgLines); Inc (MsgLines);

View File

@ -12,6 +12,7 @@ Uses
DOS, DOS,
m_FileIO, m_FileIO,
m_Strings, m_Strings,
AView,
BBS_Common, BBS_Common,
BBS_MsgBase_ABS, BBS_MsgBase_ABS,
BBS_MsgBase_JAM, BBS_MsgBase_JAM,
@ -64,199 +65,60 @@ End;
Procedure uEchoImport; Procedure uEchoImport;
Var Var
TotalEcho : LongInt; TotalEcho : LongInt;
TotalNet : LongInt; TotalNet : LongInt;
TotalDupes : LongInt; TotalDupes : LongInt;
EchoNode : RecEchoMailNode; EchoNode : RecEchoMailNode;
DupeIndex : LongInt; DupeIndex : LongInt;
DupeMBase : RecMessageBase; DupeMBase : RecMessageBase;
CreateBases : Boolean; CreateBases : Boolean;
Dupes : TPKTDupe; PKT : TPKTReader;
Dupes : TPKTDupe;
Status : LongInt;
Procedure ImportNetMailpacket (ArcFN: String); Procedure ImportPacketFile (PktFN: String);
Var Var
PKT : TPKTReader;
MBase : RecMessageBase;
MsgBase : PMsgBaseABS;
Begin
PKT := TPKTReader.Create;
If PKT.Open (bbsConfig.InboundPath + ArcFN) Then Begin
If GetMBaseByNetZone (PKT.PKTHeader.DestZone, MBase) Then Begin
MessageBaseOpen(MsgBase, MBase);
While PKT.GetMessage(True) Do Begin
// Check for AreaFix, etc here
SavePKTMsgToBase(MsgBase, PKT, True);
Log (2, '+', ' Netmail ' + MBase.EchoTag + ' from ' + PKT.MsgFrom + ' to ' + PKT.MsgTo);
Inc (TotalNet);
End;
MsgBase^.CloseMsgBase;
Dispose (MsgBase, Done);
End Else
Log (3, '!', ' No NETMAIL base for zone ' + strI2S(PKT.PKTHeader.DestZone));
End Else
Log (3, '!', ' ' + ArcFN + ' is not valid PKT');
PKT.Free;
FileErase (bbsConfig.InBoundPath + ArcFN);
End;
Procedure ImportEchoMailPacket (ArcFN: String);
Var
DirInfo : SearchRec;
FoundPKT : Boolean;
CurTag : String;
MsgBase : PMsgBaseABS; MsgBase : PMsgBaseABS;
PKT : TPKTReader; CurTag : String;
MBase : RecMessageBase; MBase : RecMessageBase;
Part : LongInt;
Whole : LongInt;
Count : LongInt; Count : LongInt;
Begin Begin
FoundPKT := False; If Not PKT.Open(PktFN) Then Begin
PKT := TPKTReader.Create; Log (3, '!', ' ' + JustFile(PktFN) + ' is not valid PKT');
MsgBase := NIL;
Part := 0;
ProcessStatus (ArcFN + ' from ' + strAddr2Str(EchoNode.Address), False); Exit;
End;
ExecuteArchive (bbsConfig.InboundPath + ArcFN, EchoNode.ArcType, '*', 2); If Not IsValidAKA(PKT.Dest.Zone, PKT.Dest.Net, PKT.Dest.Node) Then Begin
Log (3, '!', ' ' + JustFile(PktFN) + ' does not match an AKA');
Whole := DirFiles(TempPath); PKT.Close;
Exit;
End;
ProcessStatus ('Importing ' + JustFile(PktFN), False);
BarOne.Reset; BarOne.Reset;
FindFirst (TempPath + '*', AnyFile, DirInfo); // set status for PKT name
// do percentage bar init
While DosError = 0 Do Begin CurTag := '';
If DirInfo.Attr And Directory = 0 Then Begin MsgBase := NIL;
Inc (Part); Status := 20;
BarOne.Update (Part, Whole); While PKT.GetMessage Do Begin
If Status MOD 20 = 0 Then
BarOne.Update (PKT.MsgFile.FilePos, PKT.MsgFile.FileSize);
If strUpper(JustFileExt(DirInfo.Name)) = 'PKT' Then Begin Inc (Status);
FoundPKT := True;
CurTag := '';
If Not PKT.Open(TempPath + DirInfo.Name) Then Begin If PKT.MsgArea = 'NETMAIL' Then Begin
Log (3, '!', ' ' + DirInfo.Name + ' is not valid PKT'); // areafix etc here
FindNext(DirInfo); If GetMBaseByNetZone (PKT.PKTHeader.DestZone, MBase) Then Begin
CurTag := '';
Continue;
End;
While PKT.GetMessage(False) Do Begin
If Dupes.IsDuplicate(PKT.MsgCRC) Then Begin
Log (3, '!', ' Duplicate message found in ' + PKT.MsgArea);
If DupeIndex <> -1 Then Begin
If (MsgBase <> NIL) and (CurTag <> '-DUPEMSG-') Then Begin
MsgBase^.CloseMsgBase;
Dispose (MsgBase, Done);
MsgBase := NIL;
CurTag := '-DUPEMSG-';
End;
If MsgBase = NIL Then
MessageBaseOpen (MsgBase, DupeMBase);
SavePKTMsgToBase (MsgBase, PKT, False);
End;
Inc (TotalDupes);
End Else Begin
If CurTag <> PKT.MsgArea Then Begin
If Not GetMBaseByTag(PKT.MsgArea, MBase) Then Begin
Log (2, '!', ' Area ' + PKT.MsgArea + ' does not exist');
If Not CreateBases then Continue;
If FileExist(bbsConfig.MsgsPath + PKT.MsgArea + '.sqd') or
FileExist(bbsConfig.MsgsPath + PKT.MsgArea + '.jhr') Then Continue;
FillChar (MBase, SizeOf(MBase), #0);
MBase.Index := GenerateMBaseIndex;
MBase.Name := PKT.MsgArea;
MBase.QWKName := PKT.MsgArea;
MBase.NewsName := PKT.MsgArea;
MBase.FileName := PKT.MsgArea;
MBase.EchoTag := PKT.MsgArea;
MBase.Path := bbsConfig.MsgsPath;
MBase.NetType := 1;
MBase.ColQuote := bbsConfig.ColorQuote;
MBase.ColText := bbsConfig.ColorText;
MBase.ColTear := bbsConfig.ColorTear;
MBase.ColOrigin := bbsConfig.ColorOrigin;
MBase.ColKludge := bbsConfig.ColorKludge;
MBase.Origin := bbsConfig.Origin;
MBase.BaseType := INI.ReadInteger(Header_ECHOIMPORT, 'base_type', 0);
MBase.ListACS := INI.ReadString (Header_ECHOIMPORT, 'acs_list', '');
MBase.ReadACS := INI.ReadString (Header_ECHOIMPORT, 'acs_read', '');
MBase.PostACS := INI.ReadString (Header_ECHOIMPORT, 'acs_post', '');
MBase.NewsACS := INI.ReadString (Header_ECHOIMPORT, 'acs_news', '');
MBase.SysopACS := INI.ReadString (Header_ECHOIMPORT, 'acs_sysop', 's255');
MBase.Header := INI.ReadString (Header_ECHOIMPORT, 'header', 'msghead');
MBase.RTemplate := INI.ReadString (Header_ECHOIMPORT, 'read_template', 'ansimrd');
MBase.ITemplate := INI.ReadString (Header_ECHOIMPORT, 'index_template', 'ansimlst');
MBase.MaxMsgs := INI.ReadInteger(Header_ECHOIMPORT, 'max_msgs', 500);
MBase.MaxAge := INI.ReadInteger(Header_ECHOIMPORT, 'max_msgs_age', 365);
MBase.DefNScan := INI.ReadInteger(Header_ECHOIMPORT, 'new_scan', 1);
MBase.DefQScan := INI.ReadInteger(Header_ECHOIMPORT, 'qwk_scan', 1);
MBase.NetAddr := 1;
For Count := 1 to 30 Do
If bbsConfig.NetAddress[Count].Zone = PKT.PKTHeader.DestZone Then Begin
MBase.NetAddr := Count;
Break;
End;
If INI.ReadString(Header_ECHOIMPORT, 'use_autosig', '1') = '1' Then
MBase.Flags := MBase.Flags OR MBAutoSigs;
If INI.ReadString(Header_ECHOIMPORT, 'use_realname', '0') = '1' Then
MBase.Flags := MBase.Flags OR MBRealNames;
If INI.ReadString(Header_ECHOIMPORT, 'kill_kludge', '1') = '1' Then
MBase.Flags := MBase.Flags OR MBKillKludge;
// ADD DOWNLINK INFORMATION HERE INTO ECHONODES??
AddMessageBase(MBase);
End;
If MsgBase <> NIL Then Begin
MsgBase^.CloseMsgBase;
Dispose (MsgBase, Done);
MsgBase := NIL;
End;
MessageBaseOpen(MsgBase, MBase);
CurTag := PKT.MsgArea;
End;
SavePKTMsgToBase (MsgBase, PKT, False);
Dupes.AddDuplicate(PKT.MsgCRC);
Inc (TotalEcho);
Log (2, '+', ' Added Msg #' + strI2S(MsgBase^.GetHighMsgNum) + ' to ' + strStripPipe(MBase.Name));
End;
End;
If MsgBase <> NIL Then Begin If MsgBase <> NIL Then Begin
MsgBase^.CloseMsgBase; MsgBase^.CloseMsgBase;
@ -266,17 +128,121 @@ Var
MsgBase := NIL; MsgBase := NIL;
End; End;
PKT.MsgFile.Close; MessageBaseOpen(MsgBase, MBase);
SavePKTMsgToBase(MsgBase, PKT, True);
Log (2, '+', ' Netmail from ' + PKT.MsgFrom + ' to ' + PKT.MsgTo);
Inc (TotalNet);
End Else
Log (3, '!', ' No NETMAIL base for zone ' + strI2S(PKT.PKTHeader.DestZone));
End Else Begin
If Dupes.IsDuplicate(PKT.MsgCRC) Then Begin
Log (3, '!', ' Duplicate message found in ' + PKT.MsgArea);
If DupeIndex <> -1 Then Begin
If (MsgBase <> NIL) and (CurTag <> '-DUPEMSG-') Then Begin
MsgBase^.CloseMsgBase;
Dispose (MsgBase, Done);
MsgBase := NIL;
CurTag := '-DUPEMSG-';
End;
If MsgBase = NIL Then
MessageBaseOpen (MsgBase, DupeMBase);
SavePKTMsgToBase (MsgBase, PKT, False);
End;
Inc (TotalDupes);
End Else Begin
If CurTag <> PKT.MsgArea Then Begin
If Not GetMBaseByTag(PKT.MsgArea, MBase) Then Begin
Log (2, '!', ' Area ' + PKT.MsgArea + ' does not exist');
If Not CreateBases Then Continue;
If FileExist(bbsConfig.MsgsPath + PKT.MsgArea + '.sqd') or
FileExist(bbsConfig.MsgsPath + PKT.MsgArea + '.jhr') Then Continue;
FillChar (MBase, SizeOf(MBase), #0);
MBase.Index := GenerateMBaseIndex;
MBase.Name := PKT.MsgArea;
MBase.QWKName := PKT.MsgArea;
MBase.NewsName := PKT.MsgArea;
MBase.FileName := PKT.MsgArea;
MBase.EchoTag := PKT.MsgArea;
MBase.Path := bbsConfig.MsgsPath;
MBase.NetType := 1;
MBase.ColQuote := bbsConfig.ColorQuote;
MBase.ColText := bbsConfig.ColorText;
MBase.ColTear := bbsConfig.ColorTear;
MBase.ColOrigin := bbsConfig.ColorOrigin;
MBase.ColKludge := bbsConfig.ColorKludge;
MBase.Origin := bbsConfig.Origin;
MBase.BaseType := INI.ReadInteger(Header_ECHOIMPORT, 'base_type', 0);
MBase.ListACS := INI.ReadString (Header_ECHOIMPORT, 'acs_list', '');
MBase.ReadACS := INI.ReadString (Header_ECHOIMPORT, 'acs_read', '');
MBase.PostACS := INI.ReadString (Header_ECHOIMPORT, 'acs_post', '');
MBase.NewsACS := INI.ReadString (Header_ECHOIMPORT, 'acs_news', '');
MBase.SysopACS := INI.ReadString (Header_ECHOIMPORT, 'acs_sysop', 's255');
MBase.Header := INI.ReadString (Header_ECHOIMPORT, 'header', 'msghead');
MBase.RTemplate := INI.ReadString (Header_ECHOIMPORT, 'read_template', 'ansimrd');
MBase.ITemplate := INI.ReadString (Header_ECHOIMPORT, 'index_template', 'ansimlst');
MBase.MaxMsgs := INI.ReadInteger(Header_ECHOIMPORT, 'max_msgs', 500);
MBase.MaxAge := INI.ReadInteger(Header_ECHOIMPORT, 'max_msgs_age', 365);
MBase.DefNScan := INI.ReadInteger(Header_ECHOIMPORT, 'new_scan', 1);
MBase.DefQScan := INI.ReadInteger(Header_ECHOIMPORT, 'qwk_scan', 1);
MBase.NetAddr := 1;
For Count := 1 to 30 Do
If bbsConfig.NetAddress[Count].Zone = PKT.PKTHeader.DestZone Then Begin
MBase.NetAddr := Count;
Break;
End;
If INI.ReadString(Header_ECHOIMPORT, 'use_autosig', '1') = '1' Then
MBase.Flags := MBase.Flags OR MBAutoSigs;
If INI.ReadString(Header_ECHOIMPORT, 'use_realname', '0') = '1' Then
MBase.Flags := MBase.Flags OR MBRealNames;
If INI.ReadString(Header_ECHOIMPORT, 'kill_kludge', '1') = '1' Then
MBase.Flags := MBase.Flags OR MBKillKludge;
// ADD DOWNLINK INFORMATION HERE INTO ECHONODES??
AddMessageBase(MBase);
End;
If MsgBase <> NIL Then Begin
MsgBase^.CloseMsgBase;
Dispose (MsgBase, Done);
MsgBase := NIL;
End;
MessageBaseOpen(MsgBase, MBase);
CurTag := PKT.MsgArea;
End;
SavePKTMsgToBase (MsgBase, PKT, False);
Dupes.AddDuplicate(PKT.MsgCRC);
Inc (TotalEcho);
Log (2, '+', ' Added Msg #' + strI2S(MsgBase^.GetHighMsgNum) + ' to ' + strStripPipe(MBase.Name));
End; End;
FileErase (TempPath + DirInfo.Name);
End; End;
FindNext (DirInfo);
End; End;
FindClose (DirInfo);
If MsgBase <> NIL Then Begin If MsgBase <> NIL Then Begin
MsgBase^.CloseMsgBase; MsgBase^.CloseMsgBase;
@ -285,19 +251,89 @@ Var
MsgBase := NIL; MsgBase := NIL;
End; End;
If Not FoundPKT Then PKT.Close;
Log (2, '!', ' Unable to find PKT in packet. Archive issue?');
PKT.Free; FileErase (PktFN);
FileErase (bbsConfig.InboundPath + ArcFN); BarOne.Update (1, 1);
End;
Procedure ImportPacketBundle (PktBundle: String);
Var
PKTFound : Boolean;
PKTMatched : Boolean;
DirInfo : SearchRec;
NodeFile : File of RecEchoMailNode;
EchoNode : RecEchoMailNode;
ArcType : String[4];
Count : Byte;
Begin
PKTMatched := False;
Assign (NodeFile, bbsConfig.DataPath + 'echonode.dat');
If ioReset(NodeFile, Sizeof(RecEchoMailNode), fmRWDN) Then Begin
While Not Eof(NodeFile) Do Begin
Read (NodeFile, EchoNode);
For Count := 1 to 30 Do Begin
If strUpper(JustFileName(PktBundle)) = strUpper(GetFTNArchiveName(EchoNode.Address, bbsConfig.NetAddress[Count])) Then Begin
PKTMatched := True;
ArcType := EchoNode.ArcType;
Break;
End;
End;
End;
Close (NodeFile);
End;
If Not PKTMatched Then Begin
Case GetArchiveType(bbsConfig.InboundPath + PktBundle) of
'A' : ArcType := 'ARJ';
'R' : ArcType := 'RAR';
'Z' : ArcType := 'ZIP';
'L' : ArcType := 'LZH';
Else
Log (2, '!', ' Cannot find arctype for ' + PktBundle + '; skipping');
Exit;
End;
End;
PKTFound := False;
ProcessStatus ('Extracting ' + PktBundle, False);
ExecuteArchive (bbsConfig.InboundPath + PktBundle, ArcType, '*', 2);
FindFirst (TempPath + '*', AnyFile, DirInfo);
While DosError = 0 Do Begin
If DirInfo.Attr And Directory = 0 Then Begin
If strUpper(JustFileExt(DirInfo.Name)) = 'PKT' Then Begin
PKTFound := True;
ImportPacketFile (TempPath + DirInfo.Name);
End;
End;
FindNext (DirInfo);
End;
FindClose (DirInfo);
If Not PKTFound Then
Log (2, '!', ' Unable to extract bundle; skipping')
Else
FileErase (bbsConfig.InboundPath + PktBundle);
End; End;
Var Var
DirInfo : SearchRec; DirInfo : SearchRec;
NodeFile : File of RecEchoMailNode; Count : LongInt;
Count : LongInt; FileExt : String;
FoundPacket : Byte;
Begin Begin
TotalEcho := 0; TotalEcho := 0;
TotalNet := 0; TotalNet := 0;
@ -322,6 +358,7 @@ Begin
Count := INI.ReadInteger(Header_ECHOIMPORT, 'dupe_db_size', 32000); Count := INI.ReadInteger(Header_ECHOIMPORT, 'dupe_db_size', 32000);
Dupes := TPKTDupe.Create(Count); Dupes := TPKTDupe.Create(Count);
PKT := TPKTReader.Create;
If DupeIndex <> -1 Then If DupeIndex <> -1 Then
If Not GetMBaseByIndex (DupeIndex, DupeMBase) Then If Not GetMBaseByIndex (DupeIndex, DupeMBase) Then
@ -331,37 +368,21 @@ Begin
While DosError = 0 Do Begin While DosError = 0 Do Begin
If DirInfo.Attr And Directory = 0 Then Begin If DirInfo.Attr And Directory = 0 Then Begin
FoundPacket := 0; FileExt := Copy(strUpper(JustFileExt(DirInfo.Name)), 1, 2);
If strUpper(JustFileExt(DirInfo.Name)) = 'PKT' Then Begin If FileExt = 'PK' Then
FoundPacket := 2; ImportPacketFile(bbsConfig.InboundPath + DirInfo.Name)
// NETMAIL Else
End Else Begin If (FileExt = 'SU') or
// ECHOMAIL (FileExt = 'MO') or
Assign (NodeFile, bbsConfig.DataPath + 'echonode.dat'); (FileExt = 'TU') or
(FileExt = 'WE') or
If ioReset(NodeFile, Sizeof(RecEchoMailNode), fmRWDN) Then Begin (FileExt = 'TH') or
While Not Eof(NodeFile) Do Begin (FileExt = 'FR') or
Read (NodeFile, EchoNode); (FileExt = 'SA') Then
ImportPacketBundle(DirInfo.Name)
For Count := 1 to 30 Do Begin Else
If strUpper(JustFileName(DirInfo.Name)) = strUpper(GetFTNArchiveName(EchoNode.Address, bbsConfig.NetAddress[Count])) Then Begin Log (2, '!', ' Unknown inbound file: ' + DirInfo.Name);
FoundPacket := 1;
Break;
End;
End;
End;
Close (NodeFile);
End;
End;
Case FoundPacket of
0 : Log (2, '!', ' Unknown inbound file: ' + DirInfo.Name);
1 : ImportEchoMailPacket (DirInfo.Name);
2 : ImportNetMailPacket (DirInfo.Name);
End;
End; End;
FindNext (DirInfo); FindNext (DirInfo);
@ -369,6 +390,7 @@ Begin
FindClose (DirInfo); FindClose (DirInfo);
PKT.Free;
Dupes.Free; Dupes.Free;
ProcessStatus ('Total |15' + strI2S(TotalEcho) + ' |07echo |15' + strI2S(TotalNet) + ' |07net |15' + strI2S(TotalDupes) + ' |07dupe', True); ProcessStatus ('Total |15' + strI2S(TotalEcho) + ' |07echo |15' + strI2S(TotalNet) + ' |07net |15' + strI2S(TotalDupes) + ' |07dupe', True);

View File

@ -8,6 +8,7 @@ design elements/issues.
BUGS AND POSSIBLE ISSUES BUGS AND POSSIBLE ISSUES
======================== ========================
! Weird console slowdown with test.txt in Win7 use MVIEW to test
! GE option 32 (change def protocol) might be broken ! GE option 32 (change def protocol) might be broken
! Node chat goes haywire at 1000 lines scrollback ! Node chat goes haywire at 1000 lines scrollback
! Node chat needs to actualy word wrap not nickname wrap. ! Node chat needs to actualy word wrap not nickname wrap.

View File

@ -3069,7 +3069,7 @@
default upload filebase. default upload filebase.
+ Installation now creates a DOCS directory off the root installation. This + Installation now creates a DOCS directory off the root installation. This
will eventually contain documentation. will eventually contain documentation that hopefully doesn't suck. :)
+ Installation now creates default echomail in/out directories. + Installation now creates default echomail in/out directories.
@ -3082,3 +3082,44 @@
mail it will not allow nodes to connect to you to exchange mail. mail it will not allow nodes to connect to you to exchange mail.
<ALPHA 30 RELEASED> <ALPHA 30 RELEASED>
+ Lots of changes to the MUTIL echomail import functions:
1. MUTIL will now process all PKT files with no regard of message type
(ie echo or netmail). It should now also process PKT files that
have a mix of each without crashing.
2. MUTIL will now ignore the base filename of PKT files meaning it will
attempt to process ALL incoming PKT files. MUTIL will check the PKT
header against the configured AKAs and if there is a match it will
import. If a PKT is found that is not addressed to a configured AKA
address, MUTIL will delete it.
3. For incoming echomail bundles, MUTIL will continue to first attempt
to match the bundle filename to a configured echomail node, but if a
configured node cannot be linked, it will attempt to find an archive
signature and use that to extract the bundle. Currently supported
signatures are ZIP, RAR, LZH, and ARJ.
If either a signature is found OR a link to an echomail node is found
it will attempt to import. Should both fail, MUTIL will no longer
delete the bundle instead it will only log the issue. This allows
the issue to be resolved without loss of echomail.
If it DOES succeed, MUTIL will process all PKT files using the same
logic that is described in #2 above.
4. MUTIL now reports status and percentage bars for each individual PKT
file when tossing a bundle, rather than just the bundle itself. In
addition, the logging will contain both the bundle and the PKT files
contained within it.
! Fixed a bug with the windows local console bleeding colors on a clear EOL
that was introduced in A30.
+ Added the footprint for the new reply functions (reply by current base,
email, netmail, or a selectable msg base). These are not functional yet,
but the internal changes have been made to allow for it. If you notice
wierdness during message replies let me know.
<ALPHA 31 RELEASED>