Shop OBEX P1 Docs P2 Docs Learn Events
W5200 pop & smtp — Parallax Forums

W5200 pop & smtp

twctwc Posts: 107
edited 2012-12-03 09:20 in Accessories
Hey Mike:

I was trying PopUnitTest and SmtpUnitTest and both having a problem connecting (i.e. stuck waiting for sock.Connected) to e-mail at socal.rr.com. I tried a different e-mail (at att.yahoo.com) and was able to connect which would seem to rule out unrelated issues. Unfortunately the att.yahoo.com e-mail requires SSL. If it's not to much trouble could I ask you please confirm whether you can connect to the pop and smtp servers at socal.rr.com? Thanks as always for your support.


PopUnitTest
sock.RemoteIp(71,74,56,68) 'pop-server.socal.rr.com
sock.RemotePort(110)
' sock.RemoteIp(67,195,135,148) 'pop.att.yahoo.com
' sock.RemotePort(995)

SmtpUnitTest
sock.RemoteIp(71,74,56,22) 'smtp-server.socal.rr.com
sock.RemotePort(25)
' sock.RemoteIp(98,139,221,42) 'smtp.att.yahoo.com
' sock.RemotePort(465)

Comments

  • Mike GMike G Posts: 2,702
    edited 2012-12-02 12:00
    I can not telnet 71.74.56.22 25. Make sure the SMPT port is 25.

    I can telnet 71.74.56.68 110 and successfully connect using the POP3 unit test.

    Print socket status to PST to see what going on in the socket.
    pst.str(string(CR, "Begin SMTP Conversation", CR))
    
      'Client
      pst.str(string("Open", CR))
      sock.Open
      pst.str(string("Status (open)....."))
      pst.hex(wiz.GetSocketStatus(0), 2)
      pst.char(13)
      
      pst.str(string("Connect", CR))
      sock.Connect
      pause(500)
      pst.str(string("Status (Connect).."))
      pst.hex(wiz.GetSocketStatus(0), 2)
      pst.char(13)
    
    
      pause(500)
      pst.str(string("Connecting...",CR))
      'pst.hex(wiz.GetSocketStatus(0), 2)
      'pst.char(13)
       
       
      'Connection?
      repeat until sock.Connected
        pst.str(string("Status.........."))
        pst.hex(wiz.GetSocketStatus(0), 2)
        pst.char(13)
        pause(500)
    
      pst.str(string("Connected.........", CR))
      pst.hex(wiz.GetSocketStatus(0), 2)
      pst.char(13)
    
  • twctwc Posts: 107
    edited 2012-12-02 16:25
    Hey Mike:

    Got pulled away for a few hours. Just tried your debug code with PopUnitTest and it showed Connected! So then I restored the app to original and now it's working? I can only guess there was a temporary connection problem (I've seen that before) when I tried it earlier.

    As for SmtpUnitTest, it gets stuck at status $15 (Sock_Synsent) and eventually times out. I'm guessing it does the same at your end. I confirmed the Account Properties Port=25.
    Now I'm thinking it may be an isp issue. I connect via att.com at home (where I am now) and socal.rr.com when I'm on the road. Turns out that when I'm connected via att.com I can't send e-mail from socal.rr.com but I can receive e-mail (which is why PopUnitTest works...now). So I knew the SmtpUnitTest wouldn't actually complete (i.e. can't send e-mail via socal.rr.com since I'm on att.com) but thought at least it could establish TCP connection. But now, based on the fact you can't connect with smtp-server.socal.rr.com either, I'm thinking att.com (and your isp?) may simply be refusing to forward the smtp request to socal.rr.com or the latter is ignoring it. I believe there's a way I can configure my att.com connection to fix that (i.e. allow me to send e-mail via socal.rr.com when I'm connected to att.com), so I'll pursue that. Thanks for your help, always points me in the right direction.

    Anyway,
  • Mike GMike G Posts: 2,702
    edited 2012-12-02 16:45
    But now, based on the fact you can't connect with smtp-server.socal.rr.com either, I'm thinking att.com (and your isp?) may simply be refusing to forward the smtp request to socal.rr.com or the latter is ignoring it
    I'm not sure how it works but the ISP network might be able to determine if an IP is coming from an unexpected network. Otherwise, spammers would have a field day with the SMTP IP.
  • twctwc Posts: 107
    edited 2012-12-02 17:21
    ...yes, so for SmtpUnitTest I'll try to configure the isp(s) to cooperate (i.e. allow me to send e-mail via socal.rr.com when I'm connected to att.com), bet that works, let you know.

    As for PopUnitTest it's connecting now but I noticed the output was garbled, think due to the fact my list of 500 messages >2KB. It was displaying part of the list, then displaying the rest later (i.e. after issuing RETR & QUIT). So I tweaked Send command as shown, seems to work correctly (i.e. displays entire >2KB response until bytesToRead==0 before issuing next command).
    PUB Send(cmd, response) | buffer, bytesToRead
      sock.Send(cmd, strsize(cmd))
      pst.str(cmd)
      pause(100)
      if(response)
        REPEAT
         bytesToRead := sock.Available
         if bytesToRead==0
           quit
         buffer := sock.Receive(@buff, bytesToRead)
         pst.str(buffer)  
    
  • TorTor Posts: 2,010
    edited 2012-12-03 00:51
    Mike G wrote: »
    I'm not sure how it works but the ISP network might be able to determine if an IP is coming from an unexpected network. Otherwise, spammers would have a field day with the SMTP IP.
    Most ISPs will block _outgoing_ connections to port 25, i.e. home networks are not generally allowed to connect to non-authenticating mail servers on the internet. And yes, that's to reduce spamming by botnets etc.
    So if you want to connect to some mail server to send them mail you'll have to use port 465 or port 587, which are authenticating variants of SMTP port 25. Obviously you'll then also have to support things like SSL and TLS.

    -Tor
  • twctwc Posts: 107
    edited 2012-12-03 06:16
    ...Thanks for the follow-up Tor. I confirmed my isp (att.net) is blocking my request to send e-mail via another isp (smtp-server.socal.rr.com). However, poking around their support website I was hopeful when I found they have an 'add external e-mail account' feature. I set that up and the good news is I was able to send e-mail via socal.rr.com while connected to att.net by using att.net web-based e-mail client. But the bad news is it appears to only work using att.net web-based e-mail client - I get the same error message as before if I try to use Outlook and SmtpUnitTest still can't connect either. I looked to see if I could create a new att.net e-mail sub-account without security but it appears they require SSL. I'll contact them to see if there's a solution. I don't have a pressing need for e-mail features right now so not a crisis. As a matter of curiousity, next time I'm actually connected to socal.rr.com (probably early January) I'll take along my WizProp setup and try SmtpUnitTest, bet it works, let you know.

    Got me wondering what percentage of users have isps that, like att.net, require secured e-mail (i.e. SSL)?
  • TorTor Posts: 2,010
    edited 2012-12-03 07:53
    twc wrote: »
    Got me wondering what percentage of users have isps that, like att.net, require secured e-mail (i.e. SSL)?
    My guess is: Very nearly all of them by now.. what ISPs will sometimes let you do is to connect to the ISP's own server on port 25 so that you can send mail that way (and that server is only available to their customers. But I suspect this is more and more changing to authenticated ports even for their own customers). But it's also sometimes possible to get them to open up access to port 25 in general for you, although I guess that depends on what restrictions your ISP has put on you (it often goes as 'no ftp server, no web server' etc. etc). Anyway I've heard about cases where customers did get permission to do that after contacting their ISP.

    So, how to send mail from your computer? If you don't want to pass everything through the ISP's server then you'll usually have to go the authenticated server route, and in practice that means you'll still have to pass mail through someone's server (i.e. you can't distribute mail directly to recipients, the way a corporate mailserver would). So, in my case, I have a gmail account, and I send all mail through gmail's server via port 465 (ssl) or port 587 (starttls), authenticating as myself (i.e. my gmail account). Not from any wiz or propeller though, just from my mobile- and desktop devices.

    -Tor
  • twctwc Posts: 107
    edited 2012-12-03 09:03
    ...Well I had an interesting hour or so with att support chat and then two different people. Actually wasn't so bad considering this is not a typical support topic. Bottom line is that the only way to get them to unblock port 25 is "business account with static ip". As an aside, the chat fellow showed me how I could fix my Windows Live Mail account settings to be able to send e-mail via the other (unsecured) isp in the manner you describe passing thru att port 465 (i.e. smtp server is att.net 465, pop server is socal.rr.com 110). Look for an update to this thread in a month or so when I try SmtpUnitTest connected to the unsecured isp port 25. PropSSL? :thumb:
  • Mike GMike G Posts: 2,702
    edited 2012-12-03 09:20
    I knew this day would come. I've been looking at SSL/TLS and mentioned the need to Parallax. SSL/TLS is complicated and resource intensive.
Sign In or Register to comment.