Understanding how emails works in linux is a wide and difficult question:
https://en.m.wikipedia.org/wiki/Email
(see the operation part of the page)

The postfix in linux systems is a application who transmits emails or receives them and stores them into files. It does not help you to read or manage your emails. When you send email from your client application from u...@mydomain.com to us...@example.com first your client application connects to postfix instance with your credentials and sends email from client application to ‎us...@example.com and uses remote postfix server as proxy in the middle of your email client application and us...@example.com (this type of operations are required because if we imagine working email server with correct configurations only your remote postfix instance is verified and authorized to send emails as the name of the domain mydomain.com and your client application might change networks (especially for mobile clients) but emails will not get into spam boxes). Then when email reaches to remote postfix instance first it checks if you are authorized to send by using u...@mydomain.com and then it queries dns record type MX to check address of email server of domain example.com, then it connects using smtp protocol to remote server and pushes email to it. Remote server also does the same type of verifications when receives email from your postfix instance. In order to read the emails from your inbox (which postfix received and stored in files) you have to use completely different services. You might use dovecot, cyrus-imapd. It is a really complex system (even configuring postfix also a very complex). I rather recommend getting a courses of how email systems works, advanced configurations of postfix, handling email in linux, or hire a professional (in my opinion email in linux is more difficult than the rest of the system except kernel). 

Anvar Kuchkartaev 
an...@anvartay.com 
From: cac...@quantum-equities.com
Sent: domingo, 15 de octubre de 2017 07:02 p.m.
To: postfix-users@postfix.org
Subject: n00b To The Mechanics

I've run Linux on all my machines for 18 years, but have never needed to understand the workings of email, as I've always used shared hosting and cPanel.  Now I'm setting up my own server and I'd like to understand the actual mechanics of email.

I've read several Postfix docs including http://www.postfix.org/OVERVIEW.html and still don't get it.

It seems that Postfix is only an SMTP server;  it only listens on 25.  If I understand, it listens on 25 for incoming mail, processes it, then saves it in a flat file.

- If someone sends me an email to char...@example1.com,  example1.com resolves to some IP which finds my Postfix server on 25.  That email is then stored at /var/spool/mail/charles right?

- What if I want to receive email in the name of someone who does not have a passwd account on that machine?  How does that work and how would I set it up?

- If someone then sends an email to me at charles@example2.com, how can I differentiate that email from the one to example1.com?

- So these emails are now stored on my mail server.  How do I get them to my workstation, and where would they go?  Or would my mail client in my workstation fetch them directly from the mail server, and if so how?

- If this is how things work, what role does pop3 or imap play?  I've always used Thunderbird as a mail client, and I've always set it to fetch from mail.example1.com.  How would my workstation and the DNS system know where mail.example1.com is?  There's nowhere to set it in Postfix, and there doesn't seem to be a virtual hosts function.

- I have never been able to make Thunderbird fetch local mail from /var/spool/mail.  Is there some trick, or a better way?  I'm not wedded to Thunderbird but it does store email where I want it and in a flat-file, unlike a number of other clients, and it is easy to use.




Reply via email to