• SMTP and POP3

    From Simon Woodland@2:250/501.5 to Chris Hoppman on Sunday, October 20, 2002 20:07:13
    Hello Chris!

    On 19/10/2002, Chris Hoppman wrote to All:
    I was wondering how these protocals work. I know that smtp sends
    mail for
    your system. Does it also recieve mail or is that the pop3. That
    mail

    Pop3 stands for Post offfice protocol and Smtp Simple mail Transport Protocol

    Basiclly in a standard home user system you receive mail via pop3 and send via SMTP.

    Sometimes you can recive mail via SMTP if your ISP alllow's it but the drawback
    is
    you get everything dumped in your mail box using smtp if you want it or not where as POP3 has the caplebility to recevie messages from the server, keep messages on the sever, view messages on the
    server and delete messages from the server.


    Regards,
    Simon Woodland

    --- APoint 1.25
    * Origin: Simon's Little Corner of the world (2:250/501.5)
  • From Chris Hoppman@1:129/305 to Simon Woodland on Thursday, November 07, 2002 08:20:44
    |15Quoting Message From |10Simon Woodland |15to |10Chris Hoppman
    |15On |1020 Oct 02 19:07:13.
    Pop3 stands for Post offfice protocol and Smtp Simple mail Transport Protoc Basiclly in a standard home user system you receive mail via pop3 and send SMTP. Sometimes you can recive mail via SMTP if
    your ISP alllow's it but the drawback is
    you get everything dumped in your mail box using smtp if you want it or not where as POP3 has the caplebility to recevie messages from the server, keep

    hrm, yep. Let me try it this way. SMTP recieves mail on port 25 and also sends mail on port 25. When it recieves the mail does it store it in a file format upon the server? Or, tempary store it until it is --> To sort of answer my own question. It passes it off to the pop3 server. Now, does that store it in a file on the server. Or it doesn't store it at all and just passes it off to the pop3 server and that does it.
    Sorry, I have this source code for a smtp & pop3 server and want to figure
    out the code. I just want to use the smtp to dump the mail it recieves to a file for convertion to NetMail format but I am not sure if I am able to do that. The code is in oop(slash delphi-1)(slash tpascal 7)(slahs visualpascal) in which I am not that good with *yet* and tring to figure out what is going
    on with the code is having my head spin. I haven't been able to look at it
    for a couple of months. Well, since I postted the question. (alot of stuff sided track'd me). Anyhow, since then I have found a few sites that example just what you told me, but not the internal workings and was hoping someone could fill me in.

    breathin' in

    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)
  • From mark lewis@1:3634/12 to Chris Hoppman on Thursday, November 07, 2002 12:02:26
    hrm, yep. Let me try it this way. SMTP recieves mail
    on port 25 and also sends mail on port 25. When it
    recieves the mail does it store it in a file format upon
    the server? Or, tempary store it until it is -->

    well, that depends on the design of the server... some do it this way, others do it that way and i'm sure that still others do it another way... it really depends on the design of the server...

    [trim]

    Sorry, I have this source code for a smtp & pop3 server
    and want to figure out the code. I just want to use the
    smtp to dump the mail it recieves to a file for convertion

    you'll have to dig into the code and follow it thru... there is a basic path even though it may be OOP stuff... since you say that it is (what appears to be) a smtp and pop3 server all rolled into one, you'll have to locate that section that crosses the line and gets it to the pop3 server for delivery to the user... at that point is where you'd cut the line and do what you want with
    it...

    all in all, though, instead of trying to reverse engineer something that you don't fully understand, why not just do oyur own smtp receiver and fling the incomming data where you want it? surely its got to be easier than figuring out
    someone else's mess...

    its not all that hard, really... the standards are available for anyone to use...

    )\/(ark


    * Origin: (1:3634/12)
  • From Simon Woodland@2:250/501.5 to Chris Hoppman on Thursday, November 07, 2002 18:55:07
    Hello Chris!

    On 07/11/2002, Chris Hoppman wrote to Simon Woodland:
    <snip>
    hrm, yep. Let me try it this way. SMTP recieves mail on port 25
    and also
    sends mail on port 25. When it recieves the mail does it store it
    in a file

    The mail server would recevie the mail and shove it into the pop3 'boxes' ready
    for collection
    for pop3 customer's or store it the smtp mail boxes for smtp customer's

    How you store the info on the server and how ong you keep it etc is up to you as long as it sends and recevies correctly when requested and sends valid command's to the client or other mail server.






    Regards,
    Simon Woodland

    --- APoint 1.25
    * Origin: Simon's Little Corner of the world (2:250/501.5)
  • From Jasen Betts@3:640/531.42 to Chris Hoppman on Saturday, November 09, 2002 06:43:43
    Hi Chris.

    07-Nov-02 08:20:44, Chris Hoppman wrote to Simon Woodland

    hrm, yep. Let me try it this way. SMTP recieves mail on port 25
    and also sends mail on port 25. When it recieves the mail does it
    store it in a file format upon the server? Or, tempary store it
    until it is --> To sort of answer my own question. It passes it
    off to the pop3 server. Now, does that store it in a file on the
    server. Or it doesn't store it at all and just passes it off to
    the pop3 server and that does it. Sorry, I have this source code
    for a smtp & pop3 server and want to figure out the code.

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

    if it';s one program internally it can do it any way that it wants.
    FWIW email messages are text files, (7-bit ascii for the most part)
    so if there are files there shouldn't be much problems using them.

    seeing as you have a nwtwork app, the most useful thing to have if you
    want to modify or debug network apps is two computers and a network between them. set it up and see what it does.

    I just
    want to use the smtp to dump the mail it recieves to a file for
    convertion to NetMail format but I am not sure if I am able to do
    that. The code is in oop(slash delphi-1)(slash tpascal 7)(slahs visualpascal) in which I am not that good with *yet* and tring to
    figure out what is going on with the code is having my head spin.
    I haven't been able to look at it for a couple of months. Well,
    since I postted the question. (alot of stuff sided track'd me).
    Anyhow, since then I have found a few sites that example just what
    you told me, but not the internal workings and was hoping someone
    could fill me in.

    Smtp and pop3 both work over a telnet connection (like zmodem ususally
    works over a dialup connection), the messages are transferred as plain text after some passwording and other setup etc...

    The telnet code is complex but for the most psart can be ignored (it won't
    need any modification) the interesting stuff will be where the smtp code
    is.

    if you want details try a unix manual entry get a book (google should find
    you a few). or get a book.

    Bye <=-

    ---
    * Origin: They're only trying to make me LOOK paranoid! (3:640/531.42)
  • From Chris Hoppman@1:129/305 to Jasen Betts on Friday, November 15, 2002 11:04:17
    |15Quoting Message From |10Jasen Betts |15to |10Chris Hoppman
    |15On |1009 Nov 02 06:43:43.

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

    Port 110 and 25.

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

    works over a dialup connection), the messages are transferred as plain tex after some passwording and other setup etc...

    The telnet code is complex but for the most psart can be ignored (it won't need any modification) the interesting stuff will be where the smtp code is.

    if you want details try a unix manual entry get a book (google should find 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)
  • From Jasen Betts@3:640/531.42 to Chris Hoppman on Saturday, November 23, 2002 21:58:44
    Hi Chris.

    15-Nov-02 11:04:17, Chris Hoppman wrote to Jasen Betts


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

    if you want details try a unix manual entry get a book (google should
    find you a few). or get a book.

    Looking into it. My libary doesn't have a unix manual on hand, but think

    oops. it looks like i miss typed, unix manuals are mainly electronic
    documents and are often readable over the web, and downloadable, free.

    As a book you should look for a book you want a book on email transfer...

    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');

    I expect that storemessage does the actual writing of the message to the message file.

    (* 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. *)

    Tstring? (like pstring? - nul terminated)
    dunno for sure but it should be easy to test it.

    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?

    virtual and abstract are OO thioings that I don't fully understand.
    code is code... edit the code :)

    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.

    One string at a time with CR/LF etc between them.

    ah ha.. maybe
    Procedure WriteStoreMessage(ASender: String; ARecipiants, AMessage: TstringList);
    type
    Message = Record
    Sender : String;
    Recipiants : ????;
    Message : ????;

    ???? - I've never seen that beast before.

    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.

    yeah,I guess that'd work... not sure exatly what format that'd give though.

    Bye <=-

    ---
    * Origin: Positive: Mistaken at the top of one's voice. (3:640/531.42)
  • From Chris Hoppman@1:129/305 to Jasen Betts on Saturday, November 30, 2002 03:06:02
    Message = Record
    Sender : String;
    Recipiants : ????;
    Message : ????;

    ???? - I've never seen that beast before.

    end;
    var email:Message;

    okay, got it working. thanks for the info. now I have to modeify it to my own display and do some other things to it.

    Chris

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