# 31.2.邮件组件

电子邮件交换涉及五个主要部分：邮件用户代理（MUA）、邮件传输代理（MTA）、邮件主机、远程或本地邮箱以及域名系统（DNS）。本节概述了这些组件。

**邮件用户代理（MUA）**\
邮件用户代理（MUA）是用于撰写、发送和接收电子邮件的应用程序。该应用程序可以是命令行程序，如内置的 `mail` 工具，也可以是来自 Ports 的第三方应用程序，如 alpine、elm 或 mutt。Ports Collection 中还提供了数十种图形化程序，包括 Claws Mail、Evolution 和 Thunderbird。一些组织提供可以通过 Web 浏览器访问的 Web 邮件程序。有关在 FreeBSD 上安装和使用 MUA 的更多信息，请参见 [Mail User Agents](https://docs.freebsd.org/en/books/handbook/mail/#mail-agents)。

**邮件传输代理（MTA）**\
邮件传输代理（MTA）负责接收传入邮件并发送传出邮件。从 FreeBSD 版本 14.0 开始，默认的 MTA 是 DragonFly Mail Agent（[dma(8)](https://man.freebsd.org/cgi/man.cgi?query=dma\&sektion=8\&format=html)）；在早期版本中，默认的 MTA 是 [sendmail(8)](https://man.freebsd.org/cgi/man.cgi?query=sendmail\&sektion=8\&format=html)。可以安装其他 MTA，如 Exim、Postfix 和 qmail，以替代默认的 MTA。

**邮件主机和邮箱**\
邮件主机是负责为主机或网络接收和发送邮件的服务器。邮件主机会收集所有发送到域的邮件，并根据配置将其存储在默认的 `mbox` 格式或替代的 Maildir 格式中。邮件存储后，可以通过 MUA 本地读取，也可以使用 POP 或 IMAP 等协议远程访问和收取。如果邮件是本地读取的，则无需安装 POP 或 IMAP 服务器。

**域名系统（DNS）**\
域名系统（DNS）及其守护进程 [named(8)](https://man.freebsd.org/cgi/man.cgi?query=named\&sektion=8\&format=html) 在邮件传递中起着重要作用。为了将邮件从一个站点传递到另一个站点，MTA 会在 DNS 中查找远程站点，以确定哪个主机将接收目标的邮件。当邮件从远程主机发送到 MTA 时，此过程也会发生。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://handbook.bsdcn.org/di-31-zhang-dian-zi-you-jian/31.2.-you-jian-zu-jian.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
