Added ability to send email to BBS from ISP's email addy.
This commit is contained in:
parent
b21981f525
commit
9979afe0f7
|
@ -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.
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -79,26 +79,27 @@ End;
|
|||
|
||||
Function TSMTPServer.ValidateNameAndDomain (IsFrom: Boolean) : Boolean;
|
||||
Var
|
||||
InName : String;
|
||||
InDomain : String;
|
||||
InName : String;
|
||||
InDomain : String;
|
||||
Begin
|
||||
Result := False;
|
||||
Result := False;
|
||||
|
||||
InName := strReplace(Copy(Data, Pos('<', Data) + 1, Pos('@', Data) - Pos('<', Data) - 1), '_', ' ');
|
||||
InDomain := Copy(Data, Pos('@', Data) + 1, Pos('>', Data) - Pos('@', Data) - 1);
|
||||
InName := strReplace(Copy(Data, Pos('<', Data) + 1, Pos('@', Data) - Pos('<', Data) - 1), '_', ' ');
|
||||
InDomain := Copy(Data, Pos('@', Data) + 1, Pos('>', Data) - Pos('@', Data) - 1);
|
||||
|
||||
If IsFrom Then
|
||||
Server.Status(ProcessID, 'User: ' + InName + ' Domain: ' + InDomain);
|
||||
If IsFrom Then
|
||||
Server.Status(ProcessID, 'User: ' + InName + ' Domain: ' + InDomain);
|
||||
|
||||
If InDomain <> bbsCfg.iNetDomain Then Begin
|
||||
Server.Status(ProcessID, 'Refused by domain: ' + InName + '@' + InDomain);
|
||||
Exit;
|
||||
End;
|
||||
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
|
||||
Server.Status(ProcessID, 'Refused by name: ' + InName + '@' + InDomain);
|
||||
If Not Result Then Begin
|
||||
Server.Status(ProcessID, 'Refused by name: ' + InName + '@' + InDomain);
|
||||
End;
|
||||
End;
|
||||
|
||||
Procedure TSMTPServer.ResetSession;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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';
|
||||
|
|
Loading…
Reference in New Issue