Postfix main.cf - 某些行消失 - 破坏 postfix

Postfix main.cf - 某些行消失 - 破坏 postfix

我有两台 VoIP freepbx 服务器。我设置了服务器 A 并将其克隆到服务器 B 并更改了主机名和 IP。

服务器 B 上的 postfix 配置文件似乎被删除了 5 行,这破坏了 postfix,导致超过 100GB 的日志文件填满了根分区。 (一次又一次地发送电子邮件失败)

我已经通过每 30 分钟更新一个新的 postfix 配置文件来解决这个问题,但我很想知道问题是什么以及它是如何发生的。

我已将文件设置为 400 w/ postfix:nobody 权限,但它仍然发生!

[root@voip2 postfix]# ll main.cf
-r-------- 1 postfix nobody 1226 Apr  4 12:30 main.cf

这是 main.cf 以及我如何安装它:

cat << 'EOL' >/etc/postfix/main.cf
#
# PostFix Config

##Modify Below [HOSTNAME]
myhostname = [HOSTNAME]

smtpd_banner = $myhostname ESMTP $mail_name
biff = no
append_dot_mydomain = no
readme_directory = no
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
smtp_use_tls=yes
smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/sasl/sasl_passwd
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
canonical_maps = hash:/etc/postfix/canonical
relayhost = [smtp.hmc1.comcast.net]:587
mydomain = domain.com
mydestination = $myhostname $myhostname.$mydomain localhost.$mydomain localhost
sender_canonical_maps = static:$myhostname@$mydomain
EOL

这是我的 main.cf 在随机混乱后的样子,这也是它一贯的样子:

#
# PostFix Config

##Modify Below [HOSTNAME]


smtpd_banner = $myhostname ESMTP $mail_name
biff = no
append_dot_mydomain = no
readme_directory = no
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache





mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases

canonical_maps = hash:/etc/postfix/canonical


mydestination = $myhostname $myhostname.$mydomain localhost.$mydomain localhost
sender_canonical_maps = static:$myhostname@$mydomain

这是隔夜日志文件的尾部:(这发生在我不在的那晚)

Apr  4 12:30:03 voip2 postfix/master[21006]: daemon started -- version 2.6.6, configuration /etc/postfix
Apr  4 12:59:25 voip2 postfix/postfix-script[22506]: stopping the Postfix mail system
Apr  4 12:59:25 voip2 postfix/master[21006]: terminating on signal 15
Apr  4 13:00:57 voip2 postfix/postfix-script[2374]: warning: not owned by root: /etc/postfix
Apr  4 13:00:57 voip2 postfix/postfix-script[2384]: warning: not owned by root: /etc/postfix/access
Apr  4 13:00:57 voip2 postfix/postfix-script[2385]: warning: not owned by root: /etc/postfix/canonical
Apr  4 13:00:57 voip2 postfix/postfix-script[2386]: warning: not owned by root: /etc/postfix/canonical.db
Apr  4 13:00:57 voip2 postfix/postfix-script[2387]: warning: not owned by root: /etc/postfix/generic
Apr  4 13:00:57 voip2 postfix/postfix-script[2388]: warning: not owned by root: /etc/postfix/header_checks
Apr  4 13:00:57 voip2 postfix/postfix-script[2389]: warning: not owned by root: /etc/postfix/main.cf
Apr  4 13:00:57 voip2 postfix/postfix-script[2390]: warning: not owned by root: /etc/postfix/master.cf
Apr  4 13:00:57 voip2 postfix/postfix-script[2391]: warning: not owned by root: /etc/postfix/relocated
Apr  4 13:00:57 voip2 postfix/postfix-script[2392]: warning: not owned by root: /etc/postfix/sasl
Apr  4 13:00:57 voip2 postfix/postfix-script[2393]: warning: not owned by root: /etc/postfix/sasl/sasl_passwd
Apr  4 13:00:57 voip2 postfix/postfix-script[2394]: warning: not owned by root: /etc/postfix/sasl/sasl_passwd.db
Apr  4 13:00:57 voip2 postfix/postfix-script[2395]: warning: not owned by root: /etc/postfix/transport
Apr  4 13:00:57 voip2 postfix/postfix-script[2396]: warning: not owned by root: /etc/postfix/virtual
Apr  4 13:00:57 voip2 postfix/postfix-script[2411]: starting the Postfix mail system
Apr  4 13:00:57 voip2 postfix/master[2412]: daemon started -- version 2.6.6, configuration /etc/postfix
Apr  4 13:21:15 voip2 postfix/postfix-script[8412]: refreshing the Postfix mail system
Apr  4 13:21:15 voip2 postfix/master[2412]: reload -- version 2.6.6, configuration /etc/postfix
Apr  5 00:00:01 voip2 postfix/sendmail[6683]: fatal: open /etc/postfix/main.cf: Permission denied
Apr  5 00:01:01 voip2 postfix/sendmail[6737]: fatal: open /etc/postfix/main.cf: Permission denied
Apr  5 00:06:24 voip2 postfix/sendmail[7139]: fatal: open /etc/postfix/main.cf: Permission denied
Apr  5 05:31:28 voip2 postfix/postfix-script[23065]: refreshing the Postfix mail system
Apr  5 05:31:28 voip2 postfix/master[2412]: reload -- version 2.6.6, configuration /etc/postfix
[root@voip2 log]#

编辑:看来这更像是一个 FreePBX 问题,我已经找到了“罪魁祸首”,当我将 TGZ 文件从服务器 A 恢复到服务器 B 时,就会发生这种情况

相关内容