Trying to understand email servers

0

I'm trying to understand how actually email servers and email works. I am not talking about the sending itself, but about - how server knows what emails it has assigned? And how you can assign email to a server, from technical point of view?

Example I have in mind is following:

From one of domain providers I have bought a domain (e.g. test.com) and a basic server to host a website. I don't have access to OS on this. I am able to create new email addresses using provided web interface. What I am thinking is - can I create new email account (address) without using provided web interface but by code? Email to and from which I can send later email without doing any extra assignment using web interface.


If that is not possible, why is that exactly? I did find some tutorial of setting up my own email server on Raspberry PI, but if I understand it correctly it would still need some domain - right?

EDIT

Since I guess my question is still not clear enough (sorry), let me shrink it down to simpler ones (I hope).

  1. Does email server have any knowledge of email addresses that are assigned to it?
  2. In above mentioned hosting provider's web interface for creating new email addresses what email address most likely is? In other words - what kind of record it might be? Is it MX record or something else?

sebap123

Posted 2018-10-24T17:35:09.530

Reputation: 113

Question was closed 2018-10-25T22:43:53.423

Email is a very well documented system. How your host implements it is up to the host. If they offer shell access you may be able to run commands in the shell that creates mailboxes. However, the correct thing to do is to ask your host for the allowable methods for mailbox creation. Yes, they will still be "aware" of the email addresses they are hosting because... wait for it... they are hosting them. MX records are part of the email system, but they are for routing mail on the domain, not specific email addresses. – music2myear – 2018-10-25T22:43:28.773

Answers

3

Your question is a bit vague, and therefore difficult to answer, but it sounds like you are asking about how do servers know where to send a specific email.

The answer is MX records. If I send an email to blah@gmail.com, my server will look up what servers are responsible for receiving gmail.com email.

The answer is held in DNS servers, as MX records. You can query these directly:

$ dig mx gmail.com +short
20 alt2.gmail-smtp-in.l.google.com.
10 alt1.gmail-smtp-in.l.google.com.
40 alt4.gmail-smtp-in.l.google.com.
30 alt3.gmail-smtp-in.l.google.com.
5 gmail-smtp-in.l.google.com.

It sounds like you would benefit from reading about email in general. The main protocol involved is called SMTP, or simple mail transfer protocol. You should spend some time reading about it.

Brock

Posted 2018-10-24T17:35:09.530

Reputation: 31

I updated my question to (hopefully) make it a bit more clear. Although your answer is helpful I don't think its answering my question. I'd appreciate if you could check that. – sebap123 – 2018-10-25T17:25:59.240