我的 Postfix 邮件日志一直出现这个错误;
Oct 4 10:32:50 postfix/master[9760]: daemon started -- version 2.9.6, configuration /etc/postfix
Oct 4 10:32:54 postfix/postqueue[9885]: warning: Mail system is down -- accessing queue directly
由于此错误,我也无法刷新 Postfix 中的队列。postconf -n 输出:
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
inet_interfaces = all
inet_protocols = ipv4
mailbox_size_limit = 0
mydestination = localhost
myhostname = host.example.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_recipient_restrictions = permit_sasl_authenticated permit_mynetworks reject_unauth_destination # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for # information on enabling SSL in the smtp client.
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/ssl/certs/dovecot.pem
smtpd_tls_key_file = /etc/ssl/private/dovecot.pem
smtpd_use_tls = yes
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
virtual_transport = lmtp:unix:private/dovecot-lmtp
我的master.cf:
#
# Postfix master process configuration file. For details on the format
# of the file, see the master(5) manual page (command: "man 5 master").
#
# Do not forget to execute "postfix reload" after editing this file.
#
# ==========================================================================
# service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (yes) (never) (100)
# ==========================================================================
smtp inet n - - - - smtpd
#smtp inet n - - - 1 postscreen
#smtpd pass - - - - - smtpd
#dnsblog unix - - - - 0 dnsblog
#tlsproxy unix - - - - 0 tlsproxy
submission inet n - - - - smtpd
# -o syslog_name=postfix/submission
# -o smtpd_tls_security_level=encrypt
# -o smtpd_sasl_auth_enable=yes
# -o smtpd_client_restrictions=permit_sasl_authenticated,reject
# -o milter_macro_daemon_name=ORIGINATING
smtps inet n - - - - smtpd
# -o syslog_name=postfix/smtps
# -o smtpd_tls_wrappermode=yes
# -o smtpd_sasl_auth_enable=yes
# -o smtpd_client_restrictions=permit_sasl_authenticated,reject
# -o milter_macro_daemon_name=ORIGINATINGrelay unix - - n - - smtp
flush unix n - n 1000? 0 flush
trace unix - - n - 0 bounce
verify unix - - n - 1 verify
proxymap unix - - n - - proxymap
anvil unix - - n - 1 anvil
scache unix - - n - 1 scache
discard unix - - n - - discard
tlsmgr unix - - n 1000? 1 tlsmgr
retry unix - - n - - error
proxywrite unix - - n - 1 proxymap
之前它在本地用户上运行良好,但是当我设置 mysql 虚拟用户时它停止工作。
ps wwaux | grep postfix 的输出:
root 11298 0.0 0.0 25112 1644 ? Ss 10:39 0:00 /usr/lib/postfix/master
postfix 11347 0.0 0.0 37820 2340 ? S 10:41 0:00 tlsmgr -l -t unix -u
postfix 12194 0.0 0.0 59352 4476 ? S 12:04 0:00 smtpd -n smtp -t inet -u -c -o stress=
postfix 12195 0.0 0.0 27176 1536 ? S 12:04 0:00 proxymap -t unix -u
postfix 12196 0.0 0.0 27176 1528 ? S 12:04 0:00 anvil -l -t unix -u
gage 12487 0.0 0.0 9388 928 pts/7 S+ 12:05 0:00 grep --color=auto postfix
netstat 的输出:
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 11298/master
tcp 0 0 127.0.0.1:25465 0.0.0.0:* LISTEN 2917/multicraft
tcp6 0 0 192.168.1.108:25569 :::* LISTEN 3791/java
答案1
Postfix 真的宕机了吗?如果您不断看到有关 Postfix 主服务器启动的消息,那么可能它也在中间停止了?(无论它是否记录任何内容)。
您正在运行 mailq 吗?这将产生有关“邮件系统已关闭”的警告。
如果您的虚拟用户设置有问题,那么您会想要了解 mysql 查询中发生了什么。也许可以使用 tcpdump 捕获一些数据库流量,并通过 Percona 的 pt-query-digest 和相关工具运行它。或者可能只是将所有查询记录到慢查询日志中(即阈值执行时间 = 0)。