Skip to the content ForoHackers
Log inJoin

Email and messaging servers: start here

Email and messaging servers
#3191 · · Quote · Report

Email is a federated system: any server can send to any other, with no central owner, over protocols designed long before spam and fraud. Running a mail or messaging server means moving messages reliably and proving that yours are genuine, which is where most of the difficulty lives.

Key concepts

  • Message flow: a mail user agent submits to a server, which relays by SMTP to the recipient's server, which stores it for retrieval by IMAP.
  • DNS records: MX says where mail for a domain goes; SPF, DKIM and DMARC let receivers judge whether a sender is legitimate.
  • Queues and retries: temporary failures are retried for days, and a bounce reports a permanent one.
  • Transport security: TLS between servers and clients, and authentication before relaying.
  • Reputation and filtering: receivers score senders and filter spam, so a misconfigured server is quickly distrusted.

Vocabulary

  • MTA: mail transfer agent, the server that relays messages by SMTP.
  • MDA and IMAP server: the parts that deliver to a mailbox and let clients read it.
  • Open relay: a server that forwards mail for anyone, which must never be left open.
  • Bounce: a delivery failure notice sent back to the sender.
  • Federation: independent servers interoperating by a shared protocol, as email and many chat systems do.

What to study, in order

  1. Follow one message by hand: speak SMTP to your own lab server with a terminal client and read the headers.
  2. Install a mail server in a lab and send between two domains you control.
  3. Add MX, SPF, DKIM and DMARC records and check them from the receiving side.
  4. Configure TLS, authentication and a spam filter, and read the logs of each decision.
  5. Look at a federated chat server such as XMPP or Matrix and compare its model with email's.

Related tags

#dns #sysadmin #self-hosting #protocols #network-security

You are not logged in, so this goes up anonymously: no account, no name and no address is stored with it, and it may carry no link and no image. Log in or join to post under your name. Our web server's logs keep the address and time of every request for up to 14 days; to keep yours out of them, use Tor. To reach the staff in confidence, use the drop. Sign as a returning source (a key kept only in this browser)

Sending takes a few seconds here: your browser first works out a proof of work against spam.

Reply