re-ordering pages. adding dovecot page.

This commit is contained in:
Christoph Haas 2025-08-24 18:54:58 +02:00
parent 3a5508cdb5
commit 8a218dbe5a
5 changed files with 186 additions and 193 deletions

View file

@ -8,108 +8,13 @@ sidebar:
import { Aside } from "@astrojs/starlight/components";
import "@splidejs/splide/css";
import { Splide, SplideSlide } from "astro-splide";
import { Steps } from "@astrojs/starlight/components";
import Box from "../../../components/Box.astro";
import StepListReceive from "../../../components/StepListReceive.astro";
I have created a slideshow to help you understand the process of receiving an email from a remote mail server. Use the
arrows to navigate between slides:
<Splide>
{Array.from({ length: 24 }, (_, i) => i + 1).map((i) => (
<SplideSlide key={i}>
<img src={`/big-picture-receive/${String(i).padStart(2, "0")}.svg`} alt={`Slide ${i}`} />
</SplideSlide>
))}
</Splide>
---
Let's tackle the receiving of emails step by step:
## DNS
<StepListReceive currentStep={1} />
As shown in the slideshow, you need to have proper DNS records set up. Say that you want to receive emails for the
`example.com` domain. If some other mail server on the internet wants to send an email to your server, it looks for two
records:
- **MX record (`example.com`)**
The MX (Mail Exchange) record tells other mail servers _where to deliver emails_ for the domain `example.com`.
Instead of pointing directly to an IP address, it points to a **hostname** (for example, `smtp.example.com`).
MX records also include a **priority value**. If multiple mail servers are listed, the one with the lowest priority
number is tried first. Others are used as fallback if the first is unavailable.
- **A / AAAA record (`smtp.example.com`)**
The hostname specified in the MX record (`smtp.example.com`) must resolve to an IP address so that other mail servers
know how to reach it.
- An **A record** maps the hostname to an IPv4 address.
- An **AAAA record** maps the hostname to an IPv6 address.
Once resolved, the sending mail server connects to that IP address on **TCP port 25**, which is the standard port for
email delivery (SMTP).
<Aside>
If no MX record is found, the remote mail server will instead directly look for an A or AAAA record of `example.com`.
</Aside>
<Aside type="caution">
The MX record must point to a hostname. It **must not** point to an IP address directly.
</Aside>
In zone syntax you would create something like:
```
@ IN MX 10 smtp
smtp IN A 100.64.17.3
smtp IN A fd7a:115c:a1e0::17
```
If possible, also add a PTR record that makes the IP addresses point back to the name `smtp.example.com`. Other mail
servers may be more likely so flag your sent emails as spam if you do not have a PTR record. Preferable the forward
(A/AAAA) and reverse (PTR) records match.
<Aside icon="approve-check-circle" title="Test it">
Use the `host` command to check your domain's MX record.
```sh
$> host -t mx example.com
example.com mail is handled by 10 smtp.example.com.
```
Then check if that result resolves to an IP address:
```sh
$> host smtp.example.com
smtp.example.com has address 49.13.89.249
smtp.example.com has IPv6 address 2a01:4f8:c012:62d1::1
```
Preferably the IP addresses should resolve back to the mail server's name:
```sh
$> host 49.13.89.249
249.89.13.49.in-addr.arpa domain name pointer smtp.example.com.
$> host 2a01:4f8:c012:62d1::1
1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.1.d.2.6.2.1.0.c.8.f.4.0.1.0.a.2.ip6.arpa domain name pointer smtp.example.com.
```
</Aside>
## Postfix
<StepListReceive currentStep={2} />
<StepListReceive currentStep={3} />
Now that other mail servers can locate your mail server, the next step is to make sure it can receive and process
incoming emails. This task is handled by Postfix, which communicates using the SMTP protocol.