Subj : Re: SMTP and POP3
To   : Jasen Betts
From : Chris Hoppman
Date : Fri Nov 15 2002 11:04 am

|15Quoting Message From |10Jasen Betts |15to |10Chris Hoppman
|15On |1009 Nov 02  06:43:43.

JB> Smtp and pop3 both work over a telnet connection (like zmodem ususally

 Port 110 and 25.

JB> the answer is maybe... is it one program or two (or three...)?
 two programs.

JB> works over a dialup connection), the messages are transferred as plain tex
JB> after some passwording and other setup etc...
JB>
JB> The telnet code is complex but for the most psart can be ignored (it won't
JB> need any modification)  the interesting stuff will be where the smtp code
JB> is.
JB>
JB> if you want details try a unix manual entry get a book (google should find
JB> you a few). or get a book.
Looking into it.  My libary doesn't have a unix manual on hand, but think I
wil shop arond online for one.  Don't think Barnes and Noble (local book
store) might have one even though they got just about everything else.. hrm,
were talking about like 85$+ for the book? right. ugh...

See there is two programs one is a smtp server and the other is
a pop3 server.

The smtp server program uses a unit that has all the procedures
and functions so the main program is online 5 lines.

here is the snippet...
(* SNIPPET *)
 PROCEDURE TSMTPServer.cmdData(VAR Message: TaslMessage);
 BEGIN
   IF FSender='' THEN
      CliSocket.WriteLn('503 Must send MAIL FROM: first')
   ELSE
     IF FRecipients.Count=0 THEN
        CliSocket.WriteLn('503 Must send RCPT TO: first')
     ELSE
     BEGIN
       CliSocket.WriteLn('354 Send mail; end with <CRLF>.<CRLF>');
       GetMsgLines(FMessage);
 -->   IF StoreMessage(FSender, FRecipients, FMessage) THEN
       BEGIN
         CliSocket.WriteLn('250 OK');
         (* Should I do the text write here?
            Also, FSender is in TString form. Can use you that
            almost like a accual string to write to a text or
            fsender[1],fsender[2],etc. *)
         DoReset;
       END ELSE
       BEGIN
         CliSocket.WriteLn('554 Can''t store message');
         FMessage.Clear;
       END;
     END;
    END;
--> This is where it stores the message. I think.
(** StoreMessage **)
FUNCTION  StoreMessage(ASender: String; ARecipiants, AMessage: TStringList):
Boolean; VIRTUAL; ABSTRACT;

I look'd around all the units and this is the only thing I found.
It was never defined in the IMPLANTION<sp> part of the unit. I see
that it is a boolean type, but does virtual and abstract effect it?
I know I sound lame, but I am a newbie at oop.
TStringList  is a link list of string, but how do you write it to a file.

ah ha.. maybe
Procedure WriteStoreMessage(ASender: String; ARecipiants, AMessage:
TstringList);
type
 Message = Record
   Sender : String;
   Recipiants : ????;
   Message : ????;
 end;
var  email:Message;
    emaildat: file of email;
begin
 email.sender:=Asender;
 email.Recipiants:=ARecipiants;
 email.Message:=AMessage;
 assign(emaildat,'email.dat');
 rewrite(email);
 seek(email,0);
 write(emaildat,email);
 close(emaildat);
end.

Chris,

---)+o.oNE dls!
* telnet://dls.darktech.org | http://dls.darktech.org *
---)

--- Renegade vY2Ka2
* Origin: The Titantic BBS Telnet - ttb.slyip.com (1:129/305)