Receive incoming mail (not sending) - terminology help
I am looking for a way to receive incoming mail on an ubuntu vm (Hetzner) and pipe it to a script / dump it in a folder / sql database, for reading from app code.
So email can be sent (from third parties) to [email protected], and i can read it from code.
The ultimate aim being to create something similar to a self hosted disposable email service.
Now i can google for a solution, and blindly follow a tutorial (usually using postfix) but i could really do with some pointers to what does what, so im not just crossing my fingers and hoping for the best.
1st things first - what type of server am i looking to create? At first i thought pop3/imap, but on further reading i think that refers to the server that allows mail clients(eg thunderbird) to read emails from the server. Then i thought SMTP, but that seems to be the code that receives messages from a mail client (eg thunderbird), and sends them out.
So what is the server that receives email from the wider internet called?
2nd, once i know what the thing is called (lets call in IncomingMailServer for now), how do i configure DNS to point to my vm?
I already have an A record pointing example.com to my vm's public IP address (and have nginx listening on port 80 to server html), do i just add an mx record pointing to example.com and have IncomingMailServer listen on a certain port? Or is there more to it?
Any help appreciated.