31.3.DragonFly 邮件代理(DMA)

DragonFly Mail Agent (DMA) 是从 FreeBSD 版本 14.0 开始的默认 MTA。dma(8) 是一款小型的邮件传输代理(MTA),设计用于家庭和办公室使用。它接受来自本地安装的邮件用户代理(MUA)的邮件,并将邮件传递到本地或远程目的地。远程传递包括多个功能,如 TLS/SSL 支持和 SMTP 身份验证。

dma(8) 并不打算取代真正的大型 MTA,如 sendmail(8)postfix(1)。因此,dma(8) 不会在端口 25 上监听传入连接。

31.3.1. 配置 DragonFly Mail Agent (DMA)

DMA 提供了一个默认配置,适合许多部署。自定义设置可以在 /etc/dma/dma.conf 中定义,SMTP 身份验证配置在 /etc/dma/auth.conf 中。

31.3.1.1. 使用 DMA 通过 Gmail 路由传出邮件(STARTTLS:SMTP 示例)

这个示例 /etc/dma/dma.conf 可用于通过 Google 的 SMTP 服务器发送邮件。

SMARTHOST smtp.gmail.com
PORT 587
AUTHPATH /etc/dma/auth.conf
SECURETRANSFER
STARTTLS
MASQUERADE [email protected]

可以通过在 /etc/dma/auth.conf 中添加一行来设置身份验证:

[email protected]|smtp.gmail.com:password

注意

如果你启用了双重身份验证,你需要生成一个应用专用密码,因为你的普通登录密码会被拒绝。有关 应用专用密码 的更多信息,请参阅 Google 文档。

执行以下命令以测试配置:

% echo this is a test | mail -v -s testing-email [email protected]

31.3.1.2. 使用 DMA 通过 Fastmail 路由传出邮件(SSL/TLS 示例)

这个示例 /etc/dma/dma.conf 可用于通过 Fastmail 的 SMTP 服务器发送邮件。

SMARTHOST smtp.fastmail.com
PORT 465
AUTHPATH /etc/dma/auth.conf
SECURETRANSFER
MAILNAME example.server.com

可以通过在 /etc/dma/auth.conf 中添加一行来设置身份验证:

[email protected]|smtp.fastmail.com:password

执行以下命令以测试配置:

% echo this is a test | mail -v -s testing-email [email protected]

31.3.1.3. 使用 DMA 通过自定义邮件主机路由传出邮件

这个示例 /etc/dma/dma.conf 可用于通过自定义邮件主机发送邮件。

SMARTHOST mail.example.org
PORT 587
AUTHPATH /etc/dma/auth.conf
SECURETRANSFER
STARTTLS

可以通过在 /etc/dma/auth.conf 中添加一行来设置身份验证:

[email protected]|mail.example.org:password

执行以下命令以测试配置:

% echo this is a test | mail -v -s testing-email [email protected]

最后更新于