Added ability to send email to BBS from ISP's email addy.

This commit is contained in:
root 2013-11-09 16:13:05 -07:00
parent b21981f525
commit 9979afe0f7
8 changed files with 87 additions and 27 deletions

View File

@ -13,3 +13,22 @@ Vincent Chapman {
Added IPv6 Support
}
}
Vincent Chapman {
N1LQJ@COX.NET
9 NOV 2013
Modifed {
mis.pas.pas
mis_common.pas
mis_client_pop3.pas
mis_client_smtp.pas
mis_client_nntp.pas
mis_client_ftp.pas
records.pas
bbs_user.pas
bbs_menus.pas
}
Comment {
Added ability to send email to BBS from ISP's email addy.
}
}

View File

@ -5,6 +5,7 @@ Unit bbs_User;
Interface
Uses
sysutils,
m_FileIO,
m_Strings,
m_DateTime,
@ -25,6 +26,7 @@ Type
Security : RecSecurity;
ThisUser : RecUser;
TempUser : RecUser;
EmailUsrChk : RecUser;
UserNum : LongInt;
AcsOkFlag : Boolean;
IgnoreGroup : Boolean;
@ -489,13 +491,51 @@ Begin
End;
Procedure TBBSUser.GetEmail (Edit : Boolean);
Var
Str : String;
DropOut : Boolean;
Begin
If Edit Then
Session.io.OutFull (Session.GetPrompt(440))
Else
Session.io.OutFull (Session.GetPrompt(439));
DropOut := False;
Str := '';
ThisUser.EMail := Session.io.GetInput(35, 35, 11, ThisUser.Email);
While True Do Begin
If Edit Then Begin
Session.io.OutFull (Session.GetPrompt(440));
End Else Begin
Session.io.OutFull (Session.GetPrompt(439));
End;
Str := Session.io.GetInput(35, 35, 11, ThisUser.Email);
While (Pos(' ', Str) > 0) Do Begin
Delete (Str, Pos(' ', Str), 1);
End;
DropOut := True;
Reset (UserFile);
While Not Eof(UserFile) Do Begin
Read (UserFile, EmailUsrChk);
If (strUPPER(str) = strUPPER(EmailUsrChk.Email)) Then Begin
If (EmailUsrChk.PermIdx = ThisUser.PermIdx) Then Begin
Break;
end else begin
Session.io.OutFull (Session.GetPrompt(515));
DropOut := False;
Break;
End;
End;
End;
If (DropOut = True) Then Begin
Break;
End;
Close (UserFile);
End;
Close (UserFile);
ThisUser.EMail := Str;
End;
Procedure TBBSUser.GetUserNote (Edit : Boolean);

View File

@ -589,7 +589,7 @@ Procedure TFTPServer.cmdUSER;
Begin
ResetSession;
If SearchForUser(Data, User, UserPos) Then
If SearchForUser(Data, User, UserPos, '') Then
UserName := Data
Else
UserPos := -1;

View File

@ -132,7 +132,7 @@ Begin
NewData := Copy(Data, Pos(' ', Data) + 1, 255);
If NewCmd = 'USER' Then Begin
If SearchForUser(NewData, User, UserPos) Then Begin
If SearchForUser(NewData, User, UserPos, '') Then Begin
ClientWriteLine(re_AuthPass);
UserName := NewData;

View File

@ -295,7 +295,7 @@ Procedure TPOP3Server.cmdUSER;
Begin
ResetSession;
If SearchForUser(Data, User, UserPos) Then Begin
If SearchForUser(Data, User, UserPos, '') Then Begin
Client.WriteLine(re_SendUserPass);
UserName := Data;
End Else

View File

@ -90,15 +90,16 @@ Begin
If IsFrom Then
Server.Status(ProcessID, 'User: ' + InName + ' Domain: ' + InDomain);
If InDomain <> bbsCfg.iNetDomain Then Begin
Result := SearchForUser(InName, User, UserPos, InName + '@' + InDomain);
If (InDomain <> bbsCfg.iNetDomain) and (Result = False) Then Begin
Server.Status(ProcessID, 'Refused by domain: ' + InName + '@' + InDomain);
Exit;
End;
Result := SearchForUser(InName, User, UserPos);
If Not Result Then
If Not Result Then Begin
Server.Status(ProcessID, 'Refused by name: ' + InName + '@' + InDomain);
End;
End;
Procedure TSMTPServer.ResetSession;

View File

@ -14,7 +14,7 @@ Var
TempPath : String;
// Term : TTermAnsi;
Function SearchForUser (UN: String; Var Rec: RecUser; Var RecPos: LongInt) : Boolean;
Function SearchForUser (UN: String; Var Rec: RecUser; Var RecPos: LongInt; Email: String) : Boolean;
Function CheckAccess (User: RecUser; IgnoreGroup: Boolean; Str: String) : Boolean;
Function GetSecurityLevel (Level: Byte; SecLevel: RecSecurity) : Boolean;
@ -25,7 +25,7 @@ Uses
m_DateTime,
m_Strings;
Function SearchForUser (UN: String; Var Rec: RecUser; Var RecPos: LongInt) : Boolean;
Function SearchForUser (UN: String; Var Rec: RecUser; Var RecPos: LongInt; Email: String) : Boolean;
Var
UserFile : TFileBuffer;
Begin
@ -42,7 +42,7 @@ Begin
If Rec.Flags AND UserDeleted <> 0 Then Continue;
If (UN = strUpper(Rec.RealName)) or (UN = strUpper(Rec.Handle)) Then Begin
If (UN = strUpper(Rec.RealName)) or (UN = strUpper(Rec.Handle)) or (((strUpper(Email) = strUpper(Rec.Email)) and (Email <> ''))) Then Begin
RecPos := UserFile.FilePosRecord;
Result := True;
Break;

View File

@ -69,7 +69,7 @@ Const
mysMaxMenuCmds = 25; // Max menu commands per item
mysMaxMenuInput = 12;
mysMaxMenuStack = 8;
mysMaxThemeText = 514;
mysMaxThemeText = 515;
fn_SemFileEchoOut = 'echomail.out';
fn_SemFileEchoIn = 'echomail.in';