Bind port 25, receive an email

This is a discussion on Bind port 25, receive an email within the C++ Programming forums, part of the General Programming Boards category; Hai guys, I'm trying to learn how to parse emails sent to my computer. The domain points to my IP. ...

  1. #1
    Dae
    Dae is offline
    Deprecated Dae's Avatar
    Join Date
    Oct 2004
    Location
    Canada
    Posts
    1,034

    Smile Bind port 25, receive an email

    Hai guys, I'm trying to learn how to parse emails sent to my computer. The domain points to my IP. I have a program bind port 25. I send myself an email with gmail. I get gmail's EHLO command. I send back my response, and it ignores me. That's as far as I can get.

    I don't understand what the problem is. So maybe someone could recommend an SMTP server library or something. Thanks in advance

    //accept connected google client
    S: 220 mail.daedro.com ESMTP
    C: EHLO mail-ew0-f228.google.com
    S: 250 mail.daedro.com
    //timeout no response
    Code:
    clientSocket.Send("220 mail.daedro.com ESMTP\r\n");
    
    ...
    
    if(message->Data.find("EHLO") != std::string::npos)
    	clientSocket->Send("250 mail.daedro.com\r\n");
    I also tried enhancing the ESMTP parameters but it didn't do anything:

    Code:
    clientSocket->Send("250-mail.daedro.com\r\n\
    250-PIPELINING\r\n\
    250-SIZE 20480000\r\n\
    250-VRFY\r\n\
    250-ETRN\r\n\
    250-ENHANCEDSTATUSCODES\r\n\
    250-8BITMIME\r\n\
    250 HELP\r\n");
    Warning: Have doubt in anything I post.

    GCC 4.5, Boost 1.40, Code::Blocks 8.02, Ubuntu 9.10 010001000110000101100101

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,762
    Download wireshark.
    Compare your message sequence trace with that of a known working email application.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Dae
    Dae is offline
    Deprecated Dae's Avatar
    Join Date
    Oct 2004
    Location
    Canada
    Posts
    1,034
    You the man, thanks Salem!

    Turns out there were some problems with my boost::asio streams, which weren't so hard to track down once I could compare with a working SMTP server (found a demo, little difficult to find) in Wireshark.
    Warning: Have doubt in anything I post.

    GCC 4.5, Boost 1.40, Code::Blocks 8.02, Ubuntu 9.10 010001000110000101100101

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Serial port receive Buffer help
    By Daffodils in forum C Programming
    Replies: 1
    Last Post: 07-23-2009, 09:47 AM
  2. Can I bind a UDP socket to a port, but send to any other port?
    By trillianjedi in forum Networking/Device Communication
    Replies: 3
    Last Post: 01-25-2009, 04:27 PM
  3. FTP program
    By jakemott in forum Linux Programming
    Replies: 14
    Last Post: 10-06-2008, 02:58 PM
  4. brace-enclosed error
    By jdc18 in forum C++ Programming
    Replies: 53
    Last Post: 05-03-2007, 06:49 PM
  5. Send and receive through serial Port
    By overspray in forum C++ Programming
    Replies: 1
    Last Post: 07-21-2004, 05:15 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21