1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Help, can't complete telnet port 25 SMTP session to Comcast SMTP server.

Discussion in 'Tomato Firmware' started by TexasFlood, Jun 2, 2010.

  1. TexasFlood

    TexasFlood Network Guru Member

    Copied over from another thread, hoping it would be more visible here and someone might have a helpful suggestion. Thanks in advance....
    So I just tried this, finally, :wink:.

    My first test was from my Ubuntu laptop to the Comcast SMTP server which worked fine as shown below, slightly sanitized to remove my personal info, specifically my IP address and my source and destination email accounts. The email was delivered and looked fine.

    When doing from the Tomato router, all is well up until I try to enter the "." to end the data input. The Comcast SMTP server simply won't recognize the "." to end the data input so I can't finish and send the email. Maybe the line end needs to be CR/LF or something and isn't so not recognized, or something else simple like that. I tried a few ideas to get it working but nothing I tried worked as of yet.

    If anyone has an idea what the issue is & how to resolve, I'd sure appreciate a clue.
    Code:
    telnet smtp.comcast.net 25
    Trying 76.96.62.117...
    Connected to smtp.g.comcast.net.
    Escape character is '^]'.
    220 omta07.westchester.pa.mail.comcast.net comcast ESMTP server ready
    helo comcast.net
    250 omta07.westchester.pa.mail.comcast.net hello [{my IP address was removed from here}], pleased to meet you
    mail from: account1@comcast.net
    250 2.1.0 <account1@comcast.net> sender ok
    rcpt to: account2@comcast.net
    250 2.1.5 <account2@comcast.net> recipient ok
    data
    354 enter mail, end with "." on a line by itself
    from: account1@comcast.net
    to: account2@comcast.net
    subject: test subject line
    
    Test message line 1
    Test message line 2
    Test message line 3
    Testing, testing, 1, 2, 3, testing
    Test message last line
    .
    250 2.0.0 QGew1e00B0uhdwP3TGfHkj mail accepted for delivery
    quit
    221 2.0.0 omta07.westchester.pa.mail.comcast.net comcast closing connection
    Connection closed by foreign host.
    I was actually trying to implement the scripted approach as shown below but hit the same issue as doing it interactively. The script actually seems to work, up until the aforementioned "." problem.
    Code:
    DATETIME="`date`"
    MAILERNAME="mailer"
    MAILERVERSION="1.0"
    DELAY=2
    DOMAINNAME="comcast.net"
    MAILSERVERNAME="smtp.comcast.net"
    MAILSERVERPORT=25
    FROM="account1@comcast.net"
    MESSAGE="This is the message"
    SUBJECT="Subject line"
    TO="account2@comcast.net"
    if (
            sleep $DELAY
            echo "HELO $DOMAINNAME"
            sleep $DELAY
            echo "MAIL FROM: $FROM"
            sleep $DELAY
            echo "RCPT TO: $TO"
            sleep $DELAY
            echo "DATA"
            sleep $DELAY
            echo "Date: $DATETIME"
            echo "From: $FROM"
            echo "To: $TO"
            echo "Subject: $SUBJECT"
            echo "X-Mailer: $MAILERNAME $MAILERVERSION"
            echo ""
            echo "$MESSAGE"
            echo "."
            sleep $DELAY
            echo "QUIT"
            sleep $DELAY
       ) | telnet $MAILSERVERNAME $MAILSERVERPORT; then
            :
    else
            logger local7.warning -t "smtp_auto_message" "WARNING: condition"
    fi
     
  2. mstombs

    mstombs Network Guru Member

    Would an extra carriage return help?

    Code:
    echo -e ".\n"
     
  3. TexasFlood

    TexasFlood Network Guru Member

    Thanks for the suggestion but tried it and no-go. This is just weird. I'm sure there is a simple explanation, I just can't figure out what it is.
     
  4. TexasFlood

    TexasFlood Network Guru Member

    Anyone else have an idea?

    I just seem to have hit a wall here, silly as it sounds.

    Maybe need to capture some packets from the working session on Ubuntu vs. the non-working one on the Tomato router & compare. I can use wireshark on Ubuntu. Actually if I can find the old hub I used to have, I can probably sniff the Tomato router with wireshark on Ubuntu also. Unless there is a better way.
     
  5. rhester72

    rhester72 Network Guru Member

    You can use tcpdump on Tomato (get it from my utilities site), but yeah, that's about the best way to approach it.

    Rodney
     

Share This Page