CentOS 7 - Postfix 无法启动

CentOS 7 - Postfix 无法启动

目前无法启动 postfix。这是我收到的错误:

warning: unreasonable macro call nesting: "mydomain"
warning: unreasonable macro call nesting: ", localhost."
warning: unreasonable macro call nesting: "mydomain"
warning: unreasonable macro call nesting: ", localhost, "
warning: unreasonable macro call nesting: "mydomain"
fatal: dictionary mail_dict: macro processing error
postfix.service: control process exited, code=exited status=1
Failed to start Postfix Mail Transport Agent.
Unit postfix.service entered failed state.
postfix.service failed.

这是我的 main.cf(仅包含取消注释并添加到文件的部分):

myhostname = mail.domain.net
mydomain = domain.net
myorigin = $mydomain
home_mailbox = mail/
mynetworks = 127.0.0.0/8
inet_interfaces = all
inet_protocols = all
inet_interfaces = localhost
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_local_domain =
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_sasl_auth_enable = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
smtp_tls_security_level = may
smtpd_tls_security_level = may
smtp_tls_note_starttls_offer = yes
smtpd_tls_loglevel = 1
smtpd_tls_key_file = /etc/postfix/ssl/server.key
smtpd_tls_cert_file = /etc/postfix/ssl/server.crt
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom

在上面的代码中,我在本地代码中编辑了 mail.domain.net 和 domain.net。

Postconf -n 完整内容:

postconf: warning: unreasonable macro call nesting: "mail.domain.net    mydomain = domain.net    myorigin = "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: "    home_mailbox = mail/    mynetworks = 127.0.0.0/8    relay_domains =     inet_interfaces = all    inet_protocols = all    mydestination = "
postconf: warning: unreasonable macro call nesting: "myhostname"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost."
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: warning: unreasonable macro call nesting: ", localhost, "
postconf: warning: unreasonable macro call nesting: "mydomain"
postconf: fatal: dictionary mail_dict: macro processing error

答案1

我在你的 main.cf 上看到一个错误:应该只有一行,inet_interfaces并且localhost“net_interfaces”不是有效值

http://www.postfix.org/postconf.5.html#inet_interfaces

inet_interfaces(默认:全部)

此邮件系统接收邮件的网络接口地址。指定“all”表示在所有网络接口上接收邮件(默认),指定“loopback-only”表示仅在环回网络接口上接收邮件(Postfix 2.2 及更高版本)。该参数还控制将邮件投递给 user@[ip.address]。

注1:当此参数改变时,需要停止并启动Postfix。

注2:地址信息可以用[]括起来,但这里不要求这种形式。

当 inet_interfaces 仅指定一个非环回地址的 IPv4 和/或 IPv6 地址时,Postfix SMTP 客户端将使用此地址作为出站邮件的 IP 源地址。Postfix 2.2 及更高版本支持 IPv6。

在多宿主防火墙上,单独的 Postfix 实例监听“内部”和“外部”接口,这可以防止每个实例能够到达防火墙“另一侧”的远程 SMTP 服务器。将 smtp_bind_address 设置为 0.0.0.0 可避免 IPv4 的潜在问题,将 smtp_bind_address6 设置为 :: 可解决 IPv6 的问题。

对于多宿主防火墙,更好的解决方案是保留 inet_interfaces默认值,而是在 master.cf SMTP 服务器定义中使用显式 IP 地址。这样可以保留 Postfix SMTP 客户端的循环检测,确保防火墙的每一侧都知道另一个 IP 地址仍然是同一主机。设置$inet_interfaces为单个 IPv4 和/或 IPV6 地址主要用于在辅助 IP 地址上虚拟托管域,此时每个 IP 地址服务于不同的域(并且具有不同的 $myhostname 设置)。

另请参阅 proxy_interfaces 参数,了解通过代理或地址转换器转发到 Postfix 的网络地址。示例:

inet_interfaces = all (DEFAULT)
inet_interfaces = loopback-only (Postfix version 2.2 and later)
inet_interfaces = 127.0.0.1
inet_interfaces = 127.0.0.1, [::1] (Postfix version 2.2 and later)
inet_interfaces = 192.168.1.2, 127.0.0.1

答案2

我认为你需要relayhost = your_mta

相关内容