You probably know how to send a message, but not a lot of people know what happens when you do it.rnDo not get scared, this is not complicated, but it is not simple either. Each message obviously goes through many points on it's way.
These points are divided into
- Your own computer. This is where your mail client is located. Your computer starts the process and initiates connection. Once you press "Send" button, this is where your message is coming from.
2. Mail server you connect to. Any email must always come through one (or usually two or three) SMTP servers. (They are sometimes called mail servers or email servers, whatever you prefer, we will not get stuck on the names, but just so you know).
3. Email messages storage. This is where your message will end up after you send it and it is delivered. Each user has a "mailbox", it is a place on hard disk, where his messages are stored until he can read them. In your case, your message will wait for your recipient to read it. Messages never go directly to recipient's computer. Your target recipient will check from time to time if there are messages in his mailbox.
4. And of course your receiver workstation. This is where your message is going to end up. When you are sending anything, this is where your message is going to be read.
Well, let me show you a real life scenario step by step.
This is Jane, she wants to tell John how she liked her date with him and she wants to thank him and invite him to dinner in a romantic restaurant. She is asking him what cuisine he prefers and if he likes French restaurant downtown or that lovely small family restaurant down the street. ..
Sorry, got distracted. I am still talking about email servers.
OK, let's concentrate.
She writes the letter and hits "Send" button and naturally, this message goes to her server. Everyone must specify SMTP server (sometimes it is specified for you, like in case you have Gmail or Yahoo account, or your company has a system admin, that does it for you).
This mail server is a big piece of software... Usually even more than one big piece :) It will look at the message headers, examine the destination and will try to find the address of another SMTP server, that is responsible for holding messages for John.
Now, here is that other SMTP server. In some easy case, when both John's and Jane's emails are located on the same domain, like if John's email is
john@gmail.com and Jane's email is
jane@gmail.com, com, you will not need to search, no need to contact any other SMTP server.
We call it "local delivery". Similar to when you want to send a letter to a guy, who lives in the same building as you. Just drop it in his mailbox. No need for stamp or postman. See, nothing to it.
Most of the times we will not be that lucky. When John's email is located on a different server, we will need to find where exactly.
We will ask a DNS (Domain Name Server) for the IP address, which is the exact location of John's server.
DNS is a very large database. It is like a telephone book for IP addresses. You give it a domain name, it gives you back a number... Well, four numbers, that's the IP address.
We know, that in our example John's email is not on gmail.com.
Let's say his email is: john@yahoo.
Server drops the first part with the username ("john@") and is left with just yahoo.com
It runs an MX (Mail eXchange) search in the DNS database. It spits out IP address or addresses of where yahoo.com really is (it can have more than one IP for one name, especially for big providers. Similar to rich boys having many apartments in different cities, but we won't get into that). I just mention that to scare you, that's all).
Wow. .. Glad that stage is over.
Almost done here. All that is left, is to actually talk to the other server and deliver the message to it.
We connect to other mail server, and place Jane's message into the loving care of John's mail server (this is simplified of course, but it is similar to what happens, I just skipped a few steps).
But that is not the end, now John's server will check if this message is spam, cause. .. you never know and this stage is so complex, I will not even scare you, you will see just a general overview of this process later and I will probably have a separate video explaining what are the most typical anti spam filters are and how they work.
It's important to know if you want to send a lot of email for your email marketing, but if you are here just out of curiosity, you don't need it.
Just so you know, most of your server's processing power is devoted to figuring if a certain message is spam or not. Often there are separate computers just for that.
Because delivering a message is pretty easy, determining if it's spam or not, is hard.
Jane's message is in John's mail store, it has passed all the troubles and tribulations.
John will now read it at any moment he decides and they can finally agree on the restaurant.
So when this name comes up: "SMTP", what do we mean by that? Why is it called SMTP? Is this an acronym?
SMTP is just an abbreviation for Simple Mail Transfer Protocol. ..
I don't know what's so simple about it. ..
Perhaps whoever named it, had another, more complex protocol in mind? Well, not really, that's the only one we have.
Brainiacs of the Internet defined it in 1982. Perhaps they consider it simple. ..
But you have to keep in mind, that these guys did not have any instant messenger at that time. They used to actually deliver mail by hand. You know, one where it actually involves a postman.
But the protocol itself is text only. Back in the day, the brainiacs thought that text is all we will ever need to deliver, so the protocol is all text. Now we need extensions to deliver anything non-text. It is just a workaround.
Yeeeah, right, OK.
You will be glad to know, that this protocol is standard for all email servers.
Which means of course, that all the servers on the planet must work this way and they must adhere to the protocol.
Of course this excludes Microsoft, because they have "special" engineers and they know much better how their mail server should work.
They are so smart they don't need any protocols, they can just go without them So they partially support SMTP protocol.
Well, it's very flaky. In many places in their SMTP servers they do something against the protocol and I have seen it many times. But since they are Microsoft they are at Ten Tonn guerrilla, sold thy are OK to just ignore it.
But besides Microsoft everybody else uses it
rnSpam checks, very high level overview.
We suspect any message that comes into our mail server and we examine it even before the message comes in we look at the connection it comes from.
Email server examines your IP to see if you are from a "bad neighborhood". There are lots of databases that check and update a list of "bad IP addresses" and if your IP will be there, your connection will be rejected before you will even have a chance to start the conversation.
It is similar to "we do not open the door to strangers" thing.
After you are past that check, server will verify that the headers you send are correct.
It will also check that the domain you from exists and is OK to send your messages.
The net will also check the "From:" address. It will see that the domain on you "From:" exists and it is accepting messages.
Of course it will check your message itself. This is what takes the most time. Many trained AI algorithms are developed for this step.
It will find any "stop" words like make a million dollars, won a lottery, making money fast and so on. Most of these words can be found in any spam message.
I should say, that statistically, about 80% - 90% of all email in the world right now is spam!
Just a few idiots create that heavy load on all of the servers, which we pay for. Reminds me of the government... Hehe. We pay the fees to our ISP.
They dump the money into infrastructure to filter out all this garbage. 90% of all email energy is heat.