They are essentially the same as web servers, in that they can be hosted anywhere that your computer is able to connect to.
You can have a locally hosted mail server that is on the public internet and can be passed mails (via SMTP) which your mail client can then retrieve (via POP3 or IMAP). Or you can have a mail server which is not publicly accessible but simply retrieves mails from one which is.
Typically though a home user has neither of those, they simply have a mail client which is set up with the address details of their incoming and outgoing mail servers, be it Google or Outlook or SomeOtherMailService.
To answer your questions:
- Is there going to be my mail server: Like is there a local mail server like a local DNS server? First my local mail server gets it and it gives to google's mail server and so on.
You can, but probably don't. See above.
- Are mail servers held at ISPs?
If you go with the ISP provided email service then yes.
If they offer the service but you don't use it then they still have servers but you simply bypass them and go direct to your actual mail service.
If they don't offer the service then no, they don't need or have mail servers.
- Are mail servers different from web servers, i.e. are they different machines or are they two processes running on the same machine?
They are typically just programs running on a machine. It can be the same machine as a web server or a separate machine. How it is set up is up to the people who set it up.
- I also hear SMTP servers, are they same as mail servers, just a
different terminology or something else?
SMTP is the protocol used to transfer mails from a client to a server or for a server to pass it on to another server. An SMTP server is a server specifically waiting to relay mail messages onwards to a final destination.
Think of SMTP as the post box in the street and the postal system behind it. SMTP manages the routing and delivery of mail just like the postal system does.
You then collect your mail from a "holding" mail server rather than a relay mail server. You can thing of this as your doormat if that helps with the analogy, but it is simply another server you connect to to check for mails.
are outgoing and incoming mail servers different? Aren't they just one machine? – mathmaniage – 2018-04-12T08:09:32.083
and if mail and web servers have can be two processes running on the same machine, how can they have two different cannonical names for the same machine? – mathmaniage – 2018-04-12T08:10:54.893
@mathmaniage Outgoing and incoming mail servers can be two separate programs running on one machine, two programs running on two machines, or one program on one machine that responds on two different ports. It's entirely dependant on software used and how the IT department set it up. Machine names are just that, names. Just like you can have several different names on the internet machines can also have multiple names for the same server, that is one of the things that DNS can do for you. – Mokubai – 2018-04-12T08:15:56.940
I found out google is now using an internal api for sending mail and all. Does that mean we'd be unable to send mails using smtp only? – mathmaniage – 2018-04-12T08:35:54.850
No, because their API is only used internally, presumably for Google mailboxes to other Google mailboxes, for their Webapp and Android/iOS apps, or to simply transit their rather voluminous and convoluted network topology. The external "standard" interfaces will still be SMTP. – Mokubai – 2018-04-12T08:45:28.603
Well, please see this: https://stackoverflow.com/questions/10147455/how-to-send-an-email-with-gmail-as-provider-using-python , IDK in the question section in the comments it's written a bit different.
– mathmaniage – 2018-04-12T08:53:49.467also using the smtplib for gmail doesn't work: https://pastebin.com/LnbUrgzQ
– mathmaniage – 2018-04-12T08:59:16.113it says to login via a web browser – mathmaniage – 2018-04-12T09:00:56.403
Maybe I should make another post for this one. – mathmaniage – 2018-04-12T09:03:02.540
Ah. Okay. Google are effectively phasing out SMTP in favour of a different and more secure standard. That doesn't really change the crux of the question or my answer but really should be a different question entirely. It's a different method of moving messages, but the result is the same: you pass your emails to Google, they move them on for you. – Mokubai – 2018-04-12T09:15:29.893
It’s still SMTP, but with OAuth 2.0 authentication. – Daniel B – 2018-04-12T10:15:55.297
@DanielB , Don't know about the techies but that doesn't mean we can use something like: https://coad.ca/2017/05/17/sending-emails-using-tls-gmail-and-python/ right?
– mathmaniage – 2018-04-13T12:12:21.743You can, but you wouldn’t use a password to log in but XOAUTH2. The topic of how to use it is more suitable for [so].
– Daniel B – 2018-04-13T13:09:33.050