Zimmer Posted September 29, 2009 Share Posted September 29, 2009 After reading a comment on slashdot about telnet and SMTP I decided to try it with my gmail account. I already had the gmail server etc (I was working on another project, now this is kinda intertwined), so I did it see what commands I could do etc. I then read the wikipedia articles on SMTP and ESMTP, I also read a pdf (http://www.sonicwall.com/downloads/04__SMTP__Telnet_How_To.pdf), that mentioned nslookup then I google for some info on dns and found (http://www.mxtoolbox.com/SuperTool.aspx) for MX Lookups (a type of dns lookup??). So this is where the prevouis project get interwined, I am programing a python email forwarder that scans the html source of a mailbox (it uses the web front end (I prevously gave up on finding the smtp server)), but now I have found the server (and using http://www.mxtoolbox.com/SuperTool.aspx) I lookup ed the pot scan results and found port 25 open (smtp standard port), so I tried telnet (it failed (just like a previous attempt with smtp.live.com (hotmail's smtp server))) so I figured that it was odd that even though port 25 was open (I am a network noob, but I am guessing it just blocks telnet), so I did the port scan link for smtp.live.com to confirm my suspicion (that they block telnet), and smtp.live.com also had port 25 open. So I then tried using a python email client (from the email forwarding project... it failed to,). So two questions. 1 Is there anything I am missing 2 Why can't my python client access the server (I provided my credentials (the ones to access the html frontend))? Python code: http://djkaos.wordpress.com/2009/04/08/pyt...d-email-script/ ----------------------- Any words of wisdom or experience you would like to share? ---------------------- Other observations.. after using ms dos's telnet I tried putty but it failed. Odd. Oh well, -------------------------- Thank You for any advice, help, etc :-) Quote Link to comment Share on other sites More sharing options...
dallaskorben Posted September 29, 2009 Share Posted September 29, 2009 Port 25 can often be blocked, you can try port 587 on smtp.live.com. (I can telnet to smtp.live.com:587 and talk to the server, but not port 25 - I guess my isp is blocking it?) edit: I see your Python code is using port 587 - so I don't know what the problem is there, sorry. Quote Link to comment Share on other sites More sharing options...
Zimmer Posted September 29, 2009 Author Share Posted September 29, 2009 Thanks for the help, i tried both ports, also the code is not mine as in I created but in that I was using it... Well I went to here... http://www.mxtoolbox.com/SuperTool.aspx?ac...ever.domain.ext I changed the domain from the original to server.domain.ext (in url above to.). Results smtp:server.domain.ext smtp 220 server.domain.ext Service ready Not an open relay. 0 seconds - Good on Connection time 0.343 seconds - Good on Transaction time OK - 69.21.65.49 resolves to server.domain.ext OK - Reverse DNS matches SMTP Banner Session Transcript:HELO please-read-policy.mxtoolbox.com 250 server.domain.ext [62 ms] MAIL FROM: <supertool@mxtoolbox.com> 250 [125 ms] RCPT TO: <test@example.com> 550 [78 ms] QUIT 221 [78 ms] Also it wasn't hotmail's servers I was trying to use but another (school I go to)... Oh and python stuff >>> mailServer = smtplib.SMTP("sever.domain.ext", 25) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Program Files\Python 2.6.2\lib\smtplib.py", line 239, in __init__ (code, msg) = self.connect(host, port) File "C:\Program Files\Python 2.6.2\lib\smtplib.py", line 295, in connect self.sock = self._get_socket(host, port, self.timeout) File "C:\Program Files\Python 2.6.2\lib\smtplib.py", line 273, in _get_socket return socket.create_connection((port, host), timeout) File "C:\Program Files\Python 2.6.2\lib\socket.py", line 512, in create_connec tion raise error, msg socket.error: [Errno 10051] A socket operation was attempted to an unreachable n etwork >>> mailServer = smtplib.SMTP("server.domain.ext", 587) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Program Files\Python 2.6.2\lib\smtplib.py", line 239, in __init__ (code, msg) = self.connect(host, port) File "C:\Program Files\Python 2.6.2\lib\smtplib.py", line 295, in connect self.sock = self._get_socket(host, port, self.timeout) File "C:\Program Files\Python 2.6.2\lib\smtplib.py", line 273, in _get_socket return socket.create_connection((port, host), timeout) File "C:\Program Files\Python 2.6.2\lib\socket.py", line 512, in create_connec tion raise error, msg socket.error: [Errno 10060] A connection attempt failed because the connected pa rty did not properly respond after a period of time, or established connection f ailed because connected host has failed to respond Also when I use my school's email account and send to gmail, gmail reports the sever.domain.ext to be the smtp server to. Quote Link to comment Share on other sites More sharing options...
Zimmer Posted September 29, 2009 Author Share Posted September 29, 2009 Ok I did this... http://www.exclamationsoft.com/exclamation...ailAddress.html and get the address I though was correct. But still can't send email to it even. Quote Link to comment Share on other sites More sharing options...
h3%5kr3w Posted September 29, 2009 Share Posted September 29, 2009 It might be that the port is 'open' but the firewall, or switch behind it is blocking the telnet packet. Hell it may be a whole other service that they are just doing a 'security through obscurity' type of thing. Could be an HTTP port, just redirected and masked or something like that. Trust me, even though the port is open, there is so much more layer 2 and layer 3 security that is probably behind it that who knows what it actually accepts and what it does not. Just for hoots, did you try just pinging the port? sounds stupid I know, but if you got a ping back then it obviously accepts ICMP traffic. (but I highly doubt that cause that's just waiting for a DDoS) Quote Link to comment Share on other sites More sharing options...
Zimmer Posted September 30, 2009 Author Share Posted September 30, 2009 Nope ping fails, good I guess :-). Also I did a port scan with the link I previously mentioned and port 25 is open but 587 is not. Also the system is a Webmail by Mirapoint, if that helps any :-)... Still trying to get it to work. :-) Quote Link to comment Share on other sites More sharing options...
Zimmer Posted September 30, 2009 Author Share Posted September 30, 2009 Ok the system appears that it can support http, https, SMTP, LDAP. So it maybe that it only is accessible from HTTP, (http://docs.google.com/gview?a=v&q=cache:ZUTvx-j6SwoJ:www.olivercom.com/pdf/solutions/Webmail%2520Direct%252010.00.pdf+mirapoint+webmail+get+smtp+address&hl=en&gl=us&sig=AFQjCNEKICcLuMXbPZpg6NmmTAdwA5EiCA). Though wouldn't they still need a SMTP server to send emails (they may not have pop though). Quote Link to comment Share on other sites More sharing options...
digip Posted October 1, 2009 Share Posted October 1, 2009 If I'm not mistaken, SMTP may be open, but can also REQUIRE authentication to use its service. Telnet can do exaclty the same stuff your client would for the most part(excpet for certificates and encryption), you just need to authenticate to the server. Some SMTP relays used to allow you to send unsolicited mail as anyone, even if there was no user with that name on the system (Comcast and Mindspring actually used to years ago), but they get abused pretty quickly and locked down due to spammers. Quote Link to comment Share on other sites More sharing options...
Zimmer Posted October 1, 2009 Author Share Posted October 1, 2009 Yah but with google SMTP servers it is get on with telnet then authenticate, is there a way to send it during connection? Also ya this isn't a open relay according to http://www.mxtoolbox.com/SuperTool.aspx). Will google some more later, thanks digip :-) Quote Link to comment Share on other sites More sharing options...
digip Posted October 1, 2009 Share Posted October 1, 2009 http://www.kongtechnology.com/2008/01/27/s...s-using-telnet/ Quote Link to comment Share on other sites More sharing options...
Zimmer Posted October 1, 2009 Author Share Posted October 1, 2009 Thanks for the links digip :-). Ok I tried the link with this... telnet open mail.server.org 25 Connection Failed open mail.server.org 465 Connection Failed open mail.server.org 587 Connection Failed I'm sure this is the smtp server (gmail reports it as the SMTP server that sent the email to it.) Quote Link to comment Share on other sites More sharing options...
digip Posted October 2, 2009 Share Posted October 2, 2009 Thanks for the links digip :-). Ok I tried the link with this... telnet open mail.server.org 25 Connection Failed open mail.server.org 465 Connection Failed open mail.server.org 587 Connection Failed I'm sure this is the smtp server (gmail reports it as the SMTP server that sent the email to it.) gmail uses imap Quote Link to comment Share on other sites More sharing options...
MxToolBox Posted October 2, 2009 Share Posted October 2, 2009 Thanks for the links digip :-). Ok I tried the link with this... telnet open mail.server.org 25 Connection Failed open mail.server.org 465 Connection Failed open mail.server.org 587 Connection Failed I'm sure this is the smtp server (gmail reports it as the SMTP server that sent the email to it.) Are you trying to connect from home? Many ISP's block outbound SMTP (port 25) connections from their network to help curb spam. You can do two things to confirm this. First try running a port scan from our site on the server. That will confirm that it is listening on port 25. If it is open and you run 'telnet server.com 25' from your connection and do not get a 220, then you know that either your local firewall or your ISP is blocking connections on port 25. Unfortunately there isn't much you can do about this. For such reasons many administrators will open an additional port on their servers to let their users connect from behind these ISP's blocks. 587 is an RFC recommend port, but also 2525 and 2500 are commonly used because they are more likely to be open. Hope this information helps. Let us know if you have any other questions we can help with. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.