views:

95

answers:

2

As I know the email message sending process looks like this:

  1. The message is sent from sender's client to his server (say mail.com).
  2. The mail.com server redirects the message to recipients server (say gmail.com).
  3. Recipient's client connects to gmail.com and recieves new messages.

I'm interested in stage 2. I thought that the servers use SMTP protocol to make this negotiation. And gmail.com server should listen to 25 port to recieve a connection from mail.com and other servers.

But then I try to connect gmail.com (exactly, Google service) on port 25, the server is not responding...

Why? What's wrong?

+1  A: 

You need to delve into MX records a bit: Oversimplified DNS and MX record. The SMTP gateways use the MX records to route emails between each other. So, for a domain X the SMTP gateway might be mail.X : in other words, for gmail.com the mail gateway might be mail.gmail.com (example).

jldupont
Thanks for your answer :)
alexey
A: 

Mail servers do not redirect.

You have to use MX records to find a mail server. You can't just assume that there will be one on the bare domain name.

But then the mail server will either accept or reject your message. In some cases, usually only between very close and trusted friends, the mail server might RELAY your message onward to another mail server.

At one time, in the mid 90's, just about any mail server would accept a message and relay it. Many people relied on this behavior because IP packets would only travel 30 hops, and the edges of the Internet were more than 30 hops apart. For instance, Peru and Ukraine could not contact each other with IP packets, but they could both send mail to a server at aol.com and that mail server would relay it on to its destination.

It is best not to play around with email unless you read some modern up-to-date descriptions of how it works, and perhaps check the white papers at maawg.org. Also, many domains now expect strangers to submit their email via port 587 and authentication is required.

Michael Dillon