Jump to content

SMTP Email


Zimmer

Recommended Posts

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 :-)

Link to comment
Share on other sites

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

&gt;&gt;&gt; mailServer = smtplib.SMTP("sever.domain.ext", 25)
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  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

&gt;&gt;&gt; mailServer = smtplib.SMTP("server.domain.ext", 587)
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  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.

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...