두 개의 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 문제에 더 가까운 것 같습니다. "범인"을 찾았습니다. 이는 서버 A에서 서버 B로 TGZ 파일을 복원할 때 발생합니다.