CentOS 7 – 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 

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

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

inet_interfaces(默认:全部)

该邮件系统接收邮件的networking接口地址。 指定“全部”在所有networking接口(默认)上接收邮件,并且仅在回送networking接口上接收邮件(仅限于回送)(Postfix版本2.2和更高版本)。 该参数还控制邮件传递给用户@ [ip.address]。

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

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

当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的问题。

多宿主防火墙的一个更好的解决scheme是将inet_interfaces为默认值,而在master.cf SMTP服务器定义中使用明确的IP地址。 这通过确保防火墙的每一侧知道其他IP地址仍然是相同的主机来保留Postfix SMTP客户端的环路检测。 当每个IP地址服务于不同的域(并且具有不同的$ myhostname设置)时,将$inet_interfaces设置$inet_interfaces单个IPv4和/或IPV6地址主要用于辅助IP地址上的域的虚拟托pipe。

对于通过代理或地址转换器转发到Postfix的networking地址,另请参阅proxy_interfaces参数。 例子:

 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 

我想你需要relayhost = your_mta