我试图让 sendmail 将邮件传输到 MX 记录中指定的服务器,因此当服务器向 me@domain.com 发送电子邮件时,我希望它跳过 localhost 并直接转到 gmail。
我已经浏览了 sendmail 文档,但不太明白如何解释我的情况。本质上,我的服务器的主机名是“www.domain.com”,但是当我向“me@domain.com”发送电子邮件时,它最终会出现在本地邮件池中。
当我在调试模式下运行 sendmail 时:
sendmail -bt
> $=w
Run Code Online (Sandbox Code Playgroud)
我得到:
www.domain.com
www.domain.com.
domain.com
localhost
[54.245.___.___]
Run Code Online (Sandbox Code Playgroud)
因此,它正在拦截所有发往domain.com. 我不希望它到达localhost. 我希望它转到 gmail 服务器。
绑定到其他地址的所有邮件都可以正常工作。我也将 sendmail 配置为使用 DKIM。
我已经向 mailertable 添加了一条记录(并重建了 mailertable.db 并重新编译了 mc>cf 文件),但我不确定这是否是我需要做的,或者我是否做得正确。
domain.com esmtp:[aspmx.l.google.com]
Run Code Online (Sandbox Code Playgroud)
如何让它允许绑定到 users@domain.com 的邮件离开服务器?
附加信息:这是我的 sendmail.mc 文件:
divert(-1)dnl
include(`/usr/share/sendmail-cf/m4/cf.m4')dnl
VERSIONID(`setup for linux')dnl
OSTYPE(`linux')dnl
define(`confDEF_USER_ID', ``8:12'')dnl
define(`confTO_CONNECT', `1m')dnl
define(`confTRY_NULL_MX_LIST', `True')dnl
define(`confDONT_PROBE_INTERFACES', `True')dnl
define(`PROCMAIL_MAILER_PATH', `/usr/bin/procmail')dnl
define(`ALIAS_FILE', `/etc/aliases')dnl
define(`STATUS_FILE', `/var/log/mail/statistics')dnl
define(`UUCP_MAILER_MAX', `2000000')dnl
define(`confUSERDB_SPEC', `/etc/mail/userdb.db')dnl
define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl …Run Code Online (Sandbox Code Playgroud) sendmail ×1